From b9b9a2468b59bcfb7e3cfd8c0bc77184d3e76b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Thu, 11 Jul 2024 08:18:15 +0900 Subject: [PATCH 01/32] FIX: Attempting to send messages when initializing the map --- simworld.cc | 23 ++++++++++++----------- simworld.h | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/simworld.cc b/simworld.cc index 17bac9a66d..a81b29b1c3 100644 --- a/simworld.cc +++ b/simworld.cc @@ -3517,7 +3517,7 @@ bool karte_t::change_player_tool(uint8 cmd, uint8 player_nr, uint16 param, bool return false; } if(exec) { - init_new_player( player_nr, (uint8) param ); + init_new_player( player_nr, (uint8) param, false ); // activate/deactivate AI immediately player_t *player = get_player(player_nr); if (param != player_t::HUMAN && player) { @@ -10250,7 +10250,7 @@ koord karte_t::get_closest_coordinate(koord outside_pos) /* creates a new player with this type */ -const char *karte_t::init_new_player(uint8 new_player_in, uint8 type) +const char *karte_t::init_new_player(uint8 new_player_in, uint8 type, bool new_world) { if( new_player_in>=PLAYER_UNOWNED || get_player(new_player_in)!=NULL ) { return "Id invalid/already in use!"; @@ -10260,23 +10260,24 @@ const char *karte_t::init_new_player(uint8 new_player_in, uint8 type) case player_t::EMPTY: break; case player_t::HUMAN: players[new_player_in] = new player_t(new_player_in); - if( env_t::networkmode ){ - buf.printf(translator::translate("%s founded new company %s."), env_t::nickname.c_str(), players[new_player_in]->get_name()); - } - else{ + if (!new_world) { buf.printf(translator::translate("Now %s was founded."), players[new_player_in]->get_name()); + msg->add_message(buf, koord::invalid, message_t::ai, PLAYER_FLAG | new_player_in, IMG_EMPTY); } - msg->add_message(buf, koord::invalid, message_t::ai, PLAYER_FLAG | new_player_in, IMG_EMPTY); break; case player_t::AI_GOODS: players[new_player_in] = new ai_goods_t(new_player_in); - buf.printf(translator::translate("Now %s was founded. (Operating by Goods-AI)"), players[new_player_in]->get_name()); - msg->add_message(buf, koord::invalid, message_t::ai, PLAYER_FLAG | new_player_in, IMG_EMPTY); + if (!new_world) { + buf.printf(translator::translate("Now %s was founded. (Operating by Goods-AI)"), players[new_player_in]->get_name()); + msg->add_message(buf, koord::invalid, message_t::ai, PLAYER_FLAG | new_player_in, IMG_EMPTY); + } break; case player_t::AI_PASSENGER: players[new_player_in] = new ai_passenger_t(new_player_in); - buf.printf(translator::translate("Now %s was founded. (Operating by Passenger-AI)"), players[new_player_in]->get_name()); - msg->add_message(buf, koord::invalid, message_t::ai, PLAYER_FLAG | new_player_in, IMG_EMPTY); + if (!new_world) { + buf.printf(translator::translate("Now %s was founded. (Operating by Passenger-AI)"), players[new_player_in]->get_name()); + msg->add_message(buf, koord::invalid, message_t::ai, PLAYER_FLAG | new_player_in, IMG_EMPTY); + } break; default: return "Unknown AI type!"; } diff --git a/simworld.h b/simworld.h index 47ec556b7f..be9316b9ab 100644 --- a/simworld.h +++ b/simworld.h @@ -1158,7 +1158,7 @@ class karte_t player_t* get_active_player() const { return active_player; } uint8 get_active_player_nr() const { return active_player_nr; } void switch_active_player(uint8 nr, bool silent); - const char *init_new_player( uint8 nr, uint8 type ); + const char *init_new_player( uint8 nr, uint8 type, bool new_world=true ); void store_player_password_hash( uint8 player_nr, const pwd_hash_t& hash ); const pwd_hash_t& get_player_password_hash( uint8 player_nr ) const { return player_password_hash[player_nr]; } void clear_player_password_hashes(); From 5ab8ba4a1e3226e1606747d3d24878676b4e687f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 12 Jul 2024 06:28:21 +0900 Subject: [PATCH 02/32] FIX: Poorly designed because it is not theme-dependent. (Arrange Hajo's code) ADD: purple-night theme and silver theme designed by hajo --- gui/components/gui_container.cc | 4 +- gui/gui_theme.cc | 6 + gui/gui_theme.h | 2 + simcolor.h | 2 + simutrans/themes/modern.tab | 28 +- simutrans/themes/newstandard-large.tab | 13 +- simutrans/themes/purple_night-large.tab | 217 ++++++++++++ simutrans/themes/purple_night.tab | 217 ++++++++++++ simutrans/themes/silver-large.tab | 182 ++++++++++ simutrans/themes/silver.tab | 182 ++++++++++ simutrans/themes/theme-large.tab | 25 +- simutrans/themes/themes.tab | 7 +- themes.src/build_themes.sh | 13 + themes.src/modern/theme-large.tab | 19 +- themes.src/newstandard/newstandard-large.tab | 4 +- themes.src/newstandard/themes.tab | 5 +- themes.src/purple_night/back.png | Bin 0 -> 612 bytes themes.src/purple_night/build.sh | 6 + themes.src/purple_night/button-symbols.png | Bin 0 -> 190 bytes themes.src/purple_night/button.png | Bin 0 -> 7466 bytes themes.src/purple_night/checkbutton-small.png | Bin 0 -> 489 bytes themes.src/purple_night/checkbutton.png | Bin 0 -> 756 bytes themes.src/purple_night/divider.png | Bin 0 -> 231 bytes themes.src/purple_night/editfield.png | Bin 0 -> 648 bytes themes.src/purple_night/gadget.png | Bin 0 -> 1081 bytes themes.src/purple_night/listbox.png | Bin 0 -> 648 bytes themes.src/purple_night/posbutton-small.png | Bin 0 -> 650 bytes themes.src/purple_night/posbutton.png | Bin 0 -> 942 bytes .../purple_night/purple_night-large.tab | 217 ++++++++++++ themes.src/purple_night/purple_night.tab | 217 ++++++++++++ themes.src/purple_night/scrollbar-small.png | Bin 0 -> 2886 bytes themes.src/purple_night/scrollbar.png | Bin 0 -> 3914 bytes themes.src/purple_night/standard-large.dat | 218 ++++++++++++ themes.src/purple_night/standard.dat | 310 ++++++++++++++++++ themes.src/purple_night/symbols.png | Bin 0 -> 7707 bytes themes.src/silver/back.png | Bin 0 -> 633 bytes themes.src/silver/build.sh | 6 + themes.src/silver/button-symbols.png | Bin 0 -> 190 bytes themes.src/silver/button.png | Bin 0 -> 1685 bytes themes.src/silver/checkbutton-small.png | Bin 0 -> 487 bytes themes.src/silver/checkbutton.png | Bin 0 -> 768 bytes themes.src/silver/divider.png | Bin 0 -> 224 bytes themes.src/silver/editfield.png | Bin 0 -> 17210 bytes themes.src/silver/gadget.png | Bin 0 -> 1081 bytes themes.src/silver/listbox.png | Bin 0 -> 16969 bytes themes.src/silver/posbutton-small.png | Bin 0 -> 793 bytes themes.src/silver/posbutton.png | Bin 0 -> 1075 bytes themes.src/silver/scrollbar-small.png | Bin 0 -> 3606 bytes themes.src/silver/scrollbar.png | Bin 0 -> 4282 bytes themes.src/silver/silver-large.tab | 182 ++++++++++ themes.src/silver/silver.tab | 182 ++++++++++ themes.src/silver/standard-large.dat | 218 ++++++++++++ themes.src/silver/standard.dat | 310 ++++++++++++++++++ themes.src/silver/symbols.png | Bin 0 -> 7707 bytes 54 files changed, 2763 insertions(+), 29 deletions(-) create mode 100644 simutrans/themes/purple_night-large.tab create mode 100644 simutrans/themes/purple_night.tab create mode 100644 simutrans/themes/silver-large.tab create mode 100644 simutrans/themes/silver.tab create mode 100644 themes.src/purple_night/back.png create mode 100644 themes.src/purple_night/build.sh create mode 100644 themes.src/purple_night/button-symbols.png create mode 100644 themes.src/purple_night/button.png create mode 100644 themes.src/purple_night/checkbutton-small.png create mode 100644 themes.src/purple_night/checkbutton.png create mode 100644 themes.src/purple_night/divider.png create mode 100644 themes.src/purple_night/editfield.png create mode 100644 themes.src/purple_night/gadget.png create mode 100644 themes.src/purple_night/listbox.png create mode 100644 themes.src/purple_night/posbutton-small.png create mode 100644 themes.src/purple_night/posbutton.png create mode 100644 themes.src/purple_night/purple_night-large.tab create mode 100644 themes.src/purple_night/purple_night.tab create mode 100644 themes.src/purple_night/scrollbar-small.png create mode 100644 themes.src/purple_night/scrollbar.png create mode 100644 themes.src/purple_night/standard-large.dat create mode 100644 themes.src/purple_night/standard.dat create mode 100644 themes.src/purple_night/symbols.png create mode 100644 themes.src/silver/back.png create mode 100644 themes.src/silver/build.sh create mode 100644 themes.src/silver/button-symbols.png create mode 100644 themes.src/silver/button.png create mode 100644 themes.src/silver/checkbutton-small.png create mode 100644 themes.src/silver/checkbutton.png create mode 100644 themes.src/silver/divider.png create mode 100644 themes.src/silver/editfield.png create mode 100644 themes.src/silver/gadget.png create mode 100644 themes.src/silver/listbox.png create mode 100644 themes.src/silver/posbutton-small.png create mode 100644 themes.src/silver/posbutton.png create mode 100644 themes.src/silver/scrollbar-small.png create mode 100644 themes.src/silver/scrollbar.png create mode 100644 themes.src/silver/silver-large.tab create mode 100644 themes.src/silver/silver.tab create mode 100644 themes.src/silver/standard-large.dat create mode 100644 themes.src/silver/standard.dat create mode 100644 themes.src/silver/symbols.png diff --git a/gui/components/gui_container.cc b/gui/components/gui_container.cc index e69603f3e7..602ee43d8b 100644 --- a/gui/components/gui_container.cc +++ b/gui/components/gui_container.cc @@ -272,9 +272,9 @@ void gui_container_t::draw(scr_coord offset) continue; } - if (checkered && (checker_count&1)==0) { + if (checkered) { scr_coord c_pos = screen_pos + c->get_pos(); - display_blend_wh_rgb( c_pos.x, c_pos.y, c->get_size().w, c->get_size().h, color_idx_to_rgb(COL_WHITE), 50 ); + display_fillbox_wh_clip_rgb( c_pos.x, c_pos.y, c->get_size().w, c->get_size().h, (checker_count&1) ? SYSCOL_LIST_BACKGROUND_EVEN : SYSCOL_LIST_BACKGROUND_ODD, false); } if( c == comp_focus ) { diff --git a/gui/gui_theme.cc b/gui/gui_theme.cc index 868423cc01..442dfd6d82 100644 --- a/gui/gui_theme.cc +++ b/gui/gui_theme.cc @@ -43,6 +43,8 @@ PIXVAL gui_theme_t::gui_color_chart_lines_odd; PIXVAL gui_theme_t::gui_color_chart_lines_even; PIXVAL gui_theme_t::gui_color_list_text_selected_focus; PIXVAL gui_theme_t::gui_color_list_text_selected_nofocus; +PIXVAL gui_theme_t::gui_color_list_background_even; +PIXVAL gui_theme_t::gui_color_list_background_odd; PIXVAL gui_theme_t::gui_color_list_background_selected_f; PIXVAL gui_theme_t::gui_color_list_background_selected_nf; PIXVAL gui_theme_t::gui_color_button_text; @@ -195,6 +197,8 @@ void gui_theme_t::init_gui_defaults() gui_color_list_text_selected_focus = color_idx_to_rgb(COL_WHITE); gui_color_list_text_selected_nofocus = color_idx_to_rgb(MN_GREY3); + gui_color_list_background_even = color_idx_to_rgb(MN_GREY2); + gui_color_list_background_odd = color_idx_to_rgb(MN_GREY3); gui_color_list_background_selected_f = color_idx_to_rgb(COL_BLUE); gui_color_list_background_selected_nf = color_idx_to_rgb(COL_LIGHT_BLUE); @@ -620,6 +624,8 @@ bool gui_theme_t::themes_init(const char *file_name, bool init_fonts, bool init_ gui_theme_t::gui_color_chart_lines_even = (PIXVAL)contents.get_color("gui_color_chart_lines_even", SYSCOL_CHART_LINES_EVEN); gui_theme_t::gui_color_list_text_selected_focus = (PIXVAL)contents.get_color("gui_color_list_text_selected_focus", SYSCOL_LIST_TEXT_SELECTED_FOCUS); gui_theme_t::gui_color_list_text_selected_nofocus = (PIXVAL)contents.get_color("gui_color_list_text_selected_nofocus", SYSCOL_LIST_TEXT_SELECTED_NOFOCUS); + gui_theme_t::gui_color_list_background_even = (PIXVAL)contents.get_color("gui_color_list_background_even", SYSCOL_LIST_BACKGROUND_EVEN); + gui_theme_t::gui_color_list_background_odd = (PIXVAL)contents.get_color("gui_color_list_background_odd", SYSCOL_LIST_BACKGROUND_ODD); gui_theme_t::gui_color_list_background_selected_f = (PIXVAL)contents.get_color("gui_color_list_background_selected_focus", SYSCOL_LIST_BACKGROUND_SELECTED_F); gui_theme_t::gui_color_list_background_selected_nf = (PIXVAL)contents.get_color("gui_color_list_background_selected_nofocus", SYSCOL_LIST_BACKGROUND_SELECTED_NF); gui_theme_t::gui_color_button_text = (PIXVAL)contents.get_color("gui_color_button_text", SYSCOL_BUTTON_TEXT); diff --git a/gui/gui_theme.h b/gui/gui_theme.h index 3ae0049c6f..251a7b9bee 100644 --- a/gui/gui_theme.h +++ b/gui/gui_theme.h @@ -240,6 +240,8 @@ class gui_theme_t { static PIXVAL gui_color_chart_lines_even; //@< Color to draw in-chart vertical even lines and text static PIXVAL gui_color_list_text_selected_focus; //@< Colour to draw the selected element text in list when window has focus static PIXVAL gui_color_list_text_selected_nofocus; //@< Colour to draw the selected element text in list when window is not in focus + static PIXVAL gui_color_list_background_even; + static PIXVAL gui_color_list_background_odd; static PIXVAL gui_color_list_background_selected_f; //@< Colour to draw the selected element background in list when window has focus static PIXVAL gui_color_list_background_selected_nf; //@< Colour to draw the selected element background in list when window is not in focus static PIXVAL gui_color_button_text; //@< Color to draw text in normal buttons diff --git a/simcolor.h b/simcolor.h index 3a4545c1af..e8f858ee9a 100644 --- a/simcolor.h +++ b/simcolor.h @@ -175,6 +175,8 @@ typedef unsigned int FLAGGED_PIXVAL; #define SYSCOL_CHART_LINES_EVEN gui_theme_t::gui_color_chart_lines_even #define SYSCOL_LIST_TEXT_SELECTED_FOCUS gui_theme_t::gui_color_list_text_selected_focus #define SYSCOL_LIST_TEXT_SELECTED_NOFOCUS gui_theme_t::gui_color_list_text_selected_nofocus +#define SYSCOL_LIST_BACKGROUND_EVEN gui_theme_t::gui_color_list_background_even +#define SYSCOL_LIST_BACKGROUND_ODD gui_theme_t::gui_color_list_background_odd #define SYSCOL_LIST_BACKGROUND_SELECTED_F gui_theme_t::gui_color_list_background_selected_f #define SYSCOL_LIST_BACKGROUND_SELECTED_NF gui_theme_t::gui_color_list_background_selected_nf #define SYSCOL_BUTTON_TEXT gui_theme_t::gui_color_button_text diff --git a/simutrans/themes/modern.tab b/simutrans/themes/modern.tab index 7826162176..2668339d01 100644 --- a/simutrans/themes/modern.tab +++ b/simutrans/themes/modern.tab @@ -78,9 +78,11 @@ gui_color_chart_lines_zero = #005C9E gui_color_chart_lines_odd = #338FCC gui_color_chart_lines_even = #005C9E -gui_color_list_text_selected_focus = #FAFAFA -gui_color_list_text_selected_nofocus = #FAFAFA -gui_color_list_background_selected_focus = #72B2DD +gui_color_list_text_selected_focus = #FAFAFA +gui_color_list_text_selected_nofocus = #FAFAFA +gui_color_list_background_even = #B5DBEF +gui_color_list_background_odd = #DEF3FF +gui_color_list_background_selected_focus = #72B2DD gui_color_list_background_selected_nofocus = #72B2DD gui_color_button_text = #FAFAFA @@ -129,6 +131,26 @@ gui_chat_window_network_transparency = 0 # if defined, use plain color for chat window in network games gui_color_chat_window_network_transparency = #D6ECF7 +# Color for table +gui_color_table_frame = #6392BD +gui_color_table_background_head_row = #6392BD +gui_color_table_background_head_selected = #31596B +gui_color_table_header_border = #52799C +gui_color_table_cell_border = #8CC3E7 +gui_color_table_background_left_col = #8CC3E7 +gui_color_table_background_data_sum = #ABD3EF +gui_color_table_background_data = #C6E3F7 +gui_color_table_background = #E7F3FF +gui_color_table_background_highlight = #DEE5AD +gui_color_table_background_selected = #73b2de +gui_color_text_head_row = #FFFFFF +gui_color_text_left_col = #000000 +gui_color_text_head_selected = #ffffff +gui_color_text_table_cell_selected = #ffffff + +# Chart button +gui_color_chart_button_background = #99ddff + ##################################size stuff################################## # force main menu icon size diff --git a/simutrans/themes/newstandard-large.tab b/simutrans/themes/newstandard-large.tab index 39fbff46c9..b9ea7c9973 100644 --- a/simutrans/themes/newstandard-large.tab +++ b/simutrans/themes/newstandard-large.tab @@ -82,6 +82,8 @@ gui_color_obsolete = #0000F8 #gui_color_list_text_selected_focus = #000000 #gui_color_list_text_selected_nofocus = #000000 +gui_color_list_background_even = #BDCBD6 +gui_color_list_background_odd = #D6E3EF #gui_color_list_background_selected_focus = #000000 #gui_color_list_background_selected_nofocus = #000000 @@ -142,23 +144,28 @@ gui_color_table_cell_border = #8c9aad gui_color_table_background_left_col = #cedbe7 gui_color_table_background_data_sum = #c6d3de gui_color_table_background_data = #bdcbd6 -gui_color_table_background = #adbac6 +gui_color_table_background = #BDCBD6 +gui_color_table_background_highlight= #DEE5AD gui_color_text_head_row = #ffffff gui_color_text_left_col = #000000 #gui_color_table_frame = #5a829c #gui_color_table_background_head_row = #7392a5 +gui_color_table_background_head_selected = #73b2de #gui_color_table_header_border = #5a829c #gui_color_table_cell_border = #8c9aad #gui_color_table_background_left_col = #9cb2c6 #gui_color_table_background_data_sum = #a5bace #gui_color_table_background_data = #b1bfce #gui_color_table_background = #c6d3de +#gui_color_table_background_highlight= #DEE5AD +gui_color_table_background_selected = #73b2de #gui_color_text_head_row = #ffffff #gui_color_text_left_col = #000000 +gui_color_text_head_selected = #ffffff +gui_color_text_table_cell_selected = #ffffff -##################################size stuff################################## - +################################## Size settings ################################## # size of tools icon_width = 48 diff --git a/simutrans/themes/purple_night-large.tab b/simutrans/themes/purple_night-large.tab new file mode 100644 index 0000000000..62b907cf9e --- /dev/null +++ b/simutrans/themes/purple_night-large.tab @@ -0,0 +1,217 @@ +# +# Simutrans purple night large theme +# +# Read the wiki article for better explanation and full parameters list +# https://wiki.simutrans.com/en_themeDef +# + +# name of the theme (will be shown with file selector) +name=Purple Night (large size) + +# show tooltips (default 1=show) +show_tooltips = 1 + +# tooltip background color (+-1 around this index is used), taken from player-color table +tooltip_background_color = 4 + +# tooltip text color (240=black, 215=white) +tooltip_text_color = 240 + +# delay before showing tooltip in ms (default 500ms) +tooltip_delay = 500 + +# duration in ms during tooltip is visible (default 5000ms=5s) +tooltip_duration = 5000 + +# windows drop a little shadow (default off) +# gui_drop_shadows = 1 + +#################################window stuff################################# + +# when moving, you can use windows to snap onto each other seamlessly +# if you do not like it, set the catch radius to zero +window_snap_distance = 8 + +# show the windows close etc. buttons on the right (like Windows) +# window_buttons_right = 0 + +# closes windows/toolbar when button clicked a second time (default off=0) +second_open_closes_win = 0 + +# restores window position when window is reopening +# This will be saved, but will be discarded when screen is resized +remember_window_positions = 1 + +# there are three different ways to indicate an active window + +# first: draw a frame with titlebar color around active window +# window_frame_active = 0 + +# second: draw the title with a different brightness (0: dark ... 6: bright) +front_window_bar_color = 1 +bottom_window_bar_color = 3 + +# third (best together with 2nd):use different text color for bar +# some colors are 215-white, 240-black 208-214- all shades of gray +front_window_text_color = #DDDDDD +bottom_window_text_color = #C0C0C0 + +#################################colour stuff################################# + +default_window_title_color = #705726 + +gui_color_text = #C0C0C0 +gui_color_text_highlight = #908010 +gui_color_text_shadow = #00FF00 +gui_color_text_title = #338FCC +gui_color_text_strong = #E46A0B + +########Test######## +gui_color_empty = #868c86 +gui_color_obsolete = #2878ff + +gui_color_edit_text = #908010 +gui_color_edit_text_selected = #FAFAFA +gui_color_edit_text_disabled = #666666 +gui_color_edit_background_selected = #72B2DD +gui_color_edit_beam = #a89823 + +gui_color_chart_background = #2e2e40 +gui_color_chart_lines_zero = #005C9E +gui_color_chart_lines_odd = #68688e +gui_color_chart_lines_even = #68688e + +gui_color_list_text_selected_focus = #C0C0C0 +gui_color_list_text_selected_nofocus = #908010 +gui_color_list_background_selected_focus = #72B2DD +gui_color_list_background_selected_nofocus = #72B2DD + +gui_color_button_text = #C0C0C0 +gui_color_button_text_disabled = #8A8A8A +gui_color_button_text_selected = #FAFAFA + +gui_color_colored_button_text = #201000 +gui_color_colored_button_text_selected = #CCCCCC + +gui_color_checkbox_text = #C0C0C0 +gui_color_checkbox_text_disabled = #666666 + +gui_color_ticker_background = #3c3c52 +gui_color_ticker_divider = #4d4d69 + +gui_color_statusbar_text = #C0C0C0 +gui_color_statusbar_background = #3c3c52 +gui_color_statusbar_divider = #4d4d69 + +gui_highlight_color = #68688e +gui_shadow_color = #000000 + +gui_color_text_minus = #C07010 +gui_color_text_plus = #70C010 +gui_color_text_unused = #E46A0B + +# Color of cursor overlay, which is blended over marked ground tiles +cursor_overlay_color = #1060F0 + +# Color loadbar, save game, load game, server... +gui_color_loadingbar_progress = #6080A0 +gui_color_loadingbar_inner = #303246 + +# Color player bright +gui_player_color_dark = 3 +gui_player_color_bright = 7 +gui_titlebar_player_color_background_brightness = 2 + +# make the chat window transparent in network games +gui_chat_window_network_transparency = 25 + +# if defined, use plain color for chat window in network games +gui_color_chat_window_network_transparency = #D6ECF7 + +# Transparency color of boost icons (mail, energy, passangers) in factories +gui_color_image_transparency = #ffffff + +# Extended unique color settings +gui_color_up_pointing_triangle = #00ebff +#gui_color_down_pointing_triangle = # +gui_color_out_of_production = #0092a5 +gui_color_text_overcrowding = #d659a5 +# Recommended brightness: gui_color_text < gui_color_text_weak < gui_color_text_inactive (reversed on dark themes) +gui_color_text_inactive = #63618c +gui_color_text_weak = #848a8c + +#---- Color for table +gui_color_table_header_border = #5a5973 +#gui_color_table_background_head_row = +gui_color_table_background_head_selected = #AD9239 +gui_color_table_frame = #63618c +gui_color_table_background_head_row = #63618c +gui_color_table_cell_border = #5a5973 +gui_color_table_background_left_col = #5a5973 +gui_color_table_background_data_sum = #52516b +gui_color_table_background_data = #4a4961 +gui_color_table_background = #424459 +gui_color_table_background_highlight = #737152 +gui_color_table_background_selected = #5A92A5 +gui_color_text_head_row = #FFFFFF +gui_color_text_left_col = #c6cbce +#gui_color_text_head_selected = #737152 +gui_color_text_table_cell_selected = #eff3f7 +gui_color_list_background_even = #424459 +gui_color_list_background_odd = #55576c + +##################################size stuff################################## + +# force main menu icon size +icon_width = 48 + +# titlebar height +gui_titlebar_height = 22 + +# width of the window elements +gui_gadget_width = 22 + +# safe margin around windows +# gui_frame_left = 10 +# gui_frame_top = 10 +# gui_frame_right = 10 +# gui_frame_bottom = 10 + +# horizontal and vertical margins between objects +# gui_hspace = 4 +# gui_vspace = 4 + +# tab minimum sizes +gui_tab_header_vsize = 22 + +# input boxes height +# minimum height is the height of the position button graphic +# gui_edit_height = 22 + +# checkbox height, default sizes come from the checkbox graphic +# gui_checkbox_width = 10 +# gui_checkbox_height = 10 + +# sum of the top and bottom margins for divider lines +# default is twice the size of gui_vspace +# gui_divider_vsize = 8 + +# buttons sizes +gui_button_height = 22 +# for buttons with fixed widths +gui_button_width = 100 + +# text margins inside the buttons (left, top, right) +gui_button_text_offset = 5,2,5 +gui_color_button_text_offset = 5,2,5 + +# maximum size of tool bars in tools (0 = no limit) +# if more tools than allowed by height, +# next and prev arrows for scrolling appears +toolbar_max_width = 0 +toolbar_max_height = 0 + +###################################pakstuff################################### + +# pak with the images for this theme +themeimages=purple_night-large.pak diff --git a/simutrans/themes/purple_night.tab b/simutrans/themes/purple_night.tab new file mode 100644 index 0000000000..728f29105a --- /dev/null +++ b/simutrans/themes/purple_night.tab @@ -0,0 +1,217 @@ +# +# Simutrans purple night theme +# +# Read the wiki article for better explanation and full parameters list +# https://wiki.simutrans.com/en_themeDef +# + +# name of the theme (will be shown with file selector) +name=Purple Night + +# show tooltips (default 1=show) +show_tooltips = 1 + +# tooltip background color (+-1 around this index is used), taken from player-color table +tooltip_background_color = 4 + +# tooltip text color (240=black, 215=white) +tooltip_text_color = 240 + +# delay before showing tooltip in ms (default 500ms) +tooltip_delay = 500 + +# duration in ms during tooltip is visible (default 5000ms=5s) +tooltip_duration = 5000 + +# windows drop a little shadow (default off) +# gui_drop_shadows = 1 + +#################################window stuff################################# + +# when moving, you can use windows to snap onto each other seamlessly +# if you do not like it, set the catch radius to zero +window_snap_distance = 8 + +# show the windows close etc. buttons on the right (like Windows) +# window_buttons_right = 0 + +# closes windows/toolbar when button clicked a second time (default off=0) +second_open_closes_win = 0 + +# restores window position when window is reopening +# This will be saved, but will be discarded when screen is resized +remember_window_positions = 1 + +# there are three different ways to indicate an active window + +# first: draw a frame with titlebar color around active window +# window_frame_active = 0 + +# second: draw the title with a different brightness (0: dark ... 6: bright) +front_window_bar_color = 1 +bottom_window_bar_color = 3 + +# third (best together with 2nd):use different text color for bar +# some colors are 215-white, 240-black 208-214- all shades of gray +front_window_text_color = #DDDDDD +bottom_window_text_color = #B7B7B7 + +#################################colour stuff################################# + +default_window_title_color = #705726 + +gui_color_text = #D0D0D0 +gui_color_text_highlight = #908010 +gui_color_text_shadow = #00FF00 +gui_color_text_title = #338FCC +gui_color_text_strong = #E46A0B + +########Test######## +gui_color_empty = #868c86 +gui_color_obsolete = #2878ff + +gui_color_edit_text = #908010 +gui_color_edit_text_selected = #FAFAFA +gui_color_edit_text_disabled = #666666 +gui_color_edit_background_selected = #72B2DD +gui_color_edit_beam = #a89823 + +gui_color_chart_background = #2e2e40 +gui_color_chart_lines_zero = #005C9E +gui_color_chart_lines_odd = #68688e +gui_color_chart_lines_even = #68688e + +gui_color_list_text_selected_focus = #B7B7B7 +gui_color_list_text_selected_nofocus = #908010 +gui_color_list_background_selected_focus = #72B2DD +gui_color_list_background_selected_nofocus = #72B2DD + +gui_color_button_text = #C0C0C0 +gui_color_button_text_disabled = #8A8A8A +gui_color_button_text_selected = #FAFAFA + +gui_color_colored_button_text = #201000 +gui_color_colored_button_text_selected = #CCCCCC + +gui_color_checkbox_text = #C0C0C0 +gui_color_checkbox_text_disabled = #666666 + +gui_color_ticker_background = #3c3c52 +gui_color_ticker_divider = #4d4d69 + +gui_color_statusbar_text = #C0C0C0 +gui_color_statusbar_background = #3c3c52 +gui_color_statusbar_divider = #4d4d69 + +gui_highlight_color = #68688e +gui_shadow_color = #000000 + +gui_color_text_minus = #C07010 +gui_color_text_plus = #70C010 +gui_color_text_unused = #E46A0B + +# Color of cursor overlay, which is blended over marked ground tiles +cursor_overlay_color = #1060F0 + +# Color loadbar, save game, load game, server... +gui_color_loadingbar_progress = #6080A0 +gui_color_loadingbar_inner = #303246 + +# Color player bright +gui_player_color_dark = 3 +gui_player_color_bright = 7 +gui_titlebar_player_color_background_brightness = 2 + +# make the chat window transparent in network games +gui_chat_window_network_transparency = 25 + +# if defined, use plain color for chat window in network games +gui_color_chat_window_network_transparency = #D6ECF7 + +# Transparency color of boost icons (mail, energy, passangers) in factories +gui_color_image_transparency = #ffffff + +# Extended unique color settings +gui_color_up_pointing_triangle = #00ebff +#gui_color_down_pointing_triangle = # +gui_color_out_of_production = #0092a5 +gui_color_text_overcrowding = #d659a5 +# Recommended brightness: gui_color_text < gui_color_text_weak < gui_color_text_inactive (reversed on dark themes) +gui_color_text_inactive = #63618c +gui_color_text_weak = #848a8c + +#---- Color for table +gui_color_table_header_border = #5a5973 +#gui_color_table_background_head_row = +gui_color_table_background_head_selected = #AD9239 +gui_color_table_frame = #63618c +gui_color_table_background_head_row = #63618c +gui_color_table_cell_border = #5a5973 +gui_color_table_background_left_col = #5a5973 +gui_color_table_background_data_sum = #52516b +gui_color_table_background_data = #4a4961 +gui_color_table_background = #424459 +gui_color_table_background_highlight = #737152 +gui_color_table_background_selected = #5A92A5 +gui_color_text_head_row = #FFFFFF +gui_color_text_left_col = #c6cbce +#gui_color_text_head_selected = #737152 +gui_color_text_table_cell_selected = #eff3f7 +gui_color_list_background_even = #424459 +gui_color_list_background_odd = #55576c + +##################################size stuff################################## + +# force main menu icon size +icon_width = 32 + +# titlebar height +gui_titlebar_height = 22 + +# width of the window elements +gui_gadget_width = 20 + +# safe margin around windows +# gui_frame_left = 10 +# gui_frame_top = 10 +# gui_frame_right = 10 +# gui_frame_bottom = 10 + +# horizontal and vertical margins between objects +# gui_hspace = 4 +# gui_vspace = 4 + +# tab minimum sizes +gui_tab_header_vsize = 18 + +# input boxes height +# minimum height is the height of the position button graphic +# gui_edit_height = 22 + +# checkbox height, default sizes come from the checkbox graphic +# gui_checkbox_width = 10 +# gui_checkbox_height = 10 + +# sum of the top and bottom margins for divider lines +# default is twice the size of gui_vspace +# gui_divider_vsize = 8 + +# buttons sizes +gui_button_height = 17 +# for buttons with fixed widths +gui_button_width = 100 + +# text margins inside the buttons (left, top, right) +gui_button_text_offset = 5,1,5 +gui_color_button_text_offset = 5,1,5 + +# maximum size of tool bars in tools (0 = no limit) +# if more tools than allowed by height, +# next and prev arrows for scrolling appears +toolbar_max_width = 0 +toolbar_max_height = 0 + +###################################pakstuff################################### + +# pak with the images for this theme +themeimages=purple_night.pak diff --git a/simutrans/themes/silver-large.tab b/simutrans/themes/silver-large.tab new file mode 100644 index 0000000000..27513b7d5d --- /dev/null +++ b/simutrans/themes/silver-large.tab @@ -0,0 +1,182 @@ +# Simutrans default touch theme +# +# Read the wiki article for better explanation and full parameters list +# https://wiki.simutrans.com/en_themeDef +# +# name of the theme (will be shown with file selector) +name=Silver (large size) + +# show tooltips (default 1=show) +show_tooltips = 1 + +# tooltip background color (+-1 around this index is used), taken from player-color table +tooltip_background_color = 4 + +# tooltip text color (240=black, 215=white) +tooltip_text_color = 240 + +# delay before showing tooltip in ms (default 500ms) +tooltip_delay = 500 + +# duration in ms during tooltip is visible (default 5000ms=5s) +tooltip_duration = 5000 + +# windows drop a little shadow (default off) +# gui_drop_shadows = 1 + +#################################window stuff################################# + +# when moving, you can use windows to snap onto each other seamlessly +# if you do not like it, set the catch radius to zero +window_snap_distance = 8 + +# show the windows close etc. buttons on the right (like Windows) +# window_buttons_right = 0 + +# closes windows/toolbar when button clicked a second time (default off=0) +second_open_closes_win = 0 + +# restores window position when window is reopening +# This will be saved, but will be discarded when screen is resized +remember_window_positions = 1 + +# there are three different ways to indicate an active window + +# first: draw a frame with titlebar color around active window +# window_frame_active = 0 + +# second: draw the title with a different brightness (0: dark ... 6: bright) +front_window_bar_color = 1 +bottom_window_bar_color = 3 + +# third (best together with 2nd):use different text color for bar +# some colors are 215-white, 240-black 208-214- all shades of gray +front_window_text_color = #FFFFFF +bottom_window_text_color = #C0C0C0 + +#################################colour stuff################################# + +default_window_title_color = #84939e + +# gui_color_text = #000000 +gui_color_text_highlight = #706000 +gui_color_text_shadow = #BDD3DF +gui_color_text_title = #338FCC +gui_color_text_strong = #E46A0B + +########Test######## +gui_color_empty = #868c86 +gui_color_obsolete = #2878ff + +gui_color_edit_text = #000000 +gui_color_edit_text_selected = #FAFAFA +gui_color_edit_text_disabled = #666666 +gui_color_edit_background_selected = #72B2DD +gui_color_edit_beam = #000000 + +gui_color_chart_background = #6f6d60 +gui_color_chart_lines_zero = #005C9E +gui_color_chart_lines_odd = #373630 +gui_color_chart_lines_even = #373630 + +gui_color_list_text_selected_focus = #FAFAFA +gui_color_list_text_selected_nofocus = #FAFAFA +gui_color_list_background_selected_focus = #72B2DD +gui_color_list_background_selected_nofocus = #72B2DD + +gui_color_button_text = #001020 +gui_color_button_text_disabled = #666666 +gui_color_button_text_selected = #FAFAFA + +gui_color_colored_button_text = #FAFAFA +gui_color_colored_button_text_selected = #FAFAFA + +# gui_color_checkbox_text = #000000 +gui_color_checkbox_text_disabled = #666666 + +gui_color_ticker_background = #D6ECF7 +gui_color_ticker_divider = #6095B8 + +# gui_color_statusbar_text = #000000 +gui_color_statusbar_background = #b8b8a8 +gui_color_statusbar_divider = #f8fcf0 + +gui_highlight_color = #FFFFF7 +gui_shadow_color = #72726E + +# gui_color_text_minus = #C00000 +# gui_color_text_plus = #000000 +gui_color_text_unused = #555f66 + +# Color of cursor overlay, which is blended over marked ground tiles +cursor_overlay_color = #ff0000 + +# Color loadbar, save game, load game, server... +gui_color_loadingbar_progress = #76b9e6 +gui_color_loadingbar_inner = #D6ECF7 + +# Color player brigth +gui_player_color_dark = 1 +gui_player_color_bright = 3 + +# make the chat window transparent in network games +gui_chat_window_network_transparency = 25 + +# if defined, use plain color for chat window in network games +gui_color_chat_window_network_transparency = #D6ECF7 + +##################################size stuff################################## + +# force main menu icon size +icon_width = 48 + +# titlebar height +gui_titlebar_height = 22 + +# width of the window elements +gui_gadget_width = 22 + +# safe margin around windows +# gui_frame_left = 10 +# gui_frame_top = 10 +# gui_frame_right = 10 +# gui_frame_bottom = 10 + +# horizontal and vertical margins between objects +# gui_hspace = 4 +# gui_vspace = 4 + +# tab minimum sizes +gui_tab_header_vsize = 22 + +# input boxes height +# minimum height is the height of the position button graphic +# gui_edit_height = 22 + +# checkbox height, default sizes come from the checkbox graphic +# gui_checkbox_width = 10 +# gui_checkbox_height = 10 + +# sum of the top and bottom margins for divider lines +# default is twice the size of gui_vspace +# gui_divider_vsize = 8 + +# buttons sizes +gui_button_height = 22 +# for buttons with fixed widths +gui_button_width = 100 + +# text margins inside the buttons (left, top, right) +gui_button_text_offset = 5,1,5 +gui_color_button_text_offset = 5,1,5 + +# maximum size of tool bars in tools (0 = no limit) +# if more tools than allowed by height, +# next and prev arrows for scrolling appears +toolbar_max_width = 0 +toolbar_max_height = 0 + +###################################pakstuff################################### + +# pak with the images for this theme +themeimages=silver-large.pak diff --git a/simutrans/themes/silver.tab b/simutrans/themes/silver.tab new file mode 100644 index 0000000000..6d84703197 --- /dev/null +++ b/simutrans/themes/silver.tab @@ -0,0 +1,182 @@ +# Simutrans default touch theme +# +# Read the wiki article for better explanation and full parameters list +# https://wiki.simutrans.com/en_themeDef +# +# name of the theme (will be shown with file selector) +name=Silver + +# show tooltips (default 1=show) +show_tooltips = 1 + +# tooltip background color (+-1 around this index is used), taken from player-color table +tooltip_background_color = 4 + +# tooltip text color (240=black, 215=white) +tooltip_text_color = 240 + +# delay before showing tooltip in ms (default 500ms) +tooltip_delay = 500 + +# duration in ms during tooltip is visible (default 5000ms=5s) +tooltip_duration = 5000 + +# windows drop a little shadow (default off) +# gui_drop_shadows = 1 + +#################################window stuff################################# + +# when moving, you can use windows to snap onto each other seamlessly +# if you do not like it, set the catch radius to zero +window_snap_distance = 8 + +# show the windows close etc. buttons on the right (like Windows) +# window_buttons_right = 0 + +# closes windows/toolbar when button clicked a second time (default off=0) +second_open_closes_win = 0 + +# restores window position when window is reopening +# This will be saved, but will be discarded when screen is resized +remember_window_positions = 1 + +# there are three different ways to indicate an active window + +# first: draw a frame with titlebar color around active window +# window_frame_active = 0 + +# second: draw the title with a different brightness (0: dark ... 6: bright) +front_window_bar_color = 1 +bottom_window_bar_color = 3 + +# third (best together with 2nd):use different text color for bar +# some colors are 215-white, 240-black 208-214- all shades of gray +front_window_text_color = #FFFFFF +bottom_window_text_color = #C0C0C0 + +#################################colour stuff################################# + +default_window_title_color = #84939e + +# gui_color_text = #000000 +gui_color_text_highlight = #706000 +gui_color_text_shadow = #BDD3DF +gui_color_text_title = #338FCC +gui_color_text_strong = #E46A0B + +########Test######## +gui_color_empty = #868c86 +gui_color_obsolete = #2878ff + +gui_color_edit_text = #000000 +gui_color_edit_text_selected = #FAFAFA +gui_color_edit_text_disabled = #666666 +gui_color_edit_background_selected = #72B2DD +gui_color_edit_beam = #000000 + +gui_color_chart_background = #6f6d60 +gui_color_chart_lines_zero = #005C9E +gui_color_chart_lines_odd = #373630 +gui_color_chart_lines_even = #373630 + +gui_color_list_text_selected_focus = #FAFAFA +gui_color_list_text_selected_nofocus = #FAFAFA +gui_color_list_background_selected_focus = #72B2DD +gui_color_list_background_selected_nofocus = #72B2DD + +gui_color_button_text = #001020 +gui_color_button_text_disabled = #666666 +gui_color_button_text_selected = #FAFAFA + +gui_color_colored_button_text = #FAFAFA +gui_color_colored_button_text_selected = #FAFAFA + +# gui_color_checkbox_text = #000000 +gui_color_checkbox_text_disabled = #666666 + +gui_color_ticker_background = #D6ECF7 +gui_color_ticker_divider = #6095B8 + +# gui_color_statusbar_text = #000000 +gui_color_statusbar_background = #b8b8a8 +gui_color_statusbar_divider = #f8fcf0 + +gui_highlight_color = #FFFFF7 +gui_shadow_color = #72726E + +# gui_color_text_minus = #C00000 +# gui_color_text_plus = #000000 +gui_color_text_unused = #555f66 + +# Color of cursor overlay, which is blended over marked ground tiles +cursor_overlay_color = #ff0000 + +# Color loadbar, save game, load game, server... +gui_color_loadingbar_progress = #76b9e6 +gui_color_loadingbar_inner = #D6ECF7 + +# Color player brigth +gui_player_color_dark = 1 +gui_player_color_bright = 3 + +# make the chat window transparent in network games +gui_chat_window_network_transparency = 25 + +# if defined, use plain color for chat window in network games +gui_color_chat_window_network_transparency = #D6ECF7 + +##################################size stuff################################## + +# force main menu icon size +icon_width = 32 + +# titlebar height +gui_titlebar_height = 22 + +# width of the window elements +gui_gadget_width = 20 + +# safe margin around windows +# gui_frame_left = 10 +# gui_frame_top = 10 +# gui_frame_right = 10 +# gui_frame_bottom = 10 + +# horizontal and vertical margins between objects +# gui_hspace = 4 +# gui_vspace = 4 + +# tab minimum sizes +gui_tab_header_vsize = 18 + +# input boxes height +# minimum height is the height of the position button graphic +# gui_edit_height = 22 + +# checkbox height, default sizes come from the checkbox graphic +# gui_checkbox_width = 10 +# gui_checkbox_height = 10 + +# sum of the top and bottom margins for divider lines +# default is twice the size of gui_vspace +# gui_divider_vsize = 8 + +# buttons sizes +gui_button_height = 16 +# for buttons with fixed widths +gui_button_width = 100 + +# text margins inside the buttons (left, top, right) +gui_button_text_offset = 5,1,5 +gui_color_button_text_offset = 5,1,5 + +# maximum size of tool bars in tools (0 = no limit) +# if more tools than allowed by height, +# next and prev arrows for scrolling appears +toolbar_max_width = 0 +toolbar_max_height = 0 + +###################################pakstuff################################### + +# pak with the images for this theme +themeimages=silver.pak diff --git a/simutrans/themes/theme-large.tab b/simutrans/themes/theme-large.tab index a5df9cbf8b..7ca8327ca1 100644 --- a/simutrans/themes/theme-large.tab +++ b/simutrans/themes/theme-large.tab @@ -80,9 +80,11 @@ gui_color_chart_lines_zero = #005C9E gui_color_chart_lines_odd = #338FCC gui_color_chart_lines_even = #005C9E -gui_color_list_text_selected_focus = #FAFAFA -gui_color_list_text_selected_nofocus = #FAFAFA -gui_color_list_background_selected_focus = #72B2DD +gui_color_list_text_selected_focus = #FAFAFA +gui_color_list_text_selected_nofocus = #FAFAFA +gui_color_list_background_even = #B5DBEF +gui_color_list_background_odd = #DEF3FF +gui_color_list_background_selected_focus = #72B2DD gui_color_list_background_selected_nofocus = #72B2DD gui_color_button_text = #FAFAFA @@ -129,6 +131,23 @@ gui_chat_window_network_transparency = 25 # if defined, use plain color for chat window in network games gui_color_chat_window_network_transparency = #D6ECF7 +# Color for table +gui_color_table_frame = #6392BD +gui_color_table_background_head_row = #6392BD +gui_color_table_background_head_selected = #31596B +gui_color_table_header_border = #52799C +gui_color_table_cell_border = #8CC3E7 +gui_color_table_background_left_col = #8CC3E7 +gui_color_table_background_data_sum = #ABD3EF +gui_color_table_background_data = #C6E3F7 +gui_color_table_background = #E7F3FF +gui_color_table_background_highlight = #DEE5AD +gui_color_table_background_selected = #73b2de +gui_color_text_head_row = #FFFFFF +gui_color_text_left_col = #000000 +gui_color_text_head_selected = #ffffff +gui_color_text_table_cell_selected = #ffffff + ##################################size stuff################################## # force main menu icon size diff --git a/simutrans/themes/themes.tab b/simutrans/themes/themes.tab index 3bbd4209f8..c7a12ba19c 100644 --- a/simutrans/themes/themes.tab +++ b/simutrans/themes/themes.tab @@ -52,6 +52,7 @@ remember_window_positions = 1 pressed_button_sinks = 1 ################################# Colour settings ################################# +## theme window background color=#adbabd #RGB=(173,186,189) # color used for the default titlebars default_window_title_color = #D74700 @@ -83,6 +84,8 @@ gui_color_text_placeholder = #CCCCCC #gui_color_list_text_selected_focus = #000000 #gui_color_list_text_selected_nofocus = #000000 +gui_color_list_background_even = #BDCBD6 +gui_color_list_background_odd = #D6E3EF #gui_color_list_background_selected_focus = #000000 #gui_color_list_background_selected_nofocus = #000000 @@ -128,7 +131,7 @@ gui_chat_window_network_transparency = 0 gui_color_chat_window_network_transparency = #D6ECF7 # Extended unique color settings -gui_color_up_pointing_triangle = #008000 +#gui_color_up_pointing_triangle = #008000 #gui_color_down_pointing_triangle = #FF0000 #gui_color_out_of_production = # # Recommended brightness: gui_color_text < gui_color_text_weak < gui_color_text_inactive (reversed on dark themes) @@ -143,7 +146,7 @@ gui_color_table_cell_border = #8c9aad gui_color_table_background_left_col = #cedbe7 gui_color_table_background_data_sum = #c6d3de gui_color_table_background_data = #bdcbd6 -gui_color_table_background = #adbac6 +gui_color_table_background = #BDCBD6 gui_color_table_background_highlight= #DEE5AD gui_color_text_head_row = #ffffff gui_color_text_left_col = #000000 diff --git a/themes.src/build_themes.sh b/themes.src/build_themes.sh index 22a5417809..e9c946fec0 100755 --- a/themes.src/build_themes.sh +++ b/themes.src/build_themes.sh @@ -51,3 +51,16 @@ rm -rf *.pak mv *.pak ../../simutrans/themes cp *.tab ../../simutrans/themes +cd ../silver +rm -rf *.pak +../../build/default/makeobj-extended/makeobj-extended pak silver.pak standard.dat +../../build/default/makeobj-extended/makeobj-extended pak silver-large.pak standard-large.dat +mv *.pak ../../simutrans/themes +cp *.tab ../../simutrans/themes + +cd ../purple_night +rm -rf *.pak +../../build/default/makeobj-extended/makeobj-extended pak purple_night.pak standard.dat +../../build/default/makeobj-extended/makeobj-extended pak purple_night-large.pak standard-large.dat +mv *.pak ../../simutrans/themes +cp *.tab ../../simutrans/themes diff --git a/themes.src/modern/theme-large.tab b/themes.src/modern/theme-large.tab index 31068f4439..7ca8327ca1 100644 --- a/themes.src/modern/theme-large.tab +++ b/themes.src/modern/theme-large.tab @@ -80,9 +80,11 @@ gui_color_chart_lines_zero = #005C9E gui_color_chart_lines_odd = #338FCC gui_color_chart_lines_even = #005C9E -gui_color_list_text_selected_focus = #FAFAFA -gui_color_list_text_selected_nofocus = #FAFAFA -gui_color_list_background_selected_focus = #72B2DD +gui_color_list_text_selected_focus = #FAFAFA +gui_color_list_text_selected_nofocus = #FAFAFA +gui_color_list_background_even = #B5DBEF +gui_color_list_background_odd = #DEF3FF +gui_color_list_background_selected_focus = #72B2DD gui_color_list_background_selected_nofocus = #72B2DD gui_color_button_text = #FAFAFA @@ -130,17 +132,6 @@ gui_chat_window_network_transparency = 25 gui_color_chat_window_network_transparency = #D6ECF7 # Color for table -gui_color_table_header_border = #52799C -gui_color_table_frame = #6392BD -gui_color_table_background_head_row = #6392BD -gui_color_table_cell_border = #8CC3E7 -gui_color_table_background_left_col = #8CC3E7 -gui_color_table_background_data_sum = #ABD3EF -gui_color_table_background_data = #C6E3F7 -gui_color_table_background = #E7F3FF -gui_color_text_head_row = #FFFFFF -gui_color_text_left_col = #000000 - gui_color_table_frame = #6392BD gui_color_table_background_head_row = #6392BD gui_color_table_background_head_selected = #31596B diff --git a/themes.src/newstandard/newstandard-large.tab b/themes.src/newstandard/newstandard-large.tab index 953cc6bdf3..7ca688ebbe 100644 --- a/themes.src/newstandard/newstandard-large.tab +++ b/themes.src/newstandard/newstandard-large.tab @@ -82,6 +82,8 @@ gui_color_obsolete = #0000F8 #gui_color_list_text_selected_focus = #000000 #gui_color_list_text_selected_nofocus = #000000 +gui_color_list_background_even = #BDCBD6 +gui_color_list_background_odd = #D6E3EF #gui_color_list_background_selected_focus = #000000 #gui_color_list_background_selected_nofocus = #000000 @@ -142,7 +144,7 @@ gui_color_table_cell_border = #8c9aad gui_color_table_background_left_col = #cedbe7 gui_color_table_background_data_sum = #c6d3de gui_color_table_background_data = #bdcbd6 -gui_color_table_background = #adbac6 +gui_color_table_background = #BDCBD6 gui_color_table_background_highlight= #DEE5AD gui_color_text_head_row = #ffffff gui_color_text_left_col = #000000 diff --git a/themes.src/newstandard/themes.tab b/themes.src/newstandard/themes.tab index 692c08470c..c7a12ba19c 100644 --- a/themes.src/newstandard/themes.tab +++ b/themes.src/newstandard/themes.tab @@ -52,6 +52,7 @@ remember_window_positions = 1 pressed_button_sinks = 1 ################################# Colour settings ################################# +## theme window background color=#adbabd #RGB=(173,186,189) # color used for the default titlebars default_window_title_color = #D74700 @@ -83,6 +84,8 @@ gui_color_text_placeholder = #CCCCCC #gui_color_list_text_selected_focus = #000000 #gui_color_list_text_selected_nofocus = #000000 +gui_color_list_background_even = #BDCBD6 +gui_color_list_background_odd = #D6E3EF #gui_color_list_background_selected_focus = #000000 #gui_color_list_background_selected_nofocus = #000000 @@ -143,7 +146,7 @@ gui_color_table_cell_border = #8c9aad gui_color_table_background_left_col = #cedbe7 gui_color_table_background_data_sum = #c6d3de gui_color_table_background_data = #bdcbd6 -gui_color_table_background = #adbac6 +gui_color_table_background = #BDCBD6 gui_color_table_background_highlight= #DEE5AD gui_color_text_head_row = #ffffff gui_color_text_left_col = #000000 diff --git a/themes.src/purple_night/back.png b/themes.src/purple_night/back.png new file mode 100644 index 0000000000000000000000000000000000000000..ba5f9121b037f0e9f93b54482256239bf2521f5d GIT binary patch literal 612 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE4M+yv$zcalY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPlBddso@mBHJKMV|vA3a?hLn>~)y=KVA7%0&2F!Cn1 zK&z9CL%VfBdiw=ShKUny6g11WwzxcGu)ZIjxBc_I`IWwDY$2vbOe_pc42%s74h#wm z0t_4s)aGI}wQW(P&NR!J=j`S4+G~R|88&}4i*4TSUfy~6WyGsLxePXqv~mu_qu4xo zpn&Pc=KhX*DjgjaA-^AfD;JD0_U294dUNNu_{op_6=pA(cPss#n@h>};=6P2$F36p t(9=m>u_@-ueLa=`S!;OXk;vd$@?2>=jGer5mw literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/build.sh b/themes.src/purple_night/build.sh new file mode 100644 index 0000000000..66205e9b24 --- /dev/null +++ b/themes.src/purple_night/build.sh @@ -0,0 +1,6 @@ +rm -rf *.pak +../../makeobj/makeobj pak purple_night.pak standard.dat +../../makeobj/makeobj pak purple_night-large.pak standard-large.dat +mv *.pak ../../../../simutrans/themes +cp *.tab ../../../../simutrans/themes + diff --git a/themes.src/purple_night/button-symbols.png b/themes.src/purple_night/button-symbols.png new file mode 100644 index 0000000000000000000000000000000000000000..ff876e2be9133b67c6898664841237605a442189 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=t)4E9Ar-gYUcJcKY#_pVVNKX} zO}{5xtjjfb_}ItsN_0%({B*9-+o1lv+QA^XN8-1QQ`1go-#q7X+OlBH`>p@y?Q7WK zXBYMD{Jhl-7eAD)HCGH}{QDtR(~?Vq_x?QhE+#hh`O6y~SKnbgTe~DWM4fNpna& literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/button.png b/themes.src/purple_night/button.png new file mode 100644 index 0000000000000000000000000000000000000000..5906c55d8a68dc9b1b989c42e14ed32a23975158 GIT binary patch literal 7466 zcmeHKdo)z*`yWaixt1vE&``P{Fv=`UYKM#6wD9vhYGl<{Oc;It@yWNJ<=uTb$eH%`trig7(pwY`-U1% zoEbi{`5{00;+XCWs0vox{6Yiyxkvg8U7-%!e^q)e?`47uM0M}lkIbvHEQF)O8A~l* zZ-LFdMO(3tH(_f{_qRTZ@i=`J)Vi1+lM-w6R3Z1$hpa6ggPGe_d~LD)l(Vtb4Xx0p zH5c``Vpc5gv&HC2=dFgj29(tK{_~?{lb^BM9!;r!b?8HWMc$Jiu209m<$x1};7oYhJ*7Q9jvBAJYcz7jcg8$0T#@{w4IX5-4ruZ^HLA7rz z3p&Ece^b?Y`}IE4e7UAqCkYLm7bt22vm{6T6`?)u&^lB^T4F-8x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;uSz`d2BS zu?x7^vtc%IM;4})GH;J}dbm%;WjqhO+}wQicIk|3<6Mrjy8u4>>1jh4pVBot?byBY z7C%f4w`1%_VVEK zrDV^>=TrdcEG+cg76fNa-kt#=QK;t?%Awm>$Ls3U-(9T>56WlW%ep~*j6LCaWTu?S znbcefQ2h`1y|GuvIp-BkXmD_g&zLMJC(oTZD8F;$t&PNrs)<}@5TJCMHXna~r9fRU zHFUuuv#T#GY_3`$=(} zdBr=l*Cwv|lqn}1t-PC#IWn# z4<5|u#@g_LlQm)n?4In5>pX=v5_FtAN^NP0T}&M06oIxK=Am_gdS(I1d*Gtxw1;u0 z2F%^UM2lSWLeX#j0sR0{C_u%L*`I3y;_kYAYX8>NC40tNx-58>S7nhdfZ`OLoK%f+ z6vHPbWP{q3YN~=&`BNnqG`<22vVJFcj#mo8vDxgz(b25HnGw}Z9}7Iayf&>~t@>Ed zNSK+?bzlf`QUymF8^uYi%84t}8h1H-x0f$N0dk|GWsC3J(YZTl2&GX8Nm3L_m^KJC9!#z|+Kb xZY(I-3Ed{U6QscXI>LGjo%?P1KclvS1r_)F=y7?U$2G!)aOSpV`6h=V{sX?qh`0a% literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/checkbutton-small.png b/themes.src/purple_night/checkbutton-small.png new file mode 100644 index 0000000000000000000000000000000000000000..3a38208235d7f05a136ef6997ea6fa6094ed1295 GIT binary patch literal 489 zcmeAS@N?(olHy`uVBq!ia0vp^2Y}dtgAGXf{XE)7O>#86&HRm1NAUZz~uW7|T3e978H@y}fDe#}p{h_R!zS zv1!_x2GJRvozt#mxh6i+;^8)2cj!pdsfgfP6_JeE3tBuiI3hZxOBh^BpSOJ06Q9rW z=S~|WzW?##kJd>8^zxiNf)!u%IWtSt}7Q4?5+A&S{$G6HK_3_FK0uC>iUA}oO`_xm}2kiTQ z&i=_#vGVoZ`(?AYK5zQI;N$1@VW;PIgH2K2In(FfzhBBvOi$(>WCu#=i+w(JZvXbU z^|tIEg?N}47#kQI7!();7&sVM7^um0VAuvSd_m{XE)7O>#86&HRl?JcNw@C~POpTr{jv*Dd-rh3ImP(X4{_*}v zS;dr#3C?x~yXx0HYXyXF(mfA#ae=Q`zf( zknzNyKZSh%YgjU8+@G>#_qns%->Ahrt~BHnduDIB^2E0Il>s**Yd*-@pZdQ4<)=^C zub%yP&;CD~!65zS!~d0!-*2$goRZ9a&Hjap0|Nsi0}F$I!>^v>{nE8q!18eM<)H)wRJWKLi!wjbnSgndA3rD>BWzKy-f)pUWY|jer7%B@csMtNmo3eipU+^S=|TuCaFro@EB=p$r_5w|yMMdV8BhlNiV#Pgg&e IbxsLQ02;zGNdN!< literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/editfield.png b/themes.src/purple_night/editfield.png new file mode 100644 index 0000000000000000000000000000000000000000..b504a5683f9d9c537b229f7feb27a33822769187 GIT binary patch literal 648 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE4M+yv$zcalY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPlBddrtgW{`vO$G)gQBN1gkcwMxuOG}kVH~hG4Gzzqfa~T$1Pq^ zILkO|x7!gQ=bpCRA2lVt`t$dTuipOu^Pkq=Z{P2ozkSzEX;BJ;?&e=iOE!rsJ1{6P z2rzIkurM$&Fg7qyor`X2gD9JUU-7nUn_e+QWk>$)xg7KDUoE4?+SFy559Dd)3ZVZQ z7<#aHFu|3v=kgyz9_KJwhiqN#`S+^(F4wHB`aioPV%zT8o4f@U^H%8}Jl_#{lkDfAFmGOc z?Q(l~r;mh&&M}M|5h#hcaaE}ow zo&B8EBl>sR=EyHmJG$e`8y++LSW|j$zG~^i_NRYdzq+~SUgkgD24}N|w2j%q2X{Vi zetfRyfb;+LPrm9G%HHX}zs351rhZk`vzND?-a5T?@!Q9#UM%^Kzn}m0@$ap|&pZB> zR|?vcPV}$%dOz;Z?ti*mpW}Fz{=FC6U;XAs@H}yI#&^f^Psu*GYj^+aZvBtn?F9~e zkG8kIWygN>{I|aMnc7|cv*(M;ANZ~Q|6R-bUy(1l>u+uRzW0;=PGN(mF$HgC9>3q$ zG^NzxPug9^ch>K{?Y{F%FwPM>&{^(yd*SpgA48S%>u>$}%w+KL$8NKl>kii}FNp77 zdY^IKw|jSAblv+qe`<+d$(gGsd>5>q^!WSl-IaeIC-2W+&)xmN+3CdG4SRlg-v7Z` zaLn5NEpMGh!)$vV?-*vU{d{eYwm-2x@OFdju7BR$5BgT-ug|ZZS|`4P^TGY={MD{3 z8+Iq$WAg8HV4U+?W(V_}-|hv;AEQ6XCNSQSJ+S)x>Z+e9J1c#79?Xw_cQt>W{Vf|e z)`DNM51#z^DpT?C`Hy0I=9u0;ybhhm?NsZ$|ML_)RTd~``tjuI$!8I>j~`+9_vPEc zXRHpNC4>)5&36(wu=eZ)Zie@DDsuIrzjOsWk6WA83GZWF^vS*8KP%AU3cIX^`cTiqrvym4vw~X#%etV2L@?I9tMSmUIsP> z0brtHX5dIrZeV0!*&ql^-%K|+5*Qd5b65-*8W_x&Bv6zapz%r6j;tJq4aiD}a1eGS z2iP+9GhE-laRK8EhPUDmewmAzFi0=>%M|nfSQA?U^OpFA*Y_hXFyu6R<1Y9s%`Mfy zd!deTU4616^9IIS`Uk$|>tryPIs9hb@voPa7i1VrC>fR2HM_p;x|_V-wFzs0MFNAT LtDnm{r-UW|b-L2K literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/listbox.png b/themes.src/purple_night/listbox.png new file mode 100644 index 0000000000000000000000000000000000000000..16834cf4bd3c598c432f67d3fcb98654831caf8e GIT binary patch literal 648 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE4M+yv$zcalY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPlBddtD@X`>y?+gq~qMj~}Ar-gYUO$+7$U(s2;>`}G zYpMl~k2?4xB9=@nad3U7(Ay#~k=fGi(WD@?+KPLVw=tam)&I22V%|NaN1t}wk6XN; zaF%h_Znq;q&OL3rKWa*P_2=&wU%mbR=Rd8#-@e~FfBUYT(xMaw-Oaz4mTVGNc3@Co z5Mbb7U}0clU~FKZIv3s422nNxzv6AzHoanq%8vZob2;YQzgk9(wW-TAAIQ_p6+r(r zF!W&YV1g@S&*eXcJkDXV4%xce^Y2ynU9MSM^?!Cp#J1hFH+c&z=B?5{c)lazl-_|e nJRkUJ6iVRm#~Su)j@bwPTE%J_@W}y~W*9tO{an^LB{Ts56XTZr literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/posbutton-small.png b/themes.src/purple_night/posbutton-small.png new file mode 100644 index 0000000000000000000000000000000000000000..f8ce1c85bcfa4808a34cc9e33bca09dd247c7ad8 GIT binary patch literal 650 zcmeAS@N?(olHy`uVBq!ia0vp^2Y}dtgAGXfioSN;67wd=FFT9$i&DQL=Zujo&>bifq?-NzB%*+?fu=lmTbvyg! zw{J(p^7(o<GxH8b5c1xCmq@FXPr*Fe4D^3x3`=RRBk>JR@}Vk zL}_*P+oX;KcK;J5c%RCZa=U$0z_Iq9$y*KI)KtrmP|X`Zg&75B+cS14ZO=0gep~U> zyKqI--ZRU}|Ni{=XK96rR`dM*I_=Yz&HeT9&C(s3E4i#2etkN=?Z@fU@$r9Nh6~7F z{iLr~7vtZsb-tr=XTsa`3leLhYu?8n;$Lw8zu;Bb`kCL~X8e1#=F^9Ov+L?b@4h*A uhUG}tdItrD24E~Pa4^u1!N?$3&HPU9&^K0%+nvBv!{F)a=d#Wzp$PzPNB~3t literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/posbutton.png b/themes.src/purple_night/posbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..b3c45f8a6293aac616fbb9666e65a582c10e4222 GIT binary patch literal 942 zcmeAS@N?(olHy`uVBq!ia0vp^2Y}dtgAGXf3Y>ecaOtrtPz;4YR)5<6Mi)D_Fvw)J`&&^BJ z!s}$;%uP2vIrD8@<$g8(qQfu0|J{B6sPVO^x9_i;^mli+ZF=Xtc%}UOd*@5vz3z|y zvQsSO*DvYbw!Z%T=StsQyl8zjYpYNE{+qX}m6LnCmddVOmv`dxo|Wn?i7VpXhs`}V zbTg++poK++w&$s*pH4lU7ChHj?tZ3?oY$mt z=l7@n`eo~>HMMNZzI`*_v7EpB>({b1e;4~bpC0qzxAw~aKaS1#u{n?>^82KR`~Uy> zw7*s1_x1fMo~u_&ue#2!>Us6my0u~DZ`TN4zvflc`uyj|^M@a9mE~Li*8AMaItKp3 z@ftlj3k^19it&o;xUSx{#GQqH+Y;p)8&@}9>d>0CLDNLL zvv1w2o2td4&g7vro%wQ}d2suKSv7U1L$n-U3B(vn{8)DXy`B%pMCE|cz-WRzV6)7R(omVYekpCb}w&S6`01Nv%xc3Ve9R)>g9~nw>w&25foXANH$m|L-SyA2xjY{f>2l%(o~1?teY#Z}UfuE!NEPj~;*B zqle~&UpD+NFa0o|<-?s1`iCCae>RZe|F6XJ&zS%4#}B)0e)KbO91fUNQdG1mtJM7J z1NY}U4n+NaQT^AXIe+c$`#pL1NwGz2|;T_w7Ig7#5)z4*}Q$iB} D%j}-+ literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/purple_night-large.tab b/themes.src/purple_night/purple_night-large.tab new file mode 100644 index 0000000000..62b907cf9e --- /dev/null +++ b/themes.src/purple_night/purple_night-large.tab @@ -0,0 +1,217 @@ +# +# Simutrans purple night large theme +# +# Read the wiki article for better explanation and full parameters list +# https://wiki.simutrans.com/en_themeDef +# + +# name of the theme (will be shown with file selector) +name=Purple Night (large size) + +# show tooltips (default 1=show) +show_tooltips = 1 + +# tooltip background color (+-1 around this index is used), taken from player-color table +tooltip_background_color = 4 + +# tooltip text color (240=black, 215=white) +tooltip_text_color = 240 + +# delay before showing tooltip in ms (default 500ms) +tooltip_delay = 500 + +# duration in ms during tooltip is visible (default 5000ms=5s) +tooltip_duration = 5000 + +# windows drop a little shadow (default off) +# gui_drop_shadows = 1 + +#################################window stuff################################# + +# when moving, you can use windows to snap onto each other seamlessly +# if you do not like it, set the catch radius to zero +window_snap_distance = 8 + +# show the windows close etc. buttons on the right (like Windows) +# window_buttons_right = 0 + +# closes windows/toolbar when button clicked a second time (default off=0) +second_open_closes_win = 0 + +# restores window position when window is reopening +# This will be saved, but will be discarded when screen is resized +remember_window_positions = 1 + +# there are three different ways to indicate an active window + +# first: draw a frame with titlebar color around active window +# window_frame_active = 0 + +# second: draw the title with a different brightness (0: dark ... 6: bright) +front_window_bar_color = 1 +bottom_window_bar_color = 3 + +# third (best together with 2nd):use different text color for bar +# some colors are 215-white, 240-black 208-214- all shades of gray +front_window_text_color = #DDDDDD +bottom_window_text_color = #C0C0C0 + +#################################colour stuff################################# + +default_window_title_color = #705726 + +gui_color_text = #C0C0C0 +gui_color_text_highlight = #908010 +gui_color_text_shadow = #00FF00 +gui_color_text_title = #338FCC +gui_color_text_strong = #E46A0B + +########Test######## +gui_color_empty = #868c86 +gui_color_obsolete = #2878ff + +gui_color_edit_text = #908010 +gui_color_edit_text_selected = #FAFAFA +gui_color_edit_text_disabled = #666666 +gui_color_edit_background_selected = #72B2DD +gui_color_edit_beam = #a89823 + +gui_color_chart_background = #2e2e40 +gui_color_chart_lines_zero = #005C9E +gui_color_chart_lines_odd = #68688e +gui_color_chart_lines_even = #68688e + +gui_color_list_text_selected_focus = #C0C0C0 +gui_color_list_text_selected_nofocus = #908010 +gui_color_list_background_selected_focus = #72B2DD +gui_color_list_background_selected_nofocus = #72B2DD + +gui_color_button_text = #C0C0C0 +gui_color_button_text_disabled = #8A8A8A +gui_color_button_text_selected = #FAFAFA + +gui_color_colored_button_text = #201000 +gui_color_colored_button_text_selected = #CCCCCC + +gui_color_checkbox_text = #C0C0C0 +gui_color_checkbox_text_disabled = #666666 + +gui_color_ticker_background = #3c3c52 +gui_color_ticker_divider = #4d4d69 + +gui_color_statusbar_text = #C0C0C0 +gui_color_statusbar_background = #3c3c52 +gui_color_statusbar_divider = #4d4d69 + +gui_highlight_color = #68688e +gui_shadow_color = #000000 + +gui_color_text_minus = #C07010 +gui_color_text_plus = #70C010 +gui_color_text_unused = #E46A0B + +# Color of cursor overlay, which is blended over marked ground tiles +cursor_overlay_color = #1060F0 + +# Color loadbar, save game, load game, server... +gui_color_loadingbar_progress = #6080A0 +gui_color_loadingbar_inner = #303246 + +# Color player bright +gui_player_color_dark = 3 +gui_player_color_bright = 7 +gui_titlebar_player_color_background_brightness = 2 + +# make the chat window transparent in network games +gui_chat_window_network_transparency = 25 + +# if defined, use plain color for chat window in network games +gui_color_chat_window_network_transparency = #D6ECF7 + +# Transparency color of boost icons (mail, energy, passangers) in factories +gui_color_image_transparency = #ffffff + +# Extended unique color settings +gui_color_up_pointing_triangle = #00ebff +#gui_color_down_pointing_triangle = # +gui_color_out_of_production = #0092a5 +gui_color_text_overcrowding = #d659a5 +# Recommended brightness: gui_color_text < gui_color_text_weak < gui_color_text_inactive (reversed on dark themes) +gui_color_text_inactive = #63618c +gui_color_text_weak = #848a8c + +#---- Color for table +gui_color_table_header_border = #5a5973 +#gui_color_table_background_head_row = +gui_color_table_background_head_selected = #AD9239 +gui_color_table_frame = #63618c +gui_color_table_background_head_row = #63618c +gui_color_table_cell_border = #5a5973 +gui_color_table_background_left_col = #5a5973 +gui_color_table_background_data_sum = #52516b +gui_color_table_background_data = #4a4961 +gui_color_table_background = #424459 +gui_color_table_background_highlight = #737152 +gui_color_table_background_selected = #5A92A5 +gui_color_text_head_row = #FFFFFF +gui_color_text_left_col = #c6cbce +#gui_color_text_head_selected = #737152 +gui_color_text_table_cell_selected = #eff3f7 +gui_color_list_background_even = #424459 +gui_color_list_background_odd = #55576c + +##################################size stuff################################## + +# force main menu icon size +icon_width = 48 + +# titlebar height +gui_titlebar_height = 22 + +# width of the window elements +gui_gadget_width = 22 + +# safe margin around windows +# gui_frame_left = 10 +# gui_frame_top = 10 +# gui_frame_right = 10 +# gui_frame_bottom = 10 + +# horizontal and vertical margins between objects +# gui_hspace = 4 +# gui_vspace = 4 + +# tab minimum sizes +gui_tab_header_vsize = 22 + +# input boxes height +# minimum height is the height of the position button graphic +# gui_edit_height = 22 + +# checkbox height, default sizes come from the checkbox graphic +# gui_checkbox_width = 10 +# gui_checkbox_height = 10 + +# sum of the top and bottom margins for divider lines +# default is twice the size of gui_vspace +# gui_divider_vsize = 8 + +# buttons sizes +gui_button_height = 22 +# for buttons with fixed widths +gui_button_width = 100 + +# text margins inside the buttons (left, top, right) +gui_button_text_offset = 5,2,5 +gui_color_button_text_offset = 5,2,5 + +# maximum size of tool bars in tools (0 = no limit) +# if more tools than allowed by height, +# next and prev arrows for scrolling appears +toolbar_max_width = 0 +toolbar_max_height = 0 + +###################################pakstuff################################### + +# pak with the images for this theme +themeimages=purple_night-large.pak diff --git a/themes.src/purple_night/purple_night.tab b/themes.src/purple_night/purple_night.tab new file mode 100644 index 0000000000..728f29105a --- /dev/null +++ b/themes.src/purple_night/purple_night.tab @@ -0,0 +1,217 @@ +# +# Simutrans purple night theme +# +# Read the wiki article for better explanation and full parameters list +# https://wiki.simutrans.com/en_themeDef +# + +# name of the theme (will be shown with file selector) +name=Purple Night + +# show tooltips (default 1=show) +show_tooltips = 1 + +# tooltip background color (+-1 around this index is used), taken from player-color table +tooltip_background_color = 4 + +# tooltip text color (240=black, 215=white) +tooltip_text_color = 240 + +# delay before showing tooltip in ms (default 500ms) +tooltip_delay = 500 + +# duration in ms during tooltip is visible (default 5000ms=5s) +tooltip_duration = 5000 + +# windows drop a little shadow (default off) +# gui_drop_shadows = 1 + +#################################window stuff################################# + +# when moving, you can use windows to snap onto each other seamlessly +# if you do not like it, set the catch radius to zero +window_snap_distance = 8 + +# show the windows close etc. buttons on the right (like Windows) +# window_buttons_right = 0 + +# closes windows/toolbar when button clicked a second time (default off=0) +second_open_closes_win = 0 + +# restores window position when window is reopening +# This will be saved, but will be discarded when screen is resized +remember_window_positions = 1 + +# there are three different ways to indicate an active window + +# first: draw a frame with titlebar color around active window +# window_frame_active = 0 + +# second: draw the title with a different brightness (0: dark ... 6: bright) +front_window_bar_color = 1 +bottom_window_bar_color = 3 + +# third (best together with 2nd):use different text color for bar +# some colors are 215-white, 240-black 208-214- all shades of gray +front_window_text_color = #DDDDDD +bottom_window_text_color = #B7B7B7 + +#################################colour stuff################################# + +default_window_title_color = #705726 + +gui_color_text = #D0D0D0 +gui_color_text_highlight = #908010 +gui_color_text_shadow = #00FF00 +gui_color_text_title = #338FCC +gui_color_text_strong = #E46A0B + +########Test######## +gui_color_empty = #868c86 +gui_color_obsolete = #2878ff + +gui_color_edit_text = #908010 +gui_color_edit_text_selected = #FAFAFA +gui_color_edit_text_disabled = #666666 +gui_color_edit_background_selected = #72B2DD +gui_color_edit_beam = #a89823 + +gui_color_chart_background = #2e2e40 +gui_color_chart_lines_zero = #005C9E +gui_color_chart_lines_odd = #68688e +gui_color_chart_lines_even = #68688e + +gui_color_list_text_selected_focus = #B7B7B7 +gui_color_list_text_selected_nofocus = #908010 +gui_color_list_background_selected_focus = #72B2DD +gui_color_list_background_selected_nofocus = #72B2DD + +gui_color_button_text = #C0C0C0 +gui_color_button_text_disabled = #8A8A8A +gui_color_button_text_selected = #FAFAFA + +gui_color_colored_button_text = #201000 +gui_color_colored_button_text_selected = #CCCCCC + +gui_color_checkbox_text = #C0C0C0 +gui_color_checkbox_text_disabled = #666666 + +gui_color_ticker_background = #3c3c52 +gui_color_ticker_divider = #4d4d69 + +gui_color_statusbar_text = #C0C0C0 +gui_color_statusbar_background = #3c3c52 +gui_color_statusbar_divider = #4d4d69 + +gui_highlight_color = #68688e +gui_shadow_color = #000000 + +gui_color_text_minus = #C07010 +gui_color_text_plus = #70C010 +gui_color_text_unused = #E46A0B + +# Color of cursor overlay, which is blended over marked ground tiles +cursor_overlay_color = #1060F0 + +# Color loadbar, save game, load game, server... +gui_color_loadingbar_progress = #6080A0 +gui_color_loadingbar_inner = #303246 + +# Color player bright +gui_player_color_dark = 3 +gui_player_color_bright = 7 +gui_titlebar_player_color_background_brightness = 2 + +# make the chat window transparent in network games +gui_chat_window_network_transparency = 25 + +# if defined, use plain color for chat window in network games +gui_color_chat_window_network_transparency = #D6ECF7 + +# Transparency color of boost icons (mail, energy, passangers) in factories +gui_color_image_transparency = #ffffff + +# Extended unique color settings +gui_color_up_pointing_triangle = #00ebff +#gui_color_down_pointing_triangle = # +gui_color_out_of_production = #0092a5 +gui_color_text_overcrowding = #d659a5 +# Recommended brightness: gui_color_text < gui_color_text_weak < gui_color_text_inactive (reversed on dark themes) +gui_color_text_inactive = #63618c +gui_color_text_weak = #848a8c + +#---- Color for table +gui_color_table_header_border = #5a5973 +#gui_color_table_background_head_row = +gui_color_table_background_head_selected = #AD9239 +gui_color_table_frame = #63618c +gui_color_table_background_head_row = #63618c +gui_color_table_cell_border = #5a5973 +gui_color_table_background_left_col = #5a5973 +gui_color_table_background_data_sum = #52516b +gui_color_table_background_data = #4a4961 +gui_color_table_background = #424459 +gui_color_table_background_highlight = #737152 +gui_color_table_background_selected = #5A92A5 +gui_color_text_head_row = #FFFFFF +gui_color_text_left_col = #c6cbce +#gui_color_text_head_selected = #737152 +gui_color_text_table_cell_selected = #eff3f7 +gui_color_list_background_even = #424459 +gui_color_list_background_odd = #55576c + +##################################size stuff################################## + +# force main menu icon size +icon_width = 32 + +# titlebar height +gui_titlebar_height = 22 + +# width of the window elements +gui_gadget_width = 20 + +# safe margin around windows +# gui_frame_left = 10 +# gui_frame_top = 10 +# gui_frame_right = 10 +# gui_frame_bottom = 10 + +# horizontal and vertical margins between objects +# gui_hspace = 4 +# gui_vspace = 4 + +# tab minimum sizes +gui_tab_header_vsize = 18 + +# input boxes height +# minimum height is the height of the position button graphic +# gui_edit_height = 22 + +# checkbox height, default sizes come from the checkbox graphic +# gui_checkbox_width = 10 +# gui_checkbox_height = 10 + +# sum of the top and bottom margins for divider lines +# default is twice the size of gui_vspace +# gui_divider_vsize = 8 + +# buttons sizes +gui_button_height = 17 +# for buttons with fixed widths +gui_button_width = 100 + +# text margins inside the buttons (left, top, right) +gui_button_text_offset = 5,1,5 +gui_color_button_text_offset = 5,1,5 + +# maximum size of tool bars in tools (0 = no limit) +# if more tools than allowed by height, +# next and prev arrows for scrolling appears +toolbar_max_width = 0 +toolbar_max_height = 0 + +###################################pakstuff################################### + +# pak with the images for this theme +themeimages=purple_night.pak diff --git a/themes.src/purple_night/scrollbar-small.png b/themes.src/purple_night/scrollbar-small.png new file mode 100644 index 0000000000000000000000000000000000000000..45826725ef72b0529d19798afd8f6dc448ef32d9 GIT binary patch literal 2886 zcmd6pdpuO@8pjvPxSWzGlAYb8#z;vw+s>_wM2t%!mypsFh2+)@Gdf$_;M9~cQEufL z(;&_?iZQCmq#cvWC5&;4kS2_oX~xXj%en0R&-tU>U+1%a&$HHgp7;H{>$BFozR#2H zfp%JC@%m|YJm(;Q-vbN?d2Tkq#AnI2?c;l#~o$`8H%V!AM(2h0Gc{W zrUcy1*N1|zSZ6m!*tnAFDl_#%>fT5I(0J>N+V7p%H^X}nMaFDsndL_qB37BWz$}aQfYQ-lmQC!U?J) zirvu>QrSZgevI}u?MlGg+6HZf!`JHh9%d@0dsy4xaQxzh?NpzL#%t%JqFP5r%**gP z`Uc@^qJm%x$5|8T3Y{4ddhAlr)Pg&@JCjJHP(=G=O>f&qKm4|>%;X{#@^CmCO-PM(Xm*Yk)p;gg^hUr8ihPyW_abv#Kt~LCmT>;kk z#T}9S=6TW8XqM))o!EN5(OMmyBT){=D!q$+)@NAr&E!&dXd)R=k|;WN(pOE~xTExx z(tvpqa`JhNT@rFiE4Zp7|5io~s}PGwt?XU@lv$KfYH+~Cu*LfsgU?1JeOfWRxX3GY z(6`7Pkjfky8uSkw>mKGHfgj(ie`$BJNysW#M(x6iI-M3yA)Zhu@ek|f-Wm5Ix=8jo zDY#aD*80(cOl|jFKvZh*6nY&L7e}=#9+LPgg7ydpiAfy5U|1$3_tWfBk@>0dI82Y_ zewjmV>vH?%>HbLhMptAKjHh}dRDzw2U?gO%46Y!H%YbiC3JbLd zUfh{$rKer5JsVbUWqI?B`kCFQyEl#apa#zEo!C(NP|4uxE%*mL`+BRK_n?S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3?bG*@+Vpk4SrHM__J^_z5+3<{#Qz>0(P`wh&u_g(m>V}XqTdr z3$>=ph?D9q%hUknzoryG`MdRF3h;+KG{EJZ*Qxh>h+HeE;{}`@(WvSJA%FiJFS^Nx literal 0 HcmV?d00001 diff --git a/themes.src/purple_night/scrollbar.png b/themes.src/purple_night/scrollbar.png new file mode 100644 index 0000000000000000000000000000000000000000..b4e61e99753ef7e43850701f443a52d279040da0 GIT binary patch literal 3914 zcmd6qX;f3!+Q$!yPz#DtE44&#+b}4T!6twpP$+|dAOc|sBvh&fWN1ag z5NMQuK!8x7$PhyCmO(^_j1d{aWGM3(LK05SJ+@tUt$UXrdf)fUyUy8X*n92$>~o%H z|9{U;xMF9y>tpqg0RY%_$qMZN0CG)m0X|ZIYYullZG&$Lp4OIV0D6BsW*4TxH9K!v zIfnv((!Tda4#>_?gDVxoF4>wZ3gmX|H&#~nzZeGqyLp$;7r%*oyD-8DJ~*AFxa^B# zRcWC=zqa>LX<{OiEWh0`@_|t<iC{1X91`nx3|uSQ_-Pio zTM>ipFDU28I`TOX=Uj*ui}Xsyc|BLgw2uazDI+K!$Uf$eKJGrwcqkJjjn9=sr@DoO zOa#I@G<5BxDM8khhSJLG_G_M>7iUtbsVk*7dcK6sm*J#Mf>iR0O5JN^_^Bv2s)X7} z=kfik1FpiK#DYW;@ll~6wYnH31{wxta!gmhpY&o5cqlWIsbZ_vw!S=BNM^w`sGs&4 z;>})x?0<*8n?ur0hZn&ea*X{1rfT!8geA~yl&~b?cK)F4`BcG6KlJsh@_zre!75d^ z?43^?NX{vq5u!^s=Sa^W_xUwmnf#nYMmtY9v^#r$e;pJNK|?#II25C9bn-~c=^l+}>Y_)k z`)R+dv|-2!_cdb9P@|^A?T5Kw{`OxOj7SKKc&L#%Gn4i8$bO9DZ{wO4bgeoSj_QIf z5Inl|MR9$V?t|V!(~#LdE}c(OGc_G*XN&Bm(2YGB)2HP2sm0wNlogBSMPaXAH6YsR z^sZzKE_wVyjag>THduZ6ktj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Eb7FJ83sqKNac$*`I90wUn)~{SW8H^FV)yc6 zYjATCn4eolD}<;Xe$2Z!`dMyK-IJh*KPa01#>SqDt`e`e#=-2H`XkYxc*EHWOu(#q zXloiW83+jPUP46%txD$)*YZhMq>`b9jS4rqg`5-Roiztu=rhWf=?JcyYIJmj$LTDI zXmMT2Be>5?pEz+P7XSK_`j?gSb=a|Q8MmVGf`3^MN{!B-k#TnIv0iCnN+j0{uCU z7bEIEYrY-?WiQW*LN7n7F?_iA{eGtS<0dlEnSvs!`g4}H7JM5%?*r<|%_ZPDZ+lHCX)rLoxvUwL_ zM#6pmpc~k(IQCK?h=!SH)OUBWQr9bB?jlS}OLS?UhcYg4q751rUpY?uL)-eE$_j-s zq1FO=C|!(r3g4n-Y&_}At0O<2fi3O^OB?(hZV$EwaDH2xkL z|3i2FV(I?@weWx+*2g0ka9C^@OKA;Ju^++H@)X2*J=31Rp-b1JO9Il&fRV+2Y`p8> z%$`xVq${CKBwY2FoN)ZN#-scRJ6d^GKcSFQwB|s`J~Npfk1K}p42;dzajgL z-wZ8k$45lXI8eMrtLIXEPN&A-dCXvBbr)?G9ZgJK)H`uKrKNodg5SML`ptSS(lJk< ztjJ`tQ#PFB4-T${WMbhZM~0tH8X6)eo!9bR2H}lJS(ze+^6m+a2qVxFR#`1ib0yn` zf^%FtoR)u!yZA53>xIlQ&F`huB=Y1HELQn`{L#d(pwlbah>+@Dma4f+P8rMOH@d9l(IrR{M(Lq92YI=od7-c)pU0$ z#A^r31t5=@06MWM5OhqQr#&&bg6xT2N?U|rvS=T0 " to have them non zoomable +# +# This theme has the scalable standard look +# +################################################ +# +# Button have 3 rows with left middle right images for one state +# +# If only top row is there, button will be centered vertically in area if the size does not match. +# If all nine are there, you can set any size in themes.tab +# +-- +Obj=menu +name=Button +# normal +Image[0]=> button.0.0 +Image[1]=> button.0.2 +Image[2]=> button.0.1 +Image[3]=> button.0.3 +Image[4]=> button.0.5 +Image[5]=> button.0.4 +Image[6]=> button.0.6 +Image[7]=> button.0.8 +Image[8]=> button.0.7 +# pressed +Image[9]=> button.1.0 +Image[10]=> button.1.2 +Image[11]=> button.1.1 +Image[12]=> button.1.3 +Image[13]=> button.1.5 +Image[14]=> button.1.4 +Image[15]=> button.1.6 +Image[16]=> button.1.8 +Image[17]=> button.1.7 +# disabled (will use the unpressed color mask) +Image[18]=> button.2.0 +Image[19]=> button.2.2 +Image[20]=> button.2.1 +Image[21]=> button.2.3 +Image[22]=> button.2.5 +Image[23]=> button.2.4 +Image[24]=> button.2.6 +Image[25]=> button.2.8 +Image[26]=> button.2.7 +# color mask (will be blended, so it is a good idea to have a bright color for the foreground in this area) +Image[27]=> button.3.0 +Image[28]=> button.3.2 +Image[29]=> button.3.1 +Image[30]=> button.3.3 +Image[31]=> button.3.5 +Image[32]=> button.3.4 +Image[33]=> button.3.6 +Image[34]=> button.3.8 +Image[35]=> button.3.7 +# If the position of the colored area is different for a pressed button (i.e. protruding knobs) +# then here can come another nine mask images +-- +Obj=menu +name=Roundbutton +# normal +Image[0]=> button.0.0 +Image[1]=> button.0.2 +Image[2]=> button.0.1 +Image[3]=> button.0.3 +Image[4]=> button.0.5 +Image[5]=> button.0.4 +Image[6]=> button.0.6 +Image[7]=> button.0.8 +Image[8]=> button.0.7 +# pressed +Image[9]=> button.1.0 +Image[10]=> button.1.2 +Image[11]=> button.1.1 +Image[12]=> button.1.3 +Image[13]=> button.1.5 +Image[14]=> button.1.4 +Image[15]=> button.1.6 +Image[16]=> button.1.8 +Image[17]=> button.1.7 +# disabled +Image[18]=> button.2.0 +Image[19]=> button.2.2 +Image[20]=> button.2.1 +Image[21]=> button.2.3 +Image[22]=> button.2.5 +Image[23]=> button.2.4 +Image[24]=> button.2.6 +Image[25]=> button.2.8 +Image[26]=> button.2.7 +-- +Obj=menu +name=Editfield +#should be either scalable or at least LINESPACE+2px high +Image[0]=> editfield.0.0 +Image[1]=> editfield.0.1 +Image[2]=> editfield.0.2 +Image[3]=> editfield.1.0 +Image[4]=> editfield.1.1 +Image[5]=> editfield.1.2 +Image[6]=> editfield.2.0 +Image[7]=> editfield.2.1 +Image[8]=> editfield.2.2 +-- +Obj=menu +name=Listbox +#Must be scalable! +Image[0]=> listbox.0.0 +Image[1]=> listbox.0.1 +Image[2]=> listbox.0.2 +Image[3]=> listbox.1.0 +Image[4]=> listbox.1.1 +Image[5]=> listbox.1.2 +Image[6]=> listbox.2.0 +Image[7]=> listbox.2.1 +Image[8]=> listbox.2.2 +-- +# window background +Obj=menu +name=Back +Image[0]=> back.0.0 +Image[1]=> back.0.1 +Image[2]=> back.0.2 +Image[3]=> back.1.0 +Image[4]=> back.1.1 +Image[5]=> back.1.2 +Image[6]=> back.2.0 +Image[7]=> back.2.1 +Image[8]=> back.2.2 +-- +################################################################# +# +# The following control only have one (or three) images, and are not stretchable +# +Obj=menu +name=Checkbutton +# normal +Image[0]=> checkbutton.0.0 +# pressed +Image[1]=> checkbutton.0.1 +# disabled +Image[2]=> checkbutton.0.2 +-- +Obj=menu +name=Posbutton +# normal +Image[0]=> posbutton.0.0 +# pressed +Image[1]=> posbutton.0.1 +# disabled +Image[2]=> posbutton.0.2 +-- +Obj=menu +name=Scrollbar +# normal/pressed/disabled left button +Image[0]=> scrollbar.0.0 +Image[1]=> scrollbar.0.1 +Image[2]=> scrollbar.0.2 +# normal/pressed/disabled right button +Image[3]=> scrollbar.0.3 +Image[4]=> scrollbar.0.4 +Image[5]=> scrollbar.0.5 +# left/center/right scrollbar background +Image[6]=- +Image[7]=> scrollbar.1.6 +Image[8]=- +# left/center/right scrollbar knob +Image[9]=> scrollbar.1.0 +Image[10]=> scrollbar.1.2 +Image[11]=> scrollbar.1.1 +# normal/pressed/disabled up button +Image[12]=> scrollbar.2.0 +Image[13]=> scrollbar.2.1 +Image[14]=> scrollbar.2.2 +# normal/pressed/disabled down button +Image[15]=> scrollbar.2.3 +Image[16]=> scrollbar.2.4 +Image[17]=> scrollbar.2.5 +# up/center/down scrollbar background +Image[18]=- +Image[19]=> scrollbar.3.6 +Image[20]=- +# up/center/down scrollbar knob +Image[21]=> scrollbar.3.0 +Image[22]=> scrollbar.3.2 +Image[23]=> scrollbar.3.1 +-- +# window symbols +Obj=menu +name=Gadget +# close +Image[0]=> gadget.0.0 +# help +Image[1]=> gadget.0.1 +# minimize +Image[2]=> gadget.0.2 +# previous +Image[3]=> gadget.0.3 +# next +Image[4]=> gadget.0.4 +# unsticky +Image[5]=> gadget.0.5 +# sticky +Image[6]=> gadget.0.6 +# resize corner +Image[7]=> gadget.0.7 +# goto pos +Image[8]=> gadget.0.8 +-- +# divider line +Obj=menu +name=Divider +Image[0]=- +Image[1]=> divider.0.0 +Image[2]=- +-- diff --git a/themes.src/purple_night/standard.dat b/themes.src/purple_night/standard.dat new file mode 100644 index 0000000000..8f34e4dabb --- /dev/null +++ b/themes.src/purple_night/standard.dat @@ -0,0 +1,310 @@ +# +# Simutrans window skin definitions for themes +# +# All image names must start with "> " to have them non zoomable +# +# This theme has the scalable standard look +# +################################################ +# +# Button have 3 rows with left middle right images for one state +# +# If only top row is there, button will be centered vertically in area if the size does not match. +# If all nine are there, you can set any size in themes.tab +# +-- +Obj=menu +name=Button +# normal +Image[0]=> button.0.0 +Image[1]=> button.0.2 +Image[2]=> button.0.1 +Image[3]=> button.0.3 +Image[4]=> button.0.5 +Image[5]=> button.0.4 +Image[6]=> button.0.6 +Image[7]=> button.0.8 +Image[8]=> button.0.7 +# pressed +Image[9]=> button.1.0 +Image[10]=> button.1.2 +Image[11]=> button.1.1 +Image[12]=> button.1.3 +Image[13]=> button.1.5 +Image[14]=> button.1.4 +Image[15]=> button.1.6 +Image[16]=> button.1.8 +Image[17]=> button.1.7 +# disabled (will use the unpressed color mask) +Image[18]=> button.2.0 +Image[19]=> button.2.2 +Image[20]=> button.2.1 +Image[21]=> button.2.3 +Image[22]=> button.2.5 +Image[23]=> button.2.4 +Image[24]=> button.2.6 +Image[25]=> button.2.8 +Image[26]=> button.2.7 +# color mask (will be blended, so it is a good idea to have a bright color for the foreground in this area) +Image[27]=> button.3.0 +Image[28]=> button.3.2 +Image[29]=> button.3.1 +Image[30]=> button.3.3 +Image[31]=> button.3.5 +Image[32]=> button.3.4 +Image[33]=> button.3.6 +Image[34]=> button.3.8 +Image[35]=> button.3.7 +# If the position of the colored area is different for a pressed button (i.e. protruding knobs) +# then here can come another nine mask images +-- +Obj=menu +name=Roundbutton +# normal +Image[0]=> button.0.0 +Image[1]=> button.0.2 +Image[2]=> button.0.1 +Image[3]=> button.0.3 +Image[4]=> button.0.5 +Image[5]=> button.0.4 +Image[6]=> button.0.6 +Image[7]=> button.0.8 +Image[8]=> button.0.7 +# pressed +Image[9]=> button.1.0 +Image[10]=> button.1.2 +Image[11]=> button.1.1 +Image[12]=> button.1.3 +Image[13]=> button.1.5 +Image[14]=> button.1.4 +Image[15]=> button.1.6 +Image[16]=> button.1.8 +Image[17]=> button.1.7 +# disabled +Image[18]=> button.2.0 +Image[19]=> button.2.2 +Image[20]=> button.2.1 +Image[21]=> button.2.3 +Image[22]=> button.2.5 +Image[23]=> button.2.4 +Image[24]=> button.2.6 +Image[25]=> button.2.8 +Image[26]=> button.2.7 +-- +Obj=menu +name=Editfield +#should be either scalable or at least LINESPACE+2px high +Image[0]=> editfield.0.0 +Image[1]=> editfield.0.1 +Image[2]=> editfield.0.2 +Image[3]=> editfield.1.0 +Image[4]=> editfield.1.1 +Image[5]=> editfield.1.2 +Image[6]=> editfield.2.0 +Image[7]=> editfield.2.1 +Image[8]=> editfield.2.2 +-- +Obj=menu +name=Listbox +#Must be scalable! +Image[0]=> listbox.0.0 +Image[1]=> listbox.0.1 +Image[2]=> listbox.0.2 +Image[3]=> listbox.1.0 +Image[4]=> listbox.1.1 +Image[5]=> listbox.1.2 +Image[6]=> listbox.2.0 +Image[7]=> listbox.2.1 +Image[8]=> listbox.2.2 +-- +# window background +Obj=menu +name=Back +Image[0]=> back.0.0 +Image[1]=> back.0.1 +Image[2]=> back.0.2 +Image[3]=> back.1.0 +Image[4]=> back.1.1 +Image[5]=> back.1.2 +Image[6]=> back.2.0 +Image[7]=> back.2.1 +Image[8]=> back.2.2 +-- +################################################################# +# +# The following control only have one (or three) images, and are not stretchable +# +Obj=menu +name=Checkbutton +# normal +Image[0]=> checkbutton-small.0.0 +# pressed +Image[1]=> checkbutton-small.0.1 +# disabled +Image[2]=> checkbutton-small.0.2 +-- +Obj=menu +name=Posbutton +# normal +Image[0]=> posbutton-small.0.0 +# pressed +Image[1]=> posbutton-small.0.1 +# disabled +Image[2]=> posbutton-small.0.2 +-- +Obj=menu +name=Scrollbar +# normal/pressed/disabled left button +Image[0]=> scrollbar-small.0.0 +Image[1]=> scrollbar-small.0.1 +Image[2]=> scrollbar-small.0.2 +# normal/pressed/disabled right button +Image[3]=> scrollbar-small.0.3 +Image[4]=> scrollbar-small.0.4 +Image[5]=> scrollbar-small.0.5 +# left/center/right scrollbar background +Image[6]=- +Image[7]=> scrollbar-small.1.6 +Image[8]=- +# left/center/right scrollbar knob +Image[9]=> scrollbar-small.1.0 +Image[10]=> scrollbar-small.1.2 +Image[11]=> scrollbar-small.1.1 +# normal/pressed/disabled up button +Image[12]=> scrollbar-small.2.0 +Image[13]=> scrollbar-small.2.1 +Image[14]=> scrollbar-small.2.2 +# normal/pressed/disabled down button +Image[15]=> scrollbar-small.2.3 +Image[16]=> scrollbar-small.2.4 +Image[17]=> scrollbar-small.2.5 +# up/center/down scrollbar background +Image[18]=- +Image[19]=> scrollbar-small.3.6 +Image[20]=- +# up/center/down scrollbar knob +Image[21]=> scrollbar-small.3.0 +Image[22]=> scrollbar-small.3.2 +Image[23]=> scrollbar-small.3.1 +-- +# window symbols +Obj=menu +name=Gadget +# close +Image[0]=> gadget.0.0 +# help +Image[1]=> gadget.0.1 +# minimize +Image[2]=> gadget.0.2 +# previous +Image[3]=> gadget.0.3 +# next +Image[4]=> gadget.0.4 +# unsticky +Image[5]=> gadget.0.5 +# sticky +Image[6]=> gadget.0.6 +# resize corner +Image[7]=> gadget.0.7 +# goto pos +Image[8]=> gadget.0.8 +# unlocked +Image[9]=> gadget.0.9 +# locked +Image[10]=> gadget.0.10 +-- +# divider line +Obj=menu +name=Divider +Image[0]=- +Image[1]=> divider.0.0 +Image[2]=- +-- +################################################################# +Obj=menu +name=Alerts +copyright=Ranran +Image[0]=> ../symbols.0.0 +Image[1]=> ../symbols.0.1 +Image[2]=> ../symbols.0.2 +Image[3]=> ../symbols.0.3 +Image[4]=> ../symbols.0.4 +-- +Obj=menu +name=WaitingTime +copyright=Ranran +# for average waiting time at the stop +Image[0]=> ../symbols.2.0 +------- +Obj=menu +name=TravelTime +copyright=Ranran +# for display the average travering time to the distination +Image[0]=> ../symbols.2.1 +------- +Obj=menu +name=ServiceFrequency +copyright=Ranran +# for display the line service frequency +Image[0]=> ../symbols.2.2 +------- +Obj=menu +name=MissingScheduledSlot +copyright=Ranran +# for line missing scheduled slot +Image[0]=> ../symbols.2.3 +------- +Obj=menu +name=OnFoot +copyright=Ranran +Image[0]=> ../symbols.2.4 +------- +Obj=menu +name=Comfort +copyright=Ranran +Image[0]=> ../symbols.6.0 +------- +Obj=menu +name=Comfort +copyright=Ranran +Image[0]=> ../symbols.6.0 +------- +Obj=menu +name=Upgradable +copyright=Ranran +# for vehicle which has upgrade target +Image[0]=> ../symbols.0.5 +Image[1]=> ../symbols.0.6 +------- +Obj=menu +name=ReverseArrows +copyright=Ranran +# arrows representing the reverse order of the schedule +Image[0]=> ../symbols.2.5 +Image[1]=> ../symbols.2.6 +------- +Obj=menu +name=InputOutput +copyright=Ranran +# for industry input/output +Image[0]=> ../symbols.4.0 +Image[1]=> ../symbols.4.1 +------- +Obj=menu +name=InTransit +copyright=Ranran +# for goods in transit for industry information +Image[0]=> ../symbols.4.2 +------- +################################################################# +------- +Obj=menu +name=Search +copyright=Ranran +Image[0]=> ../symbols.6.1 +------- +Obj=menu +name=OpenWindow +copyright=Ranran +Image[0]=> ../button-../symbols.0.0 +------- diff --git a/themes.src/purple_night/symbols.png b/themes.src/purple_night/symbols.png new file mode 100644 index 0000000000000000000000000000000000000000..60c84b8066c1d525ead94fcdea370635759e37c1 GIT binary patch literal 7707 zcmeHLc~n!$ny-5a5>P=K!Hv}wMTHg>lqFHxc0q-)1yqngE6|Efz<@vk+^a23+b+=U ziY&neX+;606%ay#5l~r$MnDq6qF@Y=Ktcjp=LUM-oSF09o7eMt=AW6Ib5B+7t@@T< zef9gksfd}WoyX&5okwSpez;Zqb>WuTE4D7_c(L|7n|q52 z4NaHL`jI#df43Zu!+mzS)oa!-R=Asm_$^)skM8bhp=8nM_1tvsapLixDQ@%zvUGKw zR91cdZBX1T-5~al&zc#ML&aTVIX6LMmzOPyXuZ%fvkySE# zhv~^xj;;%yxo2myk?u}k@7le%IdS7v-w}pK=0HgnYMscGT)fSo$kKVd(N)2ra;?2s zJ%p1Y-snxSAUYWZHtRrdCBba&UfhwyMr4p>Bycx}xOCeOJ6UJxdExqkyzv;XnO9;> ztSr=8b4J4v6EfnR)bL}8DwC!@oQ&LF4nJ1Oc%=h`ljDxmMOK}icHo^}LfB(Av*@^R zw!~j*M9b(3@B~K?J1g^XcFew@?uXv#muogw?-LZthw z#=v8E9)Bk4^_rns26kd1ISR|^=<|H|JXgV+1-AO@elz^RF{izl?+F;`LL2m5hAyN&HI(CcCBnT>ON!8 z!Bh96m{DIELpeAiW!&)weijIJ!9{FoyGg3+;pwA2^?3AwCH#>(i1-7oQ;J8LIlv=j zUK#B5!W)fDQRM=sulLw|C_)u4n0a zz0-<(8-gP~m7OUQsyu(?6u?nD1wA5-q&qK0i1Y?0DAJch8aA>JfgW`S%{3Z0*2 zX9i8tOIddC=s6UJrlqBUSs)}N1SW#(X=(ZZ3JeKZ2L7}U|3hN`s)anAIlvw*Bry8f3rn{UKQ<24$KcXx|AQ@SLt({4o)#2M5Z8OpRKA zO|3Fd6z6f-r;id4{bi-L0DV zcA^V;=WMF6@{bWZ^rROPKIe;}6D0;swifESW|TTo&FH;PG&R55Q<&SBQxJ@RYGisn zLw&UKNn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4T}6|ZJx@oNs!dLu!(nQGMdlOwP|;U{JwP>)Kna+*?a>J0z0o6 zO8O({$5xnP`)c(}8dELIXXUekyuNtJ7Mot{q$Ve38E;@btd|I_6B8 literal 0 HcmV?d00001 diff --git a/themes.src/silver/back.png b/themes.src/silver/back.png new file mode 100644 index 0000000000000000000000000000000000000000..f94a4ab668443ff35fd1bcaf031df283dace6355 GIT binary patch literal 633 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE4M+yv$zcalY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPlqm&2>PsIc`*VBz&Dd<+fUB*7 z3Jd}a91JWBObm<-3=Rxb=VCK;gUH>_r-P%{<~?scKD#tLli~e+`Lm`L(rvYI=J`v{ z-REx57oeq^Sg`su!jIvyNt%@UWChQ@t7do9J?n3t=Wf5|#rxp(^UGWR7svkMexkZ! z`LCJZJvZHb_pJ5z?)D&NiMHCWY<`~WR^{!>KDy85!+UWK+Jz;iyAv|&7=L`zYCI+O SZW}O>FnGH9xvXp@y?Q7WK zXBYMD{Jhl-7eAD)HCGH}{QDtR(~?Vq_x?QhE+#hh`O6y~SKnbgTe~DWM4fNpna& literal 0 HcmV?d00001 diff --git a/themes.src/silver/button.png b/themes.src/silver/button.png new file mode 100644 index 0000000000000000000000000000000000000000..0b20925c16a19d3d6f725e683fd0dc8077801f80 GIT binary patch literal 1685 zcmd5)jZ@Nh82@1gOCw90cv{hQxSB(BrI#-|bWKX2f91) zgk^Rz&w|hti!gz_+>DtOWMmm?n`kP^5=BAyv7h}D^*r}{zt4T{dG2{W_j#%#j~qfe zxH|v8MFW6cC;-5KPv8)e=%wg~K6o1WP#9oa^J~&pHiT?A6;8Zn;iyMgpxEABunn$E?4 zpWSj!b4q+}YYE4Sm@4KEP{;P`xrWAlViK#Rr3Irn?spR%0+w8?z+y`&``y{GEUb@D ztKXba8pKRYOdM1yqgWGv)n!JRY+4Sj5raTfy&N7UwThC`tu1Ebh~Ds4Sz|$O%Pd(X zkVb5zC$?dgDjL5sp4EtPLetnGXxn+r34AcN8TQ)_VS0x4o;hvvO_E22S{+xrgC<)^ z!$tBBe&3luF}2C^rbNxFx5Q%3K&9_`WGKfexonApiC=j4EM8s~d9j|!%qoYY3W2?QrsY(gjqweg|gQ_u%gvI00*BI2-UE*>T zMq_PIbqo;svsSCcdV9wbadcZvr_{R3Q*PJM(UGxbF_(S`oOANG1NLMCc92dV+Q23+ zVuDb;n>fjOJ-2j*j=cdB#?9ul>M#Onl732M_cZJFj0)AeH2Z>1rx|sW*yuTN?igrY z4Z-7&w7>Y`4(Plcjh0_+Xy}fMja8c3XM-wx$Ma9DCQqBt*|!r0`FvW#l`D^)3*u|D z?+*@&6Dl02XEhxD27O&Ime<&@r^;fM%Syd}l=Aqax^qpe{XE)7O>#86&Hpio!+F<|zyej3u5fjv*Dd-rn@}IvgO;b}?MD zgxxi%T<}f@himzTnO9aC%WgXwS)L$xWa^656BKSbx|IgiPY9E_KgXEsj?cc^zbCZF zoq299?wRKK>dm)FDV3$Awey*D#kTLASHCstZ}z{JB~efQG^=d>{CV@PRefdmE||Rk zTJ^VL=8_Y<2K8x+FRqZ|Yqu8Py>9jGZMtRu4y#nx|53TQZtjwpz4PnuKlGpUHfrN% z{zKE-+n4XzYw9`a_s`wyZtva^t6lcbanjSOzdx?aE3Wr^$7RQ`cmDp|+xO1Z zZ@8Ib!~Ri_hlzo)fx&@6fkA))XfOjcxeg55K!z`C}Hq)^>bP0 Hl+XkK(2BOf literal 0 HcmV?d00001 diff --git a/themes.src/silver/checkbutton.png b/themes.src/silver/checkbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..a9a19e17fc0dc2f0ed2c508f148d8f743ec885b1 GIT binary patch literal 768 zcmeAS@N?(olHy`uVBq!ia0vp^2Y}dtgAGXf{XE)7O>#86&HpDr+-W+9U=Bre04M$B>F!Z*Li9OC`!2|9F3H zQ_JTEXSg%YrfgKQXyM~?;`-=oa)Gb)$ieW7rpY^1FDT|O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 z8+Iq$WAg8HV4U+?W(V_}-|hv;AEQ6XCNSQSJ+S)x>Z+e9J1c#79?Xw_cQt>W{Vf|e z)`DNM51#z^DpT?C`Hy0I=9u0;ybhhm?NsZ$|ML_)RTd~``tjuI$!8I>j~`+9_vPEc zXRHpNC4>)5&36(wu=eZ)Zie@DDsuIrzjOsWk6WA83GZWF^vS*8KP%AU3cIX^`cTiqrvym4vw~X#%etV2L@?I9tMSmUIsP> z0brtHX5dIrZeV0!*&ql^-%K|+5*Qd5b65-*8W_x&Bv6zapz%r6j;tJq4aiD}a1eGS z2iP+9GhE-laRK8EhPUDmewmAzFi0=>%M|nfSQA?U^OpFA*Y_hXFyu6R<1Y9s%`Mfy zd!deTU4616^9IIS`Uk$|>tryPIs9hb@voPa7i1VrC>fR2HM_p;x|_V-wFzs0MFNAT LtDnm{r-UW|b-L2K literal 0 HcmV?d00001 diff --git a/themes.src/silver/listbox.png b/themes.src/silver/listbox.png new file mode 100644 index 0000000000000000000000000000000000000000..bac308abd1beed5950f2a9b2ed717a5dba80abf7 GIT binary patch literal 16969 zcmeI3dsq`!7QhEk-k~74ReTU4Xln_1Kp+{C2qY9iPy{OAlVLJIN=QNyAlL;F6{Op> zRD4vVQnV_iqC$OCEE=WtEw#0Z3RcBdw1{Y>QUPTr36Ln)C5j~o0H|-YZ%mOyA(Ky)DQl~i#GIOtzSx4+RNB!YZQav8;argG1lyLe+w-BHwQSjMrdPkUCV6cG%J-LNEwPJ?x#fQ$ z7+N)!Tf>O8PruUsMdb-Zl;x%p(k6Yfd>kY)Bu6HuIX(-GF}s`EdU*S0jnq6oD4L$cvoMNrFB3n1fX z$d+sG@a?z*@n*;BT_%4=`Z<*28+;_F*;zWN@x+WL&wHJIx*hZ6*5jnGRbh_d^Dn=* z%gpM~>T|1O15-{Gep4!Rt#*I1*=@bs^r~<$btD$@x>xh@jh^6hbarp&z1 zF#Ce~bC(B)kM*s7X<=SrR&23%;?EO0+is8Da%78N{(XU0fpo_AP*%NNVqMX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U#$C2odVWBSy!=VIVLIqO++8BSAz(Anyb!n*qU84$SoS zq9^#U>2zP+S{iC@7+JsTf$06NwNquni4b~uQ#m3Iiz;Gzv#A_!D3R*pmB{j8ihLLe z2t450$b6XVc?vOF@F9s&p8=ZxPKXiQ3=1_|tj%o}2D~;KQApa*Rzq%erCAOsl!&(Q z@F)Y7XRwx|T?a3&u7H6MtS#z%SX&nm5tlZk)i5lqnRs{tUk!oYzmfUqF*1`8DPCRC zyVCU<-HB3`sLF&CNI(+0XI`b`>Aem$!@3`NU!aV1yH6ti6Nykl8GkMfueOi=gEWj* zn*V=k&;r*-hm#>`5+dT$1{Ux@!>eUZpU-zgL>F7mcX#e|7jn!DwIDAuMHP+N%`Hobq;xqfBVVaGsv_}X1do2n* z(KnM)TTd7qG?dN=s~OQUZd6MnO~0i+Sw<&PT{+aZ zqUT-os7)I@YY(fGgLUk$d@xMuuk?!XMFhbB!50Z!_j3g#m&u61edBV6+4-3=n*gz=h8Tqa|=*fZ&S+E_^;1ErAOI1Yaa@;q$?0 z30xQ;_#%M|pASY$;KBgG7YSVWd@x!97X}EvNZ`WfgV7SWFhKA{0vA3XjF!NK0fH|Q zxbXR4v;-~;5PXrqh0h10C2(PY;EMz003s&LP5p zX!VVUjn(t({q6I=zx6>1g;|{tNpV`}9+B(kZ@2LyFo-cd&BjyXs@m@seJ5LX&-&6& z*}IQiZ0l*Av;GB>G*6sd+88QpbvunX^TC{6pR+I9pQkmZcWo9YXLs*ATz2!0DrEg8 z6G>(5vRu`(_%W8i7{C-T$p!oYGGGt<)#5O(@&c0&o-Pcjd}3SK(>=@VC2;BDuF5bI z*?%FnVOFMe)8Vts^|OvIZQR$^zT5e`PeJs4_*51z^JZ`A`nz{jXPG3b1-&7qYtCc8 xv(;^=PYyy_4SznmOBnRe)hFes{K?tBxtU1Z(w}hzW@csDT)99 literal 0 HcmV?d00001 diff --git a/themes.src/silver/posbutton-small.png b/themes.src/silver/posbutton-small.png new file mode 100644 index 0000000000000000000000000000000000000000..e25a3424f4fb43af71e3af050c1aa5aa01726ab9 GIT binary patch literal 793 zcmeAS@N?(olHy`uVBq!ia0vp^2Y}dtgAGXf{XE)7O>#86&HplFSN)h^Y(=Ov^l7978H@y}h~LTRKtZ_(y*| zLD4fa8(O|tiB50wel6MF)a=au^3es?|IImzwghi4`y`%sPOtRkgG==e93=q@gEJhR zma42|nRLTJ?}e)DtSK!nFaOxQzpi#adS3Os?@xV{cJF?FT{YM1lj*IUOa881TP~lv zVDDc3*OSUrD!<1BP5E-{%2#YMyMkn)UPg_3Ovp?N`>k zZ2d=FeST^2=jsPd@6Jr$DfgZ4|D{XZzP`SHrCk>HO*+{k_oKwXaas8f?WtYw-o0aM zyE}8^Z~52%AAj1kVD;+xQ88b(ZusD{F~Y~}h3!vU{k0`lOKbk^{`51S>u|w~;Dae= z(}EoZPL#$TeO&0OB>4Ec&6eHUw{Ji7bl-~?FCtnG@!vdFD0B9#?bTDKyesc1zrJ?= zWl6~T>!EtnujZJ&mE0?ES}3dj7yV9Y-!cU?OJlboFyt=akR{0G0pF literal 0 HcmV?d00001 diff --git a/themes.src/silver/posbutton.png b/themes.src/silver/posbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..0e4fcfd49edf41808a9f85f11296e7385b45dc9b GIT binary patch literal 1075 zcmeAS@N?(olHy`uVBq!ia0vp^2Y}dtgAGXf{XE)7O>#86&Hpvf-B}rVAMum=AcmIEGZ*dV9-0Lpq${_{aNm z|DSkq-;zmu`3w_IMLoX>uTly+dAPPTi|b2r%UNf9o24tcIMQ1zIb)knl=BKN+Y%v- zb&I!n&JhWA;T2n6e@(IGx}w<;MUOJGy}#?y_C74H+F$<$bd9rI=lfsTU z=byV!#Rju~=RKUFn_Ix`9l*XERY9$$TI#c6B5ppO+fFP=5((>9&`OkeAwIw8euKoY=a#dLwleT-DDoc50Fs$?s{}+?@Go@9!Lft_9|I4ZM_4V<8 z>*`<3J<#%J{@&+r-|f48?3l1^{lD2Z=YwyYIajxI>QwoX-`~n-&6vRv`!8<&@~XY- z+!ia||K5Af%I?L6;FTevtN((W|MClO#tvZ{q;~dgTj>P1^xWHPoKW8J$a|(D%}g6b^F(g>z6t0WVNzdym$EsoM8nyt|va zG)Ua(=ke>W|E~;Mx$0(4o6-L(SEejmzTEjEOHRzC#^;sG@3G$5ZT{zX-{a7a2O6>q z9{fJIvYhehr}ya=GHh&5zx(gyo-uQ#<>iMrT7Y4FcJAEp=W-Ei|7m*m^Uh$HeK+s> zoo1`KeTF~#H@6t=*IgN*mk+dQUgrAOmGiWwuG+Tk--IQL7=;(S*yX$R_T0&#wJ%QH z&nv%@vke&GtFC6veYte{``=kxql#j$cl;5X@BG=aWQBb@-{Zx$4<73ZI50ABF$6F) qFfoWQEMQ<@Wzb-tozQ{wKm5-hgw-|rm`wy`Zw60SKbLh*2~7Z1Ve35r literal 0 HcmV?d00001 diff --git a/themes.src/silver/scrollbar-small.png b/themes.src/silver/scrollbar-small.png new file mode 100644 index 0000000000000000000000000000000000000000..1a131d7db79edf73a9f75a910b6b3eadb3b428d5 GIT binary patch literal 3606 zcmcJSc~DbH9>*Vpf{G$h6qQQ@h;l_iK>@)dPB;cKA|i4d)F>k1kTZecI%wn^L=L&4 z#)vFO2IUG6g0molAQ6#40l6IRBZM=7m%MFuYxj?>ohsL=t^8iSdfmTz-JSma`tyDF zezeDJ+OTT_1VNjut*{OdBvl74Xq^mb(R}-?5!_@5wm2+=to|Nx@=`#{dVi}6K@cRj zb@h^hGP8GpM%kOzcBf^BrPj(D9WFj7`xLy9VU0cE7}hn_V@FCMR@Dib6Zf#>a~>IQ zQ;bO5y|H~aI{6uj0;N5VD>l7db=3WrYr2{dn(JYK-u~z%X@K<~8@t)YrY+iqQhlwIsTVEZ;;|PgF;+NT> zW)!OJi1CAgV`0+`eQj;1Q>RX~y??*OwcPg}?PKo1g5}bnr;AJM*w`42c2%W$R;2Ed zgEXgO8Yd@x+h4sdd9{&6T^WZrZ`yPkhimM*MI5HOrty$*7>~y{zJK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K1c|k7G-mEo6x*$JelIW)eDt8DGLrmrVN}Is$v}nZf1;8k zX+wEGRXe>|%=J9Q@d!mrg+@dD@(Q7NX!`3g^B>y#8p-`x&c9*$Vu%XqCC8Tj?*Dim Qe8EB1r|q%DC%yjicSxUmJOBUy literal 0 HcmV?d00001 diff --git a/themes.src/silver/scrollbar.png b/themes.src/silver/scrollbar.png new file mode 100644 index 0000000000000000000000000000000000000000..2ae482eedefdf490bec619d03ea2b0f6f1f832c3 GIT binary patch literal 4282 zcmchbc~BGiw#UPwC?Y{oS%q;#1VqOT0YQW8AiE$tK~Y&lWQh>AIJgZ;Kw&_UCF}tr zL`4?a0;41s*<{TiLPjII5RrsHhfcp{y!Gy_TX*LDW4&~r>R+GkUsvbU`JK=AbdrOe z#a2m0NdyA1)ymS;34su4g$=Q3BkWP@E@i-njTg^am?EI{Ex(zZ4tq9VwRDd_AhyV^ zn+W1@jy&v?h_tdblb96QAbm_BXC~MJfsnDVGCkuQ{ce8D-d@R-MPCe-l21ORDZbBz zqV~zo>{$WQ{dJn7?%0(Z&YHo4W^WR0^UO*bQ$K1S>kO%|*0$WW?WaB2P1h^FTK4?t zoMP+f`9oll__i|0S3WH()-k)$);J`+o2}1E-BEr!ubuNn2_2DwOx`K}^Yf7qr~am5 zcdJ)1br`F&X}gpen&qAG5gga8pB9uU!sZ!DiRUr7h6Z6Qe_`gst2>Me=wti6lB}$( zP^<_*66!WUwpYAq3Gpw;WdDQd9RVRBHhlryTrtDmf!Wy#FXj-%m712qeiFHw%__U> z9$bq#uj9m!o=`;1vz|3(_ zwGc3vhfIImmI)A%tuHSf9a(IB_UwpGtyII9m-eo?Xa_$VjoDNNdpA;1Sy}2VSWWa< zuw*~Z+F}B7`k;a`T3_exK(AvL%2+E1!;#sZD1UzoK8HnM+qw03$aJ-JoR3OKGA(@h z5oF}%Yw}c;l>>r<54_;f#v%ANW>1e@XNIpEL6~Jz`tmpYl(oha9u|X{`Qwk)UjgE< zpb8t4M~*v9z4%On#qZ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y+-gurQL4kbq-IA3SyH6gb?Q2rv6mG8ul^ z0*C0iZXZ|@?2s&=La&o#8GwrMj_Y|-nxtOUmY%64i}9Ve!rkAGQWh5%Uoq!%q@`q8 ze3x=(X|$`>&eayI={(FaSb<>UPGwjJ1_Wqud9D-}Oh`!6B9BPi>OvWM%VaT`=nRjBqT6#_;3w`Mf{c#QfCvWmtnnBWUF7r?IEL_`rw8$eA=iAV8v# zQc|!8Q91{`d2`pNB@Vv=z)GpiJD+K9s%xL{+jYeIkr8}wwcI_k`OlwkCK$tiy(iaz zPiOY#8jxX`2LP$>zJ`P*J&}3x%3L1ggXwnHPV-WfnZNNLAS_tV`14 zUNm2?kIY4mF+Oj<)##o_H!v)|fzUgju9XFtI6#gdVX{l1NC2%aO_}o{7D_@o3^c!I z>EYq+Js<7s*X6Wn(zo1)8f92^M12R3v#@aO+h_pd(%QgvcGp)?CMG5(y)m5`tgm0g zBPdt*h(|niD0gq)P^&+j2hSHnATcKPpxc{HUQplS77t4#&57L|N z|C8fmr$t6WmfKy?@jA*xa|6XGd>#yy#(BM-jzd(`qwH*h;osZa&Gb|Ja1kKuy};$4 ztjA^lJL|n!kZQuphpTG+Bh61af|%vc?iv78lzRH)@b9ojz7`L;5EYbNCJRf9X5O`_^E&8c^~r)e55x z4~^EE3_x&WSL0#Z!l|qIN*M}*3lSI9;6p7QdG-vhrm&cpVW<*vGPtxcLy;8rug^z5 zuQS@4sS~ " to have them non zoomable +# +# This theme has the scalable standard look +# +################################################ +# +# Button have 3 rows with left middle right images for one state +# +# If only top row is there, button will be centered vertically in area if the size does not match. +# If all nine are there, you can set any size in themes.tab +# +-- +Obj=menu +name=Button +# normal +Image[0]=> button.0.0 +Image[1]=> button.0.2 +Image[2]=> button.0.1 +Image[3]=> button.0.3 +Image[4]=> button.0.5 +Image[5]=> button.0.4 +Image[6]=> button.0.6 +Image[7]=> button.0.8 +Image[8]=> button.0.7 +# pressed +Image[9]=> button.1.0 +Image[10]=> button.1.2 +Image[11]=> button.1.1 +Image[12]=> button.1.3 +Image[13]=> button.1.5 +Image[14]=> button.1.4 +Image[15]=> button.1.6 +Image[16]=> button.1.8 +Image[17]=> button.1.7 +# disabled (will use the unpressed color mask) +Image[18]=> button.2.0 +Image[19]=> button.2.2 +Image[20]=> button.2.1 +Image[21]=> button.2.3 +Image[22]=> button.2.5 +Image[23]=> button.2.4 +Image[24]=> button.2.6 +Image[25]=> button.2.8 +Image[26]=> button.2.7 +# color mask (will be blended, so it is a good idea to have a bright color for the foreground in this area) +Image[27]=> button.3.0 +Image[28]=> button.3.2 +Image[29]=> button.3.1 +Image[30]=> button.3.3 +Image[31]=> button.3.5 +Image[32]=> button.3.4 +Image[33]=> button.3.6 +Image[34]=> button.3.8 +Image[35]=> button.3.7 +# If the position of the colored area is different for a pressed button (i.e. protruding knobs) +# then here can come another nine mask images +-- +Obj=menu +name=Roundbutton +# normal +Image[0]=> button.0.0 +Image[1]=> button.0.2 +Image[2]=> button.0.1 +Image[3]=> button.0.3 +Image[4]=> button.0.5 +Image[5]=> button.0.4 +Image[6]=> button.0.6 +Image[7]=> button.0.8 +Image[8]=> button.0.7 +# pressed +Image[9]=> button.1.0 +Image[10]=> button.1.2 +Image[11]=> button.1.1 +Image[12]=> button.1.3 +Image[13]=> button.1.5 +Image[14]=> button.1.4 +Image[15]=> button.1.6 +Image[16]=> button.1.8 +Image[17]=> button.1.7 +# disabled +Image[18]=> button.2.0 +Image[19]=> button.2.2 +Image[20]=> button.2.1 +Image[21]=> button.2.3 +Image[22]=> button.2.5 +Image[23]=> button.2.4 +Image[24]=> button.2.6 +Image[25]=> button.2.8 +Image[26]=> button.2.7 +-- +Obj=menu +name=Editfield +#should be either scalable or at least LINESPACE+2px high +Image[0]=> editfield.0.0 +Image[1]=> editfield.0.1 +Image[2]=> editfield.0.2 +Image[3]=> editfield.1.0 +Image[4]=> editfield.1.1 +Image[5]=> editfield.1.2 +Image[6]=> editfield.2.0 +Image[7]=> editfield.2.1 +Image[8]=> editfield.2.2 +-- +Obj=menu +name=Listbox +#Must be scalable! +Image[0]=> listbox.0.0 +Image[1]=> listbox.0.1 +Image[2]=> listbox.0.2 +Image[3]=> listbox.1.0 +Image[4]=> listbox.1.1 +Image[5]=> listbox.1.2 +Image[6]=> listbox.2.0 +Image[7]=> listbox.2.1 +Image[8]=> listbox.2.2 +-- +# window background +Obj=menu +name=Back +Image[0]=> back.0.0 +Image[1]=> back.0.1 +Image[2]=> back.0.2 +Image[3]=> back.1.0 +Image[4]=> back.1.1 +Image[5]=> back.1.2 +Image[6]=> back.2.0 +Image[7]=> back.2.1 +Image[8]=> back.2.2 +-- +################################################################# +# +# The following control only have one (or three) images, and are not stretchable +# +Obj=menu +name=Checkbutton +# normal +Image[0]=> checkbutton.0.0 +# pressed +Image[1]=> checkbutton.0.1 +# disabled +Image[2]=> checkbutton.0.2 +-- +Obj=menu +name=Posbutton +# normal +Image[0]=> posbutton.0.0 +# pressed +Image[1]=> posbutton.0.1 +# disabled +Image[2]=> posbutton.0.2 +-- +Obj=menu +name=Scrollbar +# normal/pressed/disabled left button +Image[0]=> scrollbar.0.0 +Image[1]=> scrollbar.0.1 +Image[2]=> scrollbar.0.2 +# normal/pressed/disabled right button +Image[3]=> scrollbar.0.3 +Image[4]=> scrollbar.0.4 +Image[5]=> scrollbar.0.5 +# left/center/right scrollbar background +Image[6]=- +Image[7]=> scrollbar.1.6 +Image[8]=- +# left/center/right scrollbar knob +Image[9]=> scrollbar.1.0 +Image[10]=> scrollbar.1.2 +Image[11]=> scrollbar.1.1 +# normal/pressed/disabled up button +Image[12]=> scrollbar.2.0 +Image[13]=> scrollbar.2.1 +Image[14]=> scrollbar.2.2 +# normal/pressed/disabled down button +Image[15]=> scrollbar.2.3 +Image[16]=> scrollbar.2.4 +Image[17]=> scrollbar.2.5 +# up/center/down scrollbar background +Image[18]=- +Image[19]=> scrollbar.3.6 +Image[20]=- +# up/center/down scrollbar knob +Image[21]=> scrollbar.3.0 +Image[22]=> scrollbar.3.2 +Image[23]=> scrollbar.3.1 +-- +# window symbols +Obj=menu +name=Gadget +# close +Image[0]=> gadget.0.0 +# help +Image[1]=> gadget.0.1 +# minimize +Image[2]=> gadget.0.2 +# previous +Image[3]=> gadget.0.3 +# next +Image[4]=> gadget.0.4 +# unsticky +Image[5]=> gadget.0.5 +# sticky +Image[6]=> gadget.0.6 +# resize corner +Image[7]=> gadget.0.7 +# goto pos +Image[8]=> gadget.0.8 +-- +# divider line +Obj=menu +name=Divider +Image[0]=- +Image[1]=> divider.0.0 +Image[2]=- +-- diff --git a/themes.src/silver/standard.dat b/themes.src/silver/standard.dat new file mode 100644 index 0000000000..8f34e4dabb --- /dev/null +++ b/themes.src/silver/standard.dat @@ -0,0 +1,310 @@ +# +# Simutrans window skin definitions for themes +# +# All image names must start with "> " to have them non zoomable +# +# This theme has the scalable standard look +# +################################################ +# +# Button have 3 rows with left middle right images for one state +# +# If only top row is there, button will be centered vertically in area if the size does not match. +# If all nine are there, you can set any size in themes.tab +# +-- +Obj=menu +name=Button +# normal +Image[0]=> button.0.0 +Image[1]=> button.0.2 +Image[2]=> button.0.1 +Image[3]=> button.0.3 +Image[4]=> button.0.5 +Image[5]=> button.0.4 +Image[6]=> button.0.6 +Image[7]=> button.0.8 +Image[8]=> button.0.7 +# pressed +Image[9]=> button.1.0 +Image[10]=> button.1.2 +Image[11]=> button.1.1 +Image[12]=> button.1.3 +Image[13]=> button.1.5 +Image[14]=> button.1.4 +Image[15]=> button.1.6 +Image[16]=> button.1.8 +Image[17]=> button.1.7 +# disabled (will use the unpressed color mask) +Image[18]=> button.2.0 +Image[19]=> button.2.2 +Image[20]=> button.2.1 +Image[21]=> button.2.3 +Image[22]=> button.2.5 +Image[23]=> button.2.4 +Image[24]=> button.2.6 +Image[25]=> button.2.8 +Image[26]=> button.2.7 +# color mask (will be blended, so it is a good idea to have a bright color for the foreground in this area) +Image[27]=> button.3.0 +Image[28]=> button.3.2 +Image[29]=> button.3.1 +Image[30]=> button.3.3 +Image[31]=> button.3.5 +Image[32]=> button.3.4 +Image[33]=> button.3.6 +Image[34]=> button.3.8 +Image[35]=> button.3.7 +# If the position of the colored area is different for a pressed button (i.e. protruding knobs) +# then here can come another nine mask images +-- +Obj=menu +name=Roundbutton +# normal +Image[0]=> button.0.0 +Image[1]=> button.0.2 +Image[2]=> button.0.1 +Image[3]=> button.0.3 +Image[4]=> button.0.5 +Image[5]=> button.0.4 +Image[6]=> button.0.6 +Image[7]=> button.0.8 +Image[8]=> button.0.7 +# pressed +Image[9]=> button.1.0 +Image[10]=> button.1.2 +Image[11]=> button.1.1 +Image[12]=> button.1.3 +Image[13]=> button.1.5 +Image[14]=> button.1.4 +Image[15]=> button.1.6 +Image[16]=> button.1.8 +Image[17]=> button.1.7 +# disabled +Image[18]=> button.2.0 +Image[19]=> button.2.2 +Image[20]=> button.2.1 +Image[21]=> button.2.3 +Image[22]=> button.2.5 +Image[23]=> button.2.4 +Image[24]=> button.2.6 +Image[25]=> button.2.8 +Image[26]=> button.2.7 +-- +Obj=menu +name=Editfield +#should be either scalable or at least LINESPACE+2px high +Image[0]=> editfield.0.0 +Image[1]=> editfield.0.1 +Image[2]=> editfield.0.2 +Image[3]=> editfield.1.0 +Image[4]=> editfield.1.1 +Image[5]=> editfield.1.2 +Image[6]=> editfield.2.0 +Image[7]=> editfield.2.1 +Image[8]=> editfield.2.2 +-- +Obj=menu +name=Listbox +#Must be scalable! +Image[0]=> listbox.0.0 +Image[1]=> listbox.0.1 +Image[2]=> listbox.0.2 +Image[3]=> listbox.1.0 +Image[4]=> listbox.1.1 +Image[5]=> listbox.1.2 +Image[6]=> listbox.2.0 +Image[7]=> listbox.2.1 +Image[8]=> listbox.2.2 +-- +# window background +Obj=menu +name=Back +Image[0]=> back.0.0 +Image[1]=> back.0.1 +Image[2]=> back.0.2 +Image[3]=> back.1.0 +Image[4]=> back.1.1 +Image[5]=> back.1.2 +Image[6]=> back.2.0 +Image[7]=> back.2.1 +Image[8]=> back.2.2 +-- +################################################################# +# +# The following control only have one (or three) images, and are not stretchable +# +Obj=menu +name=Checkbutton +# normal +Image[0]=> checkbutton-small.0.0 +# pressed +Image[1]=> checkbutton-small.0.1 +# disabled +Image[2]=> checkbutton-small.0.2 +-- +Obj=menu +name=Posbutton +# normal +Image[0]=> posbutton-small.0.0 +# pressed +Image[1]=> posbutton-small.0.1 +# disabled +Image[2]=> posbutton-small.0.2 +-- +Obj=menu +name=Scrollbar +# normal/pressed/disabled left button +Image[0]=> scrollbar-small.0.0 +Image[1]=> scrollbar-small.0.1 +Image[2]=> scrollbar-small.0.2 +# normal/pressed/disabled right button +Image[3]=> scrollbar-small.0.3 +Image[4]=> scrollbar-small.0.4 +Image[5]=> scrollbar-small.0.5 +# left/center/right scrollbar background +Image[6]=- +Image[7]=> scrollbar-small.1.6 +Image[8]=- +# left/center/right scrollbar knob +Image[9]=> scrollbar-small.1.0 +Image[10]=> scrollbar-small.1.2 +Image[11]=> scrollbar-small.1.1 +# normal/pressed/disabled up button +Image[12]=> scrollbar-small.2.0 +Image[13]=> scrollbar-small.2.1 +Image[14]=> scrollbar-small.2.2 +# normal/pressed/disabled down button +Image[15]=> scrollbar-small.2.3 +Image[16]=> scrollbar-small.2.4 +Image[17]=> scrollbar-small.2.5 +# up/center/down scrollbar background +Image[18]=- +Image[19]=> scrollbar-small.3.6 +Image[20]=- +# up/center/down scrollbar knob +Image[21]=> scrollbar-small.3.0 +Image[22]=> scrollbar-small.3.2 +Image[23]=> scrollbar-small.3.1 +-- +# window symbols +Obj=menu +name=Gadget +# close +Image[0]=> gadget.0.0 +# help +Image[1]=> gadget.0.1 +# minimize +Image[2]=> gadget.0.2 +# previous +Image[3]=> gadget.0.3 +# next +Image[4]=> gadget.0.4 +# unsticky +Image[5]=> gadget.0.5 +# sticky +Image[6]=> gadget.0.6 +# resize corner +Image[7]=> gadget.0.7 +# goto pos +Image[8]=> gadget.0.8 +# unlocked +Image[9]=> gadget.0.9 +# locked +Image[10]=> gadget.0.10 +-- +# divider line +Obj=menu +name=Divider +Image[0]=- +Image[1]=> divider.0.0 +Image[2]=- +-- +################################################################# +Obj=menu +name=Alerts +copyright=Ranran +Image[0]=> ../symbols.0.0 +Image[1]=> ../symbols.0.1 +Image[2]=> ../symbols.0.2 +Image[3]=> ../symbols.0.3 +Image[4]=> ../symbols.0.4 +-- +Obj=menu +name=WaitingTime +copyright=Ranran +# for average waiting time at the stop +Image[0]=> ../symbols.2.0 +------- +Obj=menu +name=TravelTime +copyright=Ranran +# for display the average travering time to the distination +Image[0]=> ../symbols.2.1 +------- +Obj=menu +name=ServiceFrequency +copyright=Ranran +# for display the line service frequency +Image[0]=> ../symbols.2.2 +------- +Obj=menu +name=MissingScheduledSlot +copyright=Ranran +# for line missing scheduled slot +Image[0]=> ../symbols.2.3 +------- +Obj=menu +name=OnFoot +copyright=Ranran +Image[0]=> ../symbols.2.4 +------- +Obj=menu +name=Comfort +copyright=Ranran +Image[0]=> ../symbols.6.0 +------- +Obj=menu +name=Comfort +copyright=Ranran +Image[0]=> ../symbols.6.0 +------- +Obj=menu +name=Upgradable +copyright=Ranran +# for vehicle which has upgrade target +Image[0]=> ../symbols.0.5 +Image[1]=> ../symbols.0.6 +------- +Obj=menu +name=ReverseArrows +copyright=Ranran +# arrows representing the reverse order of the schedule +Image[0]=> ../symbols.2.5 +Image[1]=> ../symbols.2.6 +------- +Obj=menu +name=InputOutput +copyright=Ranran +# for industry input/output +Image[0]=> ../symbols.4.0 +Image[1]=> ../symbols.4.1 +------- +Obj=menu +name=InTransit +copyright=Ranran +# for goods in transit for industry information +Image[0]=> ../symbols.4.2 +------- +################################################################# +------- +Obj=menu +name=Search +copyright=Ranran +Image[0]=> ../symbols.6.1 +------- +Obj=menu +name=OpenWindow +copyright=Ranran +Image[0]=> ../button-../symbols.0.0 +------- diff --git a/themes.src/silver/symbols.png b/themes.src/silver/symbols.png new file mode 100644 index 0000000000000000000000000000000000000000..60c84b8066c1d525ead94fcdea370635759e37c1 GIT binary patch literal 7707 zcmeH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yuNtJ7Mot{q$Ve38E;@btd|I_6B8 literal 0 HcmV?d00001 From 799ba8d7fedf0cb68c0041c145c0b171e25e9c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 12 Jul 2024 06:30:24 +0900 Subject: [PATCH 03/32] CHG: Adjusting the layout when there is no cargo on the vehicle --- gui/components/gui_vehicle_cargoinfo.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/components/gui_vehicle_cargoinfo.cc b/gui/components/gui_vehicle_cargoinfo.cc index 3228955919..4a7009f8c6 100644 --- a/gui/components/gui_vehicle_cargoinfo.cc +++ b/gui/components/gui_vehicle_cargoinfo.cc @@ -268,7 +268,7 @@ void gui_vehicle_cargo_info_t::update() if (!total_cargo) { // no cargo => empty new_component("leer", SYSCOL_TEXT_WEAK, gui_label_t::left); - new_component(); + new_component(); } else { add_table(2,0)->set_spacing(scr_size(0,1)); @@ -788,6 +788,7 @@ void gui_cargo_info_t::init(uint8 info_depth_from, uint8 info_depth_to, bool div else { new_component(LINEASCENT); new_component("leer", SYSCOL_TEXT_WEAK); + new_component(); } set_size(get_min_size()); } From 2777c7c9438bbe9d33fd44eb1218f88bce4c2562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Wed, 17 Jul 2024 05:27:59 +0900 Subject: [PATCH 04/32] FIX: Image buttons can sometimes be too small for the font --- gui/components/gui_button.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gui/components/gui_button.cc b/gui/components/gui_button.cc index 144d1d585c..7abce0f8fb 100644 --- a/gui/components/gui_button.cc +++ b/gui/components/gui_button.cc @@ -121,6 +121,7 @@ void button_t::set_typ(enum type t) break; case imagebox: + set_size( scr_size(max(get_size().w,LINESPACE), max(get_size().w,LINESPACE)) ); img = IMG_EMPTY; break; @@ -218,10 +219,7 @@ scr_size button_t::get_min_size() const case imagebox: { scr_coord_val x = 0, y = 0, w = 0, h = 0; display_get_image_offset(img, &x, &y, &w, &h); - scr_size size(gui_theme_t::gui_pos_button_size); - size.w = max(size.w, w+4); - size.h = max(size.h, h+4); - return size; + return scr_size(max(get_size().w, w + 4), max(get_size().h, h + 4)); } case sortarrow: From 07a6ecc3b3f37ff5b5dde073788f6bdd26fe9de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Wed, 17 Jul 2024 05:28:56 +0900 Subject: [PATCH 05/32] FIX: The width of the combo box is determined ambiguously, so it may be too narrow. --- gui/components/gui_combobox.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/components/gui_combobox.cc b/gui/components/gui_combobox.cc index 6474bcf200..6cb6e35720 100644 --- a/gui/components/gui_combobox.cc +++ b/gui/components/gui_combobox.cc @@ -411,7 +411,7 @@ scr_size gui_combobox_t::get_min_size() const return scr_size(bl.w + ti.w + br.w + D_H_SPACE, max(max(bl.h, ti.h), br.h)); } else { - return scr_size(bl.w + br.w + sl.w - D_H_SPACE, max(max(bl.h, ti.h), br.h)); + return scr_size(bl.w + br.w + sl.w + D_H_SPACE*2 + D_SCROLLBAR_WIDTH, max(max(bl.h, ti.h), br.h)); } } From 71fce0dfbebec73ac92d20285a477ea77094147c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Wed, 17 Jul 2024 05:30:07 +0900 Subject: [PATCH 06/32] FIX: Convoy display height not being applied correctly --- gui/components/gui_convoy_assembler.cc | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/gui/components/gui_convoy_assembler.cc b/gui/components/gui_convoy_assembler.cc index 29911f5e70..ac7f49b13d 100644 --- a/gui/components/gui_convoy_assembler.cc +++ b/gui/components/gui_convoy_assembler.cc @@ -617,16 +617,21 @@ void gui_convoy_assembler_t::init(waytype_t wt, signed char player_nr, bool elec // top left add_table(1,3)->set_margin(scr_size(D_MARGIN_LEFT,0), scr_size(0,0)); { - cont_convoi.set_table_layout(2,2); - cont_convoi.set_margin(scr_size(0,0), scr_size(get_grid(wt).x/2,0)); - cont_convoi.set_spacing(scr_size(0,0)); - cont_convoi.add_component(&convoi); - lb_makeup.init("Select vehicles to make up a convoy", scr_coord(0,0), SYSCOL_TEXT_INACTIVE, gui_label_t::centered); - cont_convoi.add_component(&lb_makeup); - cont_convoi.new_component(0,D_SCROLLBAR_HEIGHT); - convoi.set_max_rows(1); - scrollx_convoi.set_maximize(true); - add_component(&scrollx_convoi); + add_table(2,1); + { + cont_convoi.set_table_layout(2,1); + cont_convoi.set_margin(scr_size(0,0), scr_size(get_grid(wt).x/2,0)); + cont_convoi.set_spacing(scr_size(0,0)); + cont_convoi.add_component(&convoi); + lb_makeup.init("Select vehicles to make up a convoy", scr_coord(0,0), SYSCOL_TEXT_INACTIVE, gui_label_t::centered); + cont_convoi.add_component(&lb_makeup); + convoi.set_max_rows(1); + scrollx_convoi.set_maximize(true); + add_component(&scrollx_convoi); + + new_component(0, get_grid(wt).y+8); + } + end_table(); // convoy length add_table(5,1); @@ -857,7 +862,6 @@ void gui_convoy_assembler_t::init(waytype_t wt, signed char player_nr, bool elec scrolly_electrics.set_min_height(scr_min_h); scrolly_locos.set_min_height(scr_min_h); scrolly_waggons.set_min_height(scr_min_h); - scrollx_convoi.set_min_height(scr_min_h+D_SCROLLBAR_WIDTH); set_size(get_min_size()); gui_image_list_t* ilists[] = { &convoi, &pas, &pas2, &electrics, &locos, &waggons }; for (uint32 i = 0; i < lengthof(ilists); i++) { From 08ef575fb31c22a9a469468d85473e361cd057cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Wed, 17 Jul 2024 05:49:36 +0900 Subject: [PATCH 07/32] FIX: Combobox width is too narrow --- gui/convoi_info_t.cc | 8 ++++++++ gui/halt_info.cc | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/gui/convoi_info_t.cc b/gui/convoi_info_t.cc index dffbf72ccc..e348c169ba 100644 --- a/gui/convoi_info_t.cc +++ b/gui/convoi_info_t.cc @@ -341,12 +341,16 @@ void convoi_info_t::init_cargo_info_controller() cont_tab_cargo_info.add_table(2, 2)->set_spacing(scr_size(0, 0)); { cont_tab_cargo_info.new_component_span("Sort by",2); + scr_coord_val min_width=D_LABEL_WIDTH; for( uint8 i=0; i(translator::translate(sort_text[i]), SYSCOL_TEXT); } freight_sort_selector.set_selection( env_t::default_sortmode(translator::translate("Origin stop"), SYSCOL_TEXT); selector_ci_depth_from.set_selection(cargo_info_depth_from); selector_ci_depth_from.add_listener(this); + selector_ci_depth_from.set_width_fixed(true); + selector_ci_depth_from.set_width(LINESPACE<<3); cont_tab_cargo_info.add_component(&selector_ci_depth_from); cont_tab_cargo_info.new_component("info_depth_to:"); @@ -377,6 +383,8 @@ void convoi_info_t::init_cargo_info_controller() selector_ci_depth_to.new_component(translator::translate("Destination"), SYSCOL_TEXT); selector_ci_depth_to.set_selection(cargo_info_depth_to); selector_ci_depth_to.add_listener(this); + selector_ci_depth_to.set_width_fixed(true); + selector_ci_depth_to.set_width(LINESPACE<<3); cont_tab_cargo_info.add_component(&selector_ci_depth_to); } cont_tab_cargo_info.end_table(); diff --git a/gui/halt_info.cc b/gui/halt_info.cc index a6476a9c33..f12c1b450e 100644 --- a/gui/halt_info.cc +++ b/gui/halt_info.cc @@ -901,12 +901,16 @@ void halt_info_t::init_cargo_info_controller() cont_tab_cargo_info.add_table(2, 2)->set_spacing(NO_SPACING); { cont_tab_cargo_info.new_component_span("Sort by", 2); + scr_coord_val min_width = D_LABEL_WIDTH; freight_sort_selector.clear_elements(); for (uint8 i = 0; i < gui_halt_cargoinfo_t::SORT_MODES; ++i) { + min_width = max(min_width, proportional_string_width(translator::translate(sort_text[i]))); freight_sort_selector.new_component(translator::translate(sort_text[i]), SYSCOL_TEXT); } freight_sort_selector.set_selection(env_t::default_sortmode < gui_halt_cargoinfo_t::SORT_MODES ? env_t::default_sortmode : 0); freight_sort_selector.add_listener(this); + freight_sort_selector.set_width_fixed(true); + freight_sort_selector.set_width(min_width + D_SCROLLBAR_WIDTH + D_H_SPACE); cont_tab_cargo_info.add_component(&freight_sort_selector); sort_order.init(button_t::sortarrow_state, ""); @@ -927,6 +931,8 @@ void halt_info_t::init_cargo_info_controller() selector_ci_depth_from.new_component(translator::translate("Origin stop"), SYSCOL_TEXT); selector_ci_depth_from.set_selection(cargo_info_depth_from); selector_ci_depth_from.add_listener(this); + selector_ci_depth_from.set_width_fixed(true); + selector_ci_depth_from.set_width(LINESPACE << 3); cont_tab_cargo_info.add_component(&selector_ci_depth_from); cont_tab_cargo_info.new_component("info_depth_to:"); @@ -936,6 +942,8 @@ void halt_info_t::init_cargo_info_controller() selector_ci_depth_to.new_component(translator::translate("Destination"), SYSCOL_TEXT); selector_ci_depth_to.set_selection(cargo_info_depth_to); selector_ci_depth_to.add_listener(this); + selector_ci_depth_to.set_width_fixed(true); + selector_ci_depth_to.set_width(LINESPACE << 3); cont_tab_cargo_info.add_component(&selector_ci_depth_to); } cont_tab_cargo_info.end_table(); From fb5883aa5b4839498b67a26e5405d5934d56b04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Wed, 17 Jul 2024 05:56:58 +0900 Subject: [PATCH 08/32] FIX: Image buttons are unintentionally large --- gui/schedule_gui.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/schedule_gui.cc b/gui/schedule_gui.cc index 26457c32cf..885ec91606 100644 --- a/gui/schedule_gui.cc +++ b/gui/schedule_gui.cc @@ -611,17 +611,17 @@ void schedule_gui_t::init_components() line_selector.set_highlight_color(color_idx_to_rgb(player->get_player_color1() + 1)); - filter_btn_all_pas.init(button_t::roundbox_state, NULL, scr_coord(0, 0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); + filter_btn_all_pas.init(button_t::imagebox_state, NULL, scr_coord(0, 0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); filter_btn_all_pas.set_image(skinverwaltung_t::passengers->get_image_id(0)); filter_btn_all_pas.set_tooltip("filter_pas_line"); filter_btn_all_pas.add_listener(this); - filter_btn_all_mails.init(button_t::roundbox_state, NULL, scr_coord(0,0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); + filter_btn_all_mails.init(button_t::imagebox_state, NULL, scr_coord(0,0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); filter_btn_all_mails.set_image(skinverwaltung_t::mail->get_image_id(0)); filter_btn_all_mails.set_tooltip("filter_mail_line"); filter_btn_all_mails.add_listener(this); - filter_btn_all_freights.init(button_t::roundbox_state, NULL, scr_coord(0, 0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); + filter_btn_all_freights.init(button_t::imagebox_state, NULL, scr_coord(0, 0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); filter_btn_all_freights.set_image(skinverwaltung_t::goods->get_image_id(0)); filter_btn_all_freights.set_tooltip("filter_freight_line"); filter_btn_all_freights.add_listener(this); From 4eb045d0c409aea22342bec5dcb12328d00bdd14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Thu, 27 Jun 2024 23:39:30 +0900 Subject: [PATCH 09/32] FIX: broken multiple_selection --- gui/components/gui_scrolled_list.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gui/components/gui_scrolled_list.cc b/gui/components/gui_scrolled_list.cc index cd52c54c2d..30e23f8b70 100644 --- a/gui/components/gui_scrolled_list.cc +++ b/gui/components/gui_scrolled_list.cc @@ -232,8 +232,10 @@ bool gui_scrolled_list_t::infowin_event(const event_t *ev) // if different element is focused, calculate selection and call listeners if ( focus != new_focus || (new_focus && IS_LEFTRELEASE(&ev2) && new_focus->getroffen(ev2.mouse_pos)) ) { calc_selection(focus, new_focus, *ev); - const int new_selection = get_selection(); - call_listeners((long)new_selection); + if (new_focus->selected) { + const int new_selection = get_selection(); + call_listeners((long)new_selection); + } swallowed = true; } @@ -259,6 +261,10 @@ void gui_scrolled_list_t::calc_selection(scrollitem_t* old_focus, scrollitem_t* else if( multiple_selection && IS_CONTROL_PRESSED(&ev) ) { // control key is pressed. select or deselect the focused one. new_focus->selected = !new_focus->selected; + new_focus->focused = new_focus->selected; + if (!get_selections().get_count()) { + container.set_focus(NULL); + } } else if( IS_SHIFT_PRESSED(&ev) ) { // shift key is pressed. From e83925274e0ffa29bb915c5d6135a44d115e464c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 28 Jun 2024 00:00:22 +0900 Subject: [PATCH 10/32] CHG: Allow multiple selection without ctrl key --- gui/components/gui_scrolled_list.cc | 6 +++--- gui/components/gui_scrolled_list.h | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gui/components/gui_scrolled_list.cc b/gui/components/gui_scrolled_list.cc index 30e23f8b70..3a58f9cefd 100644 --- a/gui/components/gui_scrolled_list.cc +++ b/gui/components/gui_scrolled_list.cc @@ -96,7 +96,7 @@ gui_scrolled_list_t::gui_scrolled_list_t(enum type type, item_compare_func cmp) compare = cmp; size = scr_size(0,0); pos = scr_coord(0,0); - multiple_selection = false; + multiple_selection_mode = 0; maximize = false; } @@ -249,7 +249,7 @@ void gui_scrolled_list_t::calc_selection(scrollitem_t* old_focus, scrollitem_t* // do nothing. return; } - else if( !multiple_selection || ev.ev_key_mod==0 ) { + else if( multiple_selection_mode==0 || (ev.ev_key_mod==0 && multiple_selection_mode!=2) ) { // simply select new_focus for(gui_component_t* v : item_list) { scrollitem_t* item = dynamic_cast(v); @@ -258,7 +258,7 @@ void gui_scrolled_list_t::calc_selection(scrollitem_t* old_focus, scrollitem_t* } } } - else if( multiple_selection && IS_CONTROL_PRESSED(&ev) ) { + else if( multiple_selection_mode==2 || (multiple_selection_mode==1 && IS_CONTROL_PRESSED(&ev)) ) { // control key is pressed. select or deselect the focused one. new_focus->selected = !new_focus->selected; new_focus->focused = new_focus->selected; diff --git a/gui/components/gui_scrolled_list.h b/gui/components/gui_scrolled_list.h index e888bc250b..3350dc2030 100644 --- a/gui/components/gui_scrolled_list.h +++ b/gui/components/gui_scrolled_list.h @@ -115,7 +115,7 @@ class gui_scrolled_list_t : item_compare_func compare; - bool multiple_selection; // true when multiple selection is enabled. + uint8 multiple_selection_mode=0; void calc_selection(scrollitem_t*, scrollitem_t*, event_t); protected: @@ -149,7 +149,9 @@ class gui_scrolled_list_t : scrollitem_t* get_selected_item() const; sint32 get_count() const { return item_list.get_count(); } - void enable_multiple_selection() { multiple_selection = true; } + // 0: disable(single), 1: work with ctrl pressed, 2: work as default + void enable_multiple_selection() { multiple_selection_mode = 1; } // Retained for compatibility + void set_multiple_selection(uint8 mode) { multiple_selection_mode = mode; } /* when rebuilding a list, be sure to call recalculate the slider * with recalculate_slider() to update the scrollbar properly. */ From 486ace338191fd5a05dfa011e04220bacdaad3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Thu, 18 Jul 2024 20:11:36 +0900 Subject: [PATCH 11/32] CODE: overhaul of vehicle list --- Makefile | 3 + Simutrans-Extended.vcxproj | 6 + cmake/SimutransSourceList.cmake | 3 + gui/components/gui_table.cc | 45 --- gui/components/gui_table.h | 20 - gui/components/sortable_table.cc | 320 +++++++++++++++ gui/components/sortable_table.h | 183 +++++++++ gui/components/sortable_table_header.cc | 152 +++++++ gui/components/sortable_table_header.h | 74 ++++ gui/components/sortable_table_vehicle.cc | 288 ++++++++++++++ gui/components/sortable_table_vehicle.h | 127 ++++++ gui/vehiclelist_frame.cc | 480 ++++------------------- gui/vehiclelist_frame.h | 64 +-- 13 files changed, 1234 insertions(+), 531 deletions(-) create mode 100644 gui/components/sortable_table.cc create mode 100644 gui/components/sortable_table.h create mode 100644 gui/components/sortable_table_header.cc create mode 100644 gui/components/sortable_table_header.h create mode 100644 gui/components/sortable_table_vehicle.cc create mode 100644 gui/components/sortable_table_vehicle.h diff --git a/Makefile b/Makefile index aab8f0e47b..72ae214969 100644 --- a/Makefile +++ b/Makefile @@ -408,6 +408,9 @@ SOURCES += gui/components/gui_vehicle_cargoinfo.cc SOURCES += gui/components/gui_waytype_image_box.cc SOURCES += gui/components/gui_waytype_tab_panel.cc SOURCES += gui/components/gui_world_view_t.cc +SOURCES += gui/components/sortable_table.cc +SOURCES += gui/components/sortable_table_header.cc +SOURCES += gui/components/sortable_table_vehicle.cc SOURCES += gui/convoi_detail_t.cc SOURCES += gui/convoi_filter_frame.cc SOURCES += gui/convoi_frame.cc diff --git a/Simutrans-Extended.vcxproj b/Simutrans-Extended.vcxproj index 1349e3595f..d7bcc2c3dc 100644 --- a/Simutrans-Extended.vcxproj +++ b/Simutrans-Extended.vcxproj @@ -2347,6 +2347,9 @@ + + + @@ -2836,6 +2839,9 @@ + + + diff --git a/cmake/SimutransSourceList.cmake b/cmake/SimutransSourceList.cmake index 465aed632c..e04627b7f3 100644 --- a/cmake/SimutransSourceList.cmake +++ b/cmake/SimutransSourceList.cmake @@ -142,6 +142,9 @@ target_sources(simutrans-extended PRIVATE gui/components/gui_waytype_image_box.cc gui/components/gui_waytype_tab_panel.cc gui/components/gui_world_view_t.cc + gui/components/sortable_table.cc + gui/components/sortable_table_header.cc + gui/components/sortable_table_vehicle.cc gui/convoi_detail_t.cc gui/convoi_filter_frame.cc gui/convoi_frame.cc diff --git a/gui/components/gui_table.cc b/gui/components/gui_table.cc index e4c8f70799..3c9ae0256c 100644 --- a/gui/components/gui_table.cc +++ b/gui/components/gui_table.cc @@ -69,48 +69,3 @@ void gui_table_header_buf_t::draw(scr_coord offset) gui_table_cell_buf_t::draw(offset); } - - - -void table_sort_button_t::set_text(const char * text) -{ - this->text = text; - translated_text = translator::translate(text); - scr_coord_val w = translated_text ? proportional_string_width(translated_text) : 0; - w += 2 * D_H_SPACE + D_BUTTON_PADDINGS_X + 5; // padding + arrow size - set_size(scr_size(w, size.h)); -} - -void table_sort_button_t::draw(scr_coord offset) -{ - // draw table header cell - PIXVAL bgcolor = pressed ? SYSCOL_TH_BACKGROUND_SELECTED : SYSCOL_TH_BACKGROUND_TOP; - text_color = pressed ? SYSCOL_TH_TEXT_SELECTED : SYSCOL_TH_TEXT_TOP; - display_ddd_box_clip_rgb(pos.x + offset.x, pos.y + offset.y, get_size().w, get_size().h, SYSCOL_TH_BORDER, SYSCOL_TH_BORDER); - display_fillbox_wh_clip_rgb(pos.x + offset.x+1, pos.y + offset.y+1, get_size().w-2, get_size().h-2, bgcolor, true); - - // draw text - const scr_rect area(offset + pos, size); - scr_rect area_text = area - gui_theme_t::gui_button_text_offset_right; - area_text.set_pos(gui_theme_t::gui_button_text_offset + area.get_pos()-scr_coord(2,0)); - if( text ) { - display_proportional_ellipsis_rgb( area_text, translated_text, ALIGN_CENTER_H | ALIGN_CENTER_V | DT_CLIP, text_color, true ); - } - if (pressed) { - // draw an arrow - - scr_coord_val xoff_arrow_center = pos.x + offset.x + size.w - D_H_SPACE - 3; - display_fillbox_wh_clip_rgb(xoff_arrow_center, pos.y+offset.y + D_V_SPACE-1, 1, size.h - D_V_SPACE*2+2, SYSCOL_TH_TEXT_SELECTED, false); - if (reversed) { - // asc - display_fillbox_wh_clip_rgb(xoff_arrow_center-1, pos.y+offset.y + D_V_SPACE, 3, 1, SYSCOL_TH_TEXT_SELECTED, false); - display_fillbox_wh_clip_rgb(xoff_arrow_center-2, pos.y+offset.y + D_V_SPACE+1, 5, 1, SYSCOL_TH_TEXT_SELECTED, false); - } - else { - // desc - display_fillbox_wh_clip_rgb(xoff_arrow_center-1, pos.y+offset.y + size.h - D_V_SPACE - 1, 3, 1, SYSCOL_TH_TEXT_SELECTED, false); - display_fillbox_wh_clip_rgb(xoff_arrow_center-2, pos.y+offset.y + size.h - D_V_SPACE - 2, 5, 1, SYSCOL_TH_TEXT_SELECTED, false); - } - - } -} diff --git a/gui/components/gui_table.h b/gui/components/gui_table.h index 08bb7e8af3..2b45a48aed 100644 --- a/gui/components/gui_table.h +++ b/gui/components/gui_table.h @@ -108,24 +108,4 @@ class gui_table_header_buf_t: public gui_table_cell_buf_t }; -class table_sort_button_t : public button_t { - bool reversed = false; - -public: - table_sort_button_t() { - init(button_t::roundbox_middle_state, ""); - } - - void set_reverse(bool yesno = false) { reversed=yesno; } - - // set text and set size (including sort arrow space) - void set_text(const char * text) OVERRIDE; - - void draw(scr_coord offset) OVERRIDE; - - scr_size get_min_size() const OVERRIDE { return size; } - scr_size get_max_size() const OVERRIDE { return get_min_size(); } -}; - - #endif diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc new file mode 100644 index 0000000000..e02a9ecefa --- /dev/null +++ b/gui/components/sortable_table.cc @@ -0,0 +1,320 @@ +/* + * This file is part of the Simutrans-Extended project under the Artistic License. + * (see LICENSE.txt) + */ + +/* + * Vehicle info including availability + */ + +#include "sortable_table.h" + +#include "../../simworld.h" +#include "../../simcolor.h" +#include "../../display/simgraph.h" + +#include "../../dataobj/translator.h" + +#include "../../utils/simstring.h" + +#include "../../descriptor/intro_dates.h" + +scr_coord_val table_cell_item_t::check_height(scr_coord_val new_height) +{ + size.h = max(new_height, size.h); + draw_offset.y = (size.h - min_size.h) / 2; + return size.h; +} + +void table_cell_item_t::set_size(scr_size new_size) +{ + set_width(new_size.w); + check_height(new_size.h); +} + +void table_cell_item_t::set_width(scr_coord_val new_width) +{ + size.w = new_width + L_CELL_PADDING*2; + switch (align) { + case centered: + draw_offset.x=(size.w-min_size.w)/2; + break; + case right: + draw_offset.x = size.w - min_size.w - L_CELL_PADDING; + break; + case left: + default: + draw_offset.x = L_CELL_PADDING; + break; + } +} + +void table_cell_item_t::draw(scr_coord offset) +{ + offset+=pos; + if (highlight) { // for filter + display_fillbox_wh_clip_rgb(offset.x, offset.y, size.w, size.h, SYSCOL_TD_BACKGROUND_HIGHLIGHT, false); + } + // draw border + display_ddd_box_clip_rgb(offset.x-1, offset.y-1, size.w+1, size.h+1, SYSCOL_TD_BORDER, SYSCOL_TD_BORDER); +} + + + +text_cell_t::text_cell_t(const char* text_, PIXVAL col, align_t align_) +{ + text= text_; + color= col; + align=align_; + min_size = scr_size(proportional_string_width(translator::translate(text)), LINESPACE); + set_size(min_size); +} + +void text_cell_t::draw(scr_coord offset) +{ + table_cell_item_t::draw(offset); + + offset+=pos; + display_proportional_clip_rgb(offset.x+ draw_offset.x, offset.y+ draw_offset.y, translator::translate(text), ALIGN_LEFT, color, false); +} + +value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix, align_t align_, PIXVAL col) +{ + color = col; + align = align_; + value=value_; + + switch(suffix) + { + case gui_chart_t::MONEY: + buf.append_money(value/100.0); + break; + case gui_chart_t::PERCENT: + buf.append(value / 100.0, 2); + buf.append("%"); + //color = value >= 0 ? (value > 0 ? MONEY_PLUS : SYSCOL_TEXT_UNUSED) : MONEY_MINUS; + break; + case gui_chart_t::KMPH: + buf.append(value); + buf.append(" km/h"); + break; + case gui_chart_t::KW: + if (value==0) { + buf.append("-"); + align = centered; + color = COL_INACTIVE; + } + else { + buf.append(value); + buf.append(" kW"); + } + break; + case gui_chart_t::TONNEN: + if (value == 0) { + buf.append("-"); + align = centered; + color = COL_INACTIVE; + } + else { + buf.printf("%.1ft", (float)value/1000.0); + } + break; + case gui_chart_t::TIME: // as date + if (value == DEFAULT_RETIRE_DATE*12) { + // empty cell + ////buf.append("-"); + ////color = COL_INACTIVE; + } + else { + buf.append(translator::get_short_date((uint16)value / 12, (uint16)value % 12)); + } + break; + case gui_chart_t::FORCE: + if (value == 0) { + buf.append("-"); + align = centered; + color = COL_INACTIVE; + } + else { + buf.append(value); + buf.append(" kN"); + } + break; + case gui_chart_t::DISTANCE: // currentry not used + case gui_chart_t::STANDARD: + default: + buf.append(value); + break; + } + min_size = scr_size(proportional_string_width(buf), LINESPACE); + set_size(min_size); +} + +void value_cell_t::draw(scr_coord offset) +{ + table_cell_item_t::draw(offset); + + offset += pos; + display_proportional_clip_rgb(offset.x + draw_offset.x, offset.y + draw_offset.y, translator::translate(buf), ALIGN_LEFT, color, false); +} + + +values_cell_t::values_cell_t(sint64 value_, sint64 sub_value_, PIXVAL col) + : value_cell_t(value_) +{ + buf.clear(); + sub_buf.clear(); + + color = col; + min_size.h = LINESPACE; + align = centered; + + sub_value=sub_value_; + + bool two_lines = false; + + if (value==0 && sub_value==0) { + buf.append("-"); + color = SYSCOL_TEXT_WEAK; + } + if (value != 0) { + buf.printf("%i", value); + } + if (sub_value != 0) { + if (value != 0) { + // display two lines + sub_buf.printf("(%i)", sub_value); + min_size.h += LINESPACE; + two_lines = true; + } + else { + buf.printf("(%i)", sub_value); + } + } + if (two_lines) { + sub_draw_offset_x = proportional_string_width(sub_buf) / 2; + min_size.w = max(proportional_string_width(buf), sub_draw_offset_x * 2 + 1); + } + else { + min_size.w = proportional_string_width(buf); + } + set_size(min_size); +} + +void values_cell_t::set_width(scr_coord_val new_width) +{ + const scr_coord_val row1_width = proportional_string_width(buf); + + size.w = new_width + L_CELL_PADDING * 2; + draw_offset.x = (size.w - row1_width) / 2; +} + +void values_cell_t::draw(scr_coord offset) +{ + table_cell_item_t::draw(offset); + + offset += pos; + display_proportional_clip_rgb(offset.x + draw_offset.x, offset.y + draw_offset.y, buf, ALIGN_LEFT, color, false); + display_proportional_clip_rgb(offset.x + size.w / 2 - sub_draw_offset_x, offset.y + draw_offset.y + LINESPACE, sub_buf, ALIGN_LEFT, color, false); +} + + +gui_sort_table_row_t::gui_sort_table_row_t() +{ + row_height=LINESPACE+D_V_SPACE+1; // default is minimum height of row +} + +gui_sort_table_row_t::~gui_sort_table_row_t() +{ + clear_ptr_vector(owned_cells); +} + +void gui_sort_table_row_t::add_component(gui_component_t* comp) +{ + gui_container_t::add_component(comp); + row_height = max(row_height, dynamic_cast(comp)->check_height(row_height)); + min_widths.append(comp->get_size().w); +} + +void gui_sort_table_row_t::set_highlight(sint32 i, bool highlight) +{ + if (owned_cells.get_count()<=i) return; + owned_cells[i]->set_highlight(highlight); +} + +void gui_sort_table_row_t::set_col(uint col, scr_coord_val width) +{ + assert(col < owned_cells.get_count()); + table_cell_item_t* item = owned_cells.get_element(col); + item->set_width(width); + item->set_pos(scr_coord(size.w, 0)); + size.w+= item->get_size().w; // added padding +} + +scr_coord_val gui_sort_table_row_t::get_min_width(uint col) { + assert(col < owned_cells.get_count()); + return owned_cells.get_element(col)->get_min_width(); +} + +void gui_sort_table_row_t::draw(scr_coord offset) +{ + // draw selected background + if (selected) { + display_fillbox_wh_clip_rgb(pos.x + offset.x, pos.y + offset.y, get_size().w, get_size().h, (focused ? SYSCOL_TH_BACKGROUND_SELECTED : SYSCOL_TR_BACKGROUND_SELECTED), true); + } + gui_container_t::draw(offset); +} + +sint64 gui_sort_table_row_t::compare_value(const table_cell_item_t* a, const table_cell_item_t* b) +{ + sint64 cmp = 0; + const value_cell_t* cell_a = dynamic_cast(a); + const value_cell_t* cell_b = dynamic_cast(b); + return cell_a->get_value() - cell_b->get_value(); +} + +sint64 gui_sort_table_row_t::compare_values(const table_cell_item_t* a, const table_cell_item_t* b) +{ + sint64 cmp=0; + const values_cell_t* cell_a = dynamic_cast(a); + const values_cell_t* cell_b = dynamic_cast(b); + cmp = cell_a->get_value() - cell_b->get_value(); + if (cmp == 0) { + cmp = cell_a->get_sub_value() - cell_b->get_sub_value(); + } + return cmp; +} + +int gui_sort_table_row_t::compare_text(const table_cell_item_t* a, const table_cell_item_t* b) +{ + const text_cell_t* cell_a = dynamic_cast(a); + const text_cell_t* cell_b = dynamic_cast(b); + const char* a_text = translator::translate(cell_a->get_text()); + const char* b_text = translator::translate(cell_b->get_text()); + return STRICMP(a_text, b_text); +} + +int gui_sort_table_row_t::compare(const table_cell_item_t* a, const table_cell_item_t* b) +{ + sint64 cmp = 0; + const uint8 data_type = a->get_type(); + if (data_type != b->get_type()) return 0; + + switch (data_type) { + case table_cell_item_t::cell_value: + cmp = gui_sort_table_row_t::compare_value(a, b); + break; + case table_cell_item_t::cell_values: + cmp = gui_sort_table_row_t::compare_values(a, b); + break; + case table_cell_item_t::cell_text: + cmp = gui_sort_table_row_t::compare_text(a, b); + break; + case table_cell_item_t::cell_no_sorting: + default: + // nothing to do + break; + } + + return cmp; +} diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h new file mode 100644 index 0000000000..26b57f560f --- /dev/null +++ b/gui/components/sortable_table.h @@ -0,0 +1,183 @@ +/* + * This file is part of the Simutrans-Extended project under the Artistic License. + * (see LICENSE.txt) + */ + +#ifndef GUI_COMPONENTS_SORTABLE_TABLE_H +#define GUI_COMPONENTS_SORTABLE_TABLE_H + + +#include "gui_container.h" +#include "gui_scrolled_list.h" +#include "gui_chart.h" + +#include "../../tpl/vector_tpl.h" + +#include "../../utils/cbuffer_t.h" + + + +#define L_CELL_PADDING (LINESPACE>>2) + +class table_cell_item_t : virtual public gui_component_t +{ +public: + enum { + cell_no_sorting = 0, + cell_value = 1, + cell_values = 2, + cell_text = 3 + }; + + enum align_t { + left, + centered, + right + }; + +protected: + scr_size min_size; + align_t align; + scr_coord draw_offset; + bool highlight=false; + +public: + table_cell_item_t(align_t align_=left) { align = align_; } + + scr_coord_val get_min_width() { return min_size.w; } + virtual void set_width(scr_coord_val new_width) OVERRIDE; + void set_size(scr_size size) OVERRIDE; + + // for filter + void set_highlight(bool yesno){ highlight=yesno; } + + scr_coord_val check_height(scr_coord_val new_height); + + virtual const uint8 get_type() const { return cell_text; } + + bool is_focusable() OVERRIDE { return false; } + + void draw(scr_coord offset) OVERRIDE; +}; + + +class text_cell_t : public table_cell_item_t +{ + const char* text; // only for direct access of non-translatable things. Do not use! + PIXVAL color; + // bool is_bold; + +public: + text_cell_t(const char* text = NULL, PIXVAL color = SYSCOL_TEXT, align_t align = left); + + const uint8 get_type() const OVERRIDE { return cell_text; } + + char const* get_text() const { return text; } + + void draw(scr_coord offset) OVERRIDE; +}; + +// The cell holds a single value for sorting +// Can specify a suffix. +class value_cell_t : public table_cell_item_t +{ +protected: + cbuffer_t buf; + PIXVAL color; + // bool is_bold; + sint64 value; + +public: + value_cell_t(sint64 value, gui_chart_t::chart_suffix_t suffix= gui_chart_t::STANDARD, align_t align = left, PIXVAL color = SYSCOL_TEXT); + + sint64 get_value() const { return value; } + + const uint8 get_type() const OVERRIDE { return cell_value; } + + void draw(scr_coord offset) OVERRIDE; +}; + +// The cell holds two values for sorting +// There is no suffix +class values_cell_t : public value_cell_t +{ +protected: + cbuffer_t sub_buf; + sint64 sub_value; + scr_coord_val sub_draw_offset_x = 0; + +public: + values_cell_t(sint64 value, sint64 sub_value, PIXVAL color = SYSCOL_TEXT); + + void set_width(scr_coord_val new_width) OVERRIDE; + + sint64 get_sub_value() const { return sub_value; } + + const uint8 get_type() const OVERRIDE { return cell_values; } + + void draw(scr_coord offset) OVERRIDE; +}; + + +class gui_sort_table_row_t : public gui_container_t, public gui_scrolled_list_t::scrollitem_t +{ +public: + static sint64 compare_value(const table_cell_item_t* a, const table_cell_item_t* b); + static sint64 compare_values(const table_cell_item_t* a, const table_cell_item_t* b); + static int compare_text(const table_cell_item_t* a, const table_cell_item_t* b); + + +protected: + vector_tpl owned_cells; ///< we take ownership of these pointers + + scr_coord_val row_height; + + slist_tpl min_widths; + +public: + gui_sort_table_row_t(); + + ~gui_sort_table_row_t(); + + void add_component(gui_component_t* comp) OVERRIDE; + + template + C* new_component() { C* comp = new C(); add_component(comp); owned_cells.append(comp); return comp; } + template + C* new_component(const A1& a1) { C* comp = new C(a1); add_component(comp); owned_cells.append(comp); return comp; } + template + C* new_component(const A1& a1, const A2& a2) { C* comp = new C(a1, a2); add_component(comp); owned_cells.append(comp); return comp; } + template + C* new_component(const A1& a1, const A2& a2, const A3& a3) { C* comp = new C(a1, a2, a3); add_component(comp); owned_cells.append(comp); return comp; } + template + C* new_component(const A1& a1, const A2& a2, const A3& a3, const A4& a4) { C* comp = new C(a1, a2, a3, a4); add_component(comp); owned_cells.append(comp); return comp; } + + const char* get_text() const OVERRIDE { return "Ding"; } + + table_cell_item_t* get_element(sint32 i) const { return (i >= 0 && (uint32)i < owned_cells.get_count()) ? dynamic_cast(owned_cells[i]) : NULL; } + + // highlight column + void set_highlight(sint32 i, bool highlight=true); + + void set_col(uint col, scr_coord_val width); + + scr_coord_val get_min_width(uint col); + + static int compare(const table_cell_item_t* a, const table_cell_item_t* b); + + virtual bool infowin_event(event_t const* ev) OVERRIDE { return false; } + + bool is_focusable() OVERRIDE { return selected; } + gui_component_t* get_focus() OVERRIDE { return this; } + scr_coord get_focus_pos() OVERRIDE { return pos; } + + void draw(scr_coord offset) OVERRIDE; + + scr_size get_size() const OVERRIDE { return scr_size(size.w, row_height); } + + scr_size get_min_size() const OVERRIDE { return get_size(); } + scr_size get_max_size() const OVERRIDE { return get_min_size(); } +}; + + +#endif diff --git a/gui/components/sortable_table_header.cc b/gui/components/sortable_table_header.cc new file mode 100644 index 0000000000..2202ae1eb4 --- /dev/null +++ b/gui/components/sortable_table_header.cc @@ -0,0 +1,152 @@ +/* + * This file is part of the Simutrans-Extended project under the Artistic License. + * (see LICENSE.txt) + */ + +/* + * Vehicle info including availability + */ + +#include "sortable_table_header.h" +#include "sortable_table.h" + +#include "../../simworld.h" +#include "../../simcolor.h" +#include "../../display/simgraph.h" +#include "../../player/simplay.h" + +#include "../../dataobj/translator.h" + +#include "../../utils/simstring.h" + + + +sortable_header_cell_t::sortable_header_cell_t(char const* const text_, bool yesno) +{ + enabled=yesno; + text = text_; + min_width = proportional_string_width(translator::translate(text)) + 7 /* arrow width */; + size.h=D_BUTTON_HEIGHT; +} + +void sortable_header_cell_t::draw(scr_coord offset) +{ + if (selected) { + display_fillbox_wh_clip_rgb(pos.x + offset.x + 1, pos.y + offset.y + 1, get_size().w - 2, get_size().h - 2, SYSCOL_TH_BACKGROUND_SELECTED, false); + } + PIXVAL text_color = selected ? SYSCOL_TH_TEXT_SELECTED : SYSCOL_TH_TEXT_TOP; + display_ddd_box_clip_rgb(pos.x + offset.x, pos.y + offset.y, get_size().w, get_size().h, SYSCOL_TH_BORDER, SYSCOL_TH_BORDER); + + // draw text + const scr_rect area(offset + pos, size-scr_size(5,0)); + if (text) { + display_proportional_ellipsis_rgb(area, translator::translate(text), ALIGN_CENTER_H | ALIGN_CENTER_V | DT_CLIP, text_color, false); + } + if (enabled && selected) { + // draw an arrow + scr_coord_val xoff_arrow_center = pos.x + offset.x + size.w - D_H_SPACE - 3; + display_fillbox_wh_clip_rgb(xoff_arrow_center, pos.y+offset.y + D_V_SPACE-1, 1, size.h - D_V_SPACE*2+2, SYSCOL_TH_TEXT_SELECTED, false); + if (reversed) { + // asc + display_fillbox_wh_clip_rgb(xoff_arrow_center-1, pos.y+offset.y + D_V_SPACE, 3, 1, SYSCOL_TH_TEXT_SELECTED, false); + display_fillbox_wh_clip_rgb(xoff_arrow_center-2, pos.y+offset.y + D_V_SPACE+1, 5, 1, SYSCOL_TH_TEXT_SELECTED, false); + } + else { + // desc + display_fillbox_wh_clip_rgb(xoff_arrow_center-1, pos.y+offset.y + size.h - D_V_SPACE - 1, 3, 1, SYSCOL_TH_TEXT_SELECTED, false); + display_fillbox_wh_clip_rgb(xoff_arrow_center-2, pos.y+offset.y + size.h - D_V_SPACE - 2, 5, 1, SYSCOL_TH_TEXT_SELECTED, false); + } + } +} + +void sortable_header_cell_t::set_width(scr_coord_val new_width) +{ + size.w = new_width + L_CELL_PADDING * 2; +} + + +gui_sort_table_header_t::gui_sort_table_header_t() +{ + set_size(scr_size(D_H_SPACE, D_BUTTON_HEIGHT)); + +} + +gui_sort_table_header_t::~gui_sort_table_header_t() +{ + clear_ptr_vector(owned_cells); +} + +void gui_sort_table_header_t::add_component(gui_component_t* comp) +{ + comp->set_focusable(true); + gui_container_t::add_component(comp); +} + +void gui_sort_table_header_t::set_col(uint col, scr_coord_val width) +{ + assert(col < components.get_count()); + sortable_header_cell_t*item = dynamic_cast(components.get_element(col)); + item->set_width(width); + item->set_pos(scr_coord(size.w, 0)); + size.w += item->get_size().w; // added padding +} + +scr_coord_val gui_sort_table_header_t::get_min_width(uint col) +{ + if(col>=owned_cells.get_count()) return 0; + return owned_cells.get_element(col)->get_min_width(); +} + +void gui_sort_table_header_t::set_selection(uint32 col) +{ + if (selected_col == col) { + } + + selected_col=col; + uint idx=0; + for (auto& cell : owned_cells) { + if (idx == col) { + reversed ^= 1; + cell->selected = true; + set_focus(cell); + } + else { + cell->selected = false; + cell->reversed = false; + } + idx++; + } +} + +void gui_sort_table_header_t::draw(scr_coord offset) +{ + // draw background + display_fillbox_wh_clip_rgb(pos.x + offset.x + D_H_SPACE, pos.y + offset.y, get_size().w-D_SCROLLBAR_WIDTH-D_H_SPACE, get_size().h, SYSCOL_TH_BACKGROUND_TOP, true); + gui_container_t::draw(offset); +} + +bool gui_sort_table_header_t::infowin_event(const event_t* ev) +{ + bool swallowed = gui_container_t::infowin_event(ev); + + if (IS_LEFTRELEASE(ev) && getroffen(ev->mouse_pos)) { + uint idx=0; + for (auto& cell : owned_cells) { + if (cell->getroffen(ev->mouse_pos)) { + set_focus(cell); + if (selected_col == idx) { + // already selected => inverse reversed state + cell->reversed^=1; + } + selected_col=idx; + reversed=cell->reversed; + call_listeners((long)selected_col); + break; + } + idx++; + } + } + + return swallowed; +} + diff --git a/gui/components/sortable_table_header.h b/gui/components/sortable_table_header.h new file mode 100644 index 0000000000..5882b32b40 --- /dev/null +++ b/gui/components/sortable_table_header.h @@ -0,0 +1,74 @@ +/* + * This file is part of the Simutrans-Extended project under the Artistic License. + * (see LICENSE.txt) + */ + +#ifndef GUI_COMPONENTS_SORTABLE_TABLE_HEADER_H +#define GUI_COMPONENTS_SORTABLE_TABLE_HEADER_H + + +#include "gui_container.h" +#include "gui_action_creator.h" + +class sortable_header_cell_t : /*public gui_action_creator_t,*/ public gui_component_t +{ + const char* text; + bool enabled=true; + scr_coord_val min_width; // element width = without padding + +public: + sortable_header_cell_t(char const* const text_, bool enable=true); + + scr_coord_val get_min_width() { return min_width; } + + void set_width(scr_coord_val new_width) OVERRIDE; + + bool reversed = false; + bool selected = false; + void enable(bool yesno = true) { enabled = yesno; } + void draw(scr_coord offset) OVERRIDE; + + //bool infowin_event(event_t const* ev) OVERRIDE; + + scr_size get_min_size() const OVERRIDE { return size; } + scr_size get_max_size() const OVERRIDE { return get_min_size(); } + +}; + +class gui_sort_table_header_t : public gui_container_t, public gui_action_creator_t +{ + vector_tpl owned_cells; ///< we take ownership of these pointers + uint8 selected_col=0; + + bool reversed=false; + +public: + gui_sort_table_header_t(); + ~gui_sort_table_header_t(); + + void add_component(gui_component_t* comp) OVERRIDE; + + template + C* new_component() { C* comp = new C(); add_component(comp); owned_cells.append(comp); return comp; } + template + C* new_component(const A1& a1) { C* comp = new C(a1); add_component(comp); owned_cells.append(comp); return comp; } + + void set_col(uint col, scr_coord_val width); + + scr_coord_val get_min_width(uint col); + + void set_selection(uint32 col); + + uint8 get_selected_column() { return selected_col; } + bool is_reversed() { return reversed; } + + bool infowin_event(event_t const* ev) OVERRIDE; + + void draw(scr_coord offset) OVERRIDE; + + scr_size get_min_size() const OVERRIDE { return get_size(); } + scr_size get_max_size() const OVERRIDE { return get_min_size(); } +}; + + +#endif diff --git a/gui/components/sortable_table_vehicle.cc b/gui/components/sortable_table_vehicle.cc new file mode 100644 index 0000000000..af99fdde45 --- /dev/null +++ b/gui/components/sortable_table_vehicle.cc @@ -0,0 +1,288 @@ +/* + * This file is part of the Simutrans-Extended project under the Artistic License. + * (see LICENSE.txt) + */ + +/* + * Vehicle info including availability + */ + +#include "sortable_table_vehicle.h" +#include "gui_colorbox.h" + +#include "../../simworld.h" +#include "../../simcolor.h" + +#include "../../bauer/goods_manager.h" +#include "../../bauer/vehikelbauer.h" +#include "../../descriptor/vehicle_desc.h" + +#include "../../dataobj/translator.h" +#include "../../display/simgraph.h" +#include "../../player/simplay.h" + +#include "../../utils/simstring.h" + +#include "../gui_theme.h" +#include "../vehicle_detail.h" +#include "../../descriptor/intro_dates.h" + +int vehicle_desc_row_t::sort_mode = vehicle_desc_row_t::VD_SPEED; +bool vehicle_desc_row_t::sortreverse = false; +bool vehicle_desc_row_t::side_view_mode = true; +uint8 vehicle_desc_row_t::filter_flag = 0; + +void display_insignia_dot(scr_coord_val xp, scr_coord_val yp, PIXVAL color= SYSCOL_CLASS_INSIGNIA, bool dirty=false) +{ + if (LINESPACE<18) { + display_fillbox_wh_clip_rgb(xp, yp, 2, 2, color, dirty); + } + else if (LINESPACE<24) { + display_fillbox_wh_clip_rgb(xp+1, yp, 1, 3, color, dirty); + display_fillbox_wh_clip_rgb(xp, yp+1, 3, 1, color, dirty); + } + else { + display_fillbox_wh_clip_rgb(xp + 1, yp, 2, 4, color, dirty); + display_fillbox_wh_clip_rgb(xp, yp + 1, 4, 2, color, dirty); + } +} + + +vehicle_side_image_cell_t::vehicle_side_image_cell_t(image_id img, const char* text_) + : text_cell_t(text_) +{ + side_image = img; + scr_coord_val x, y, w, h; + display_get_base_image_offset(side_image, &x, &y, &w, &h); + min_size = scr_size(w, h); + set_size(min_size); + remove_offset = scr_coord(x, y); +} + +void vehicle_side_image_cell_t::draw(scr_coord offset) +{ + table_cell_item_t::draw(offset); + + display_base_img(side_image, offset.x - remove_offset.x+ draw_offset.x, offset.y - remove_offset.y + draw_offset.y, world()->get_active_player_nr(), false, true); +} + + +vehicle_class_cell_t::vehicle_class_cell_t(const vehicle_desc_t* desc) : values_cell_t((sint64)desc->get_freight_type()->get_catg_index(), 0) +{ + align=centered; + min_size = scr_size(D_FIXED_SYMBOL_WIDTH+D_H_SPACE, D_FIXED_SYMBOL_WIDTH); + if (!desc->get_total_capacity() && !desc->get_overcrowded_capacity()) { + // no capacity => nothing to draw + veh_type=NULL; + value=0; sub_value=0; + } + else { + veh_type=desc; + if (veh_type->get_freight_type()->get_number_of_classes() > 1) { + // need to draw insignia dots => calculate size + const scr_coord_val insignia_dot_size = (LINESPACE<18) ? 2: (LINESPACE<24) ? 3 : 4; + uint accommodations=0; + for (uint8 ac=0; ac < veh_type->get_freight_type()->get_number_of_classes(); ac++) { + if (veh_type->get_capacity(ac)) { + accommodations++; + } + } + sub_value = veh_type->get_max_accommodation_class(); + + min_size.h = D_FIXED_SYMBOL_WIDTH + accommodations * insignia_dot_size *1.5; + min_size.w = max(D_FIXED_SYMBOL_WIDTH, veh_type->get_max_accommodation_class() * (int)(insignia_dot_size * 1.5)); + } + } + set_size(min_size); +} + +void vehicle_class_cell_t::set_width(scr_coord_val new_width) +{ + size.w = new_width + L_CELL_PADDING * 2; + draw_offset.x = (size.w - D_FIXED_SYMBOL_WIDTH) / 2; +} + +void vehicle_class_cell_t::draw(scr_coord offset) +{ + table_cell_item_t::draw(offset); + if (veh_type) { + offset += pos; + display_color_img(veh_type->get_freight_type()->get_catg_symbol(), offset.x + draw_offset.x, offset.y + draw_offset.y, 0, false, false); + const uint8 number_of_classes = veh_type->get_freight_type()->get_number_of_classes(); + if (number_of_classes > 1) { + // draw dots + const scr_coord_val insignia_dot_size = (LINESPACE<18) ? 2: (LINESPACE<24) ? 3 : 4; + scr_coord_val yoff = D_FIXED_SYMBOL_WIDTH + insignia_dot_size; + for (uint8 a_class = 0; a_class < number_of_classes; ++a_class) { + if (veh_type->get_capacity(a_class)) { + int xoff = -((insignia_dot_size *(a_class+1) + insignia_dot_size /2*a_class))/2; + for (uint8 n = 0; n < a_class + 1; ++n) { + display_insignia_dot(offset.x + size.w / 2 + xoff, offset.y + draw_offset.y + yoff); + xoff += (int)(insignia_dot_size *1.5); + } + yoff += (int)(insignia_dot_size * 1.5); + } + } + } + } +} + + +engine_type_cell_t::engine_type_cell_t(vehicle_desc_t::engine_t et) : + value_cell_t((sint64)et, gui_chart_t::STANDARD) +{ + uint8 engine_type = (uint8)et + 1; + value= engine_type; + buf.clear(); + if (engine_type) { + buf.append(vehicle_builder_t::engine_type_names[engine_type]); + } + else { + buf.append("-"); + align = centered; + color = COL_INACTIVE; + } + min_size = scr_size(proportional_string_width(buf), LINESPACE); + set_size(min_size); +} + + +vehicle_status_bar_t::vehicle_status_bar_t(const vehicle_desc_t* desc) + : values_cell_t((sint64)desc->get_basic_constraint_prev(), 0) +{ + veh_type=desc; + align = centered; + min_size = scr_size(VEHICLE_BAR_HEIGHT*4, VEHICLE_BAR_HEIGHT); + sub_value= (sint64)veh_type->get_basic_constraint_next(); // Substitute here to avoid making the size two lines. + set_size(min_size); + + l_color = veh_type->get_basic_constraint_prev() & vehicle_desc_t::intermediate_unique ? COL_CAUTION : veh_type->get_vehicle_status_color(); + r_color = veh_type->get_basic_constraint_next() & vehicle_desc_t::intermediate_unique ? COL_CAUTION : veh_type->get_vehicle_status_color(); +} + +void vehicle_status_bar_t::set_width(scr_coord_val new_width) +{ + size.w = new_width + L_CELL_PADDING * 2; + draw_offset.x = size.w/2- min_size.w/2; +} + +void vehicle_status_bar_t::draw(scr_coord offset) +{ + table_cell_item_t::draw(offset); + + offset += pos; + display_veh_form_wh_clip_rgb(offset.x + draw_offset.x, offset.y +draw_offset.y, VEHICLE_BAR_HEIGHT * 2, VEHICLE_BAR_HEIGHT, l_color, false, false, veh_type->get_basic_constraint_prev(), veh_type->get_interactivity()); + display_veh_form_wh_clip_rgb(offset.x + draw_offset.x+min_size.w/2, offset.y +draw_offset.y, VEHICLE_BAR_HEIGHT * 2, VEHICLE_BAR_HEIGHT, r_color, false, true, veh_type->get_basic_constraint_next(), veh_type->get_interactivity()); +} + + +vehicle_desc_row_t::vehicle_desc_row_t(const vehicle_desc_t* desc) +{ + veh_type = desc; + tooltip_buf.printf(veh_type->get_name()); + + // 1. image/name + if (side_view_mode) { + new_component(veh_type->get_image_id(ribi_t::dir_southwest, goods_manager_t::none), veh_type->get_name()); + } + else { + new_component(veh_type->get_name()); + } + // 2. color bar + new_component(veh_type); + // 3. value + new_component(veh_type->get_value(), gui_chart_t::MONEY, table_cell_item_t::right); + // 4. enigine type + new_component(veh_type->get_engine_type()); + // 5. power + new_component((sint64)veh_type->get_power(), gui_chart_t::KW, table_cell_item_t::right); + // 6. force + new_component((sint64)veh_type->get_tractive_effort(), gui_chart_t::FORCE, table_cell_item_t::right); + // 7. speed + new_component((sint64)veh_type->get_topspeed(), gui_chart_t::KMPH, table_cell_item_t::right); + // 8. catg + new_component(veh_type); + // 9. capacity + new_component((sint64)veh_type->get_total_capacity(), veh_type->get_overcrowded_capacity()); + // 10. weight + new_component((sint64)veh_type->get_weight(), gui_chart_t::TONNEN, table_cell_item_t::right); + // 11. axle load + new_component(veh_type->get_waytype() == water_wt ? 0 : (sint64)veh_type->get_axle_load() * 1000, gui_chart_t::TONNEN, table_cell_item_t::right); + // 12. intro date + PIXVAL status_color = veh_type->get_vehicle_status_color(); + new_component((sint64)veh_type->get_intro_year_month(), gui_chart_t::TIME, table_cell_item_t::right, status_color == COL_SAFETY ? SYSCOL_TEXT : status_color); + // 13. retire date + sint64 retire_date= DEFAULT_RETIRE_DATE * 12; + if (veh_type->get_retire_year_month() != DEFAULT_RETIRE_DATE * 12 && + (((!world()->get_settings().get_show_future_vehicle_info() && veh_type->will_end_prodection_soon(world()->get_timeline_year_month())) + || world()->get_settings().get_show_future_vehicle_info() + || veh_type->is_retired(world()->get_timeline_year_month())))) + { + retire_date = (sint64)veh_type->get_retire_year_month(); + + } + new_component(retire_date, gui_chart_t::TIME, table_cell_item_t::right); + + //init cell height + for (auto& cell : owned_cells) { + cell->set_height(row_height); + } +} + +void vehicle_desc_row_t::update_highlight() +{ + old_filter_flag=filter_flag; + set_highlight(VD_ENGINE_TYPE, filter_flag&VL_FILTER_FUEL); + set_highlight(VD_FREIGHT_TYPE, filter_flag&VL_FILTER_FREIGHT); + set_highlight(VD_STATUSBAR, filter_flag&VL_FILTER_UPGRADABLE); +} + +bool vehicle_desc_row_t::infowin_event(const event_t* ev) +{ + bool swallowed = gui_scrolled_list_t::scrollitem_t::infowin_event(ev); + if (!swallowed && veh_type && IS_RIGHTRELEASE(ev)) { + vehicle_detail_t* win = dynamic_cast(win_get_magic(magic_vehicle_detail)); + if (!win) { + create_win(new vehicle_detail_t(veh_type), w_info, magic_vehicle_detail); + } + else { + win->set_vehicle(veh_type); + top_win(win, false); + } + return false; + } + return swallowed; +} + +void vehicle_desc_row_t::draw(scr_coord offset) +{ + if (filter_flag != old_filter_flag) { + update_highlight(); + } + gui_sort_table_row_t::draw(offset); + // show tooltip + if (getroffen(get_mouse_pos() - offset)) { + win_set_tooltip(get_mouse_pos() + TOOLTIP_MOUSE_OFFSET, tooltip_buf, this); + } +} + + +bool vehicle_desc_row_t::compare(const gui_component_t* aa, const gui_component_t* bb) +{ + const vehicle_desc_row_t* row_a = dynamic_cast(aa); + const vehicle_desc_row_t* row_b = dynamic_cast(bb); + if (row_a == NULL || row_b == NULL) { + dbg->warning("vehicle_desc_row_t::compare()", "row data error"); + return false; + } + + const table_cell_item_t* a = row_a->get_element(sort_mode); + const table_cell_item_t* b = row_b->get_element(sort_mode); + if (a == NULL || b == NULL) { + dbg->warning("vehicle_desc_row_t::compare()", "Could not get table_cell_item_t successfully"); + return false; + } + + int cmp = gui_sort_table_row_t::compare(a, b); + return sortreverse ? cmp < 0 : cmp > 0; // Do not include 0 +} diff --git a/gui/components/sortable_table_vehicle.h b/gui/components/sortable_table_vehicle.h new file mode 100644 index 0000000000..0e92f81e13 --- /dev/null +++ b/gui/components/sortable_table_vehicle.h @@ -0,0 +1,127 @@ +/* + * This file is part of the Simutrans-Extended project under the Artistic License. + * (see LICENSE.txt) + */ + +#ifndef GUI_COMPONENTS_SORTABLE_TABLE_VEHICLE_H +#define GUI_COMPONENTS_SORTABLE_TABLE_VEHICLE_H + + +#include "sortable_table.h" +#include "gui_aligned_container.h" +#include "gui_label.h" +#include "gui_scrolled_list.h" +#include "gui_image.h" +#include "gui_table.h" +#include "../../display/scr_coord.h" +#include "../../vehicle/vehicle.h" +#include "../../utils/cbuffer_t.h" + +#include "gui_scrolled_list.h" + +#include "gui_chart.h" +#include "gui_container.h" + + +class vehicle_side_image_cell_t : public text_cell_t +{ + image_id side_image; + scr_coord remove_offset; + +public: + vehicle_side_image_cell_t(image_id img, const char* text = NULL); + + void draw(scr_coord offset) OVERRIDE; +}; + + +class vehicle_class_cell_t : public values_cell_t +{ + const vehicle_desc_t* veh_type; + +public: + vehicle_class_cell_t(const vehicle_desc_t* desc); + + void set_width(scr_coord_val new_width) OVERRIDE; + + const uint8 get_type() const OVERRIDE { return cell_values; } + + void draw(scr_coord offset) OVERRIDE; +}; + +class engine_type_cell_t : public value_cell_t +{ +public: + engine_type_cell_t(vehicle_desc_t::engine_t et); +}; + + +class vehicle_status_bar_t : public values_cell_t +{ + const vehicle_desc_t* veh_type; + PIXVAL l_color, r_color; + +public: + vehicle_status_bar_t(const vehicle_desc_t* desc); + + void set_width(scr_coord_val new_width) OVERRIDE; + + void draw(scr_coord offset) OVERRIDE; +}; + + +class vehicle_desc_row_t : public gui_sort_table_row_t +{ +public: + enum sort_mode_t { + VD_NAME, + VD_STATUSBAR, + VD_COST, + VD_ENGINE_TYPE, + VD_POWER, + VD_TRACTIVE_FORCE, + VD_SPEED, + VD_FREIGHT_TYPE, + VD_CAPACITY, + VD_WEIGHT, + VD_AXLE_LOAD, + VD_INTRO_DATE, + VL_RETIRE_DATE, + MAX_COLS + }; + + static int sort_mode; + static bool sortreverse; + // false=show name, true=show side view + static bool side_view_mode; + + // 1=fuel filer on, 2=freight type fiter on + enum { + VL_NO_FILTER = 0, + VL_FILTER_FUEL = 1 << 0, + VL_FILTER_FREIGHT = 1 << 1, + VL_FILTER_UPGRADABLE = 1 << 2 + }; + static uint8 filter_flag; + uint8 old_filter_flag=0; + +private: + const vehicle_desc_t* veh_type=NULL; + cbuffer_t tooltip_buf; + + void update_highlight(); + +public: + vehicle_desc_row_t(const vehicle_desc_t* desc); + + char const* get_text() const OVERRIDE { return veh_type->get_name(); } + + bool infowin_event(event_t const* ev) OVERRIDE; + + void draw(scr_coord offset) OVERRIDE; + + static bool compare(const gui_component_t* aa, const gui_component_t* bb); +}; + + +#endif diff --git a/gui/vehiclelist_frame.cc b/gui/vehiclelist_frame.cc index a2aac4ce38..c26feb8c49 100644 --- a/gui/vehiclelist_frame.cc +++ b/gui/vehiclelist_frame.cc @@ -12,6 +12,7 @@ #include "../simskin.h" #include "../simworld.h" +#include "../vehicle/vehicle.h" #include "../display/simgraph.h" @@ -26,39 +27,15 @@ #include "../unicode.h" -int vehiclelist_stats_t::sort_mode = vehicle_builder_t::sb_intro_date; -bool vehiclelist_stats_t::reverse = false; - -uint8 vehiclelist_frame_t::filter_flag=0; -bool vehiclelist_frame_t::side_view_mode = true; char vehiclelist_frame_t::name_filter[256] = ""; char vehiclelist_frame_t::status_counts_text[10][VL_MAX_STATUS_FILTER] = {}; -int vehiclelist_frame_t::cell_width[vehiclelist_frame_t::VL_MAX_SPECS] = {}; -#define MAX_IMG_WIDTH vehiclelist_frame_t::cell_width[vehiclelist_frame_t::VL_IMAGE] -int vehiclelist_frame_t::stats_width = 0; - -static int col_to_sort_mode[vehiclelist_frame_t::VL_MAX_SPECS] = { - vehicle_builder_t::sb_name, - vehicle_builder_t::sb_role, - vehicle_builder_t::sb_value, - vehicle_builder_t::sb_enigine_type, - vehicle_builder_t::sb_power, - vehicle_builder_t::sb_tractive_force, - vehicle_builder_t::sb_freight, - vehicle_builder_t::sb_capacity, - vehicle_builder_t::sb_speed, - vehicle_builder_t::sb_weight, - vehicle_builder_t::sb_axle_load, - vehicle_builder_t::sb_intro_date, - vehicle_builder_t::sb_retire_date -}; -static const char *const vl_header_text[vehiclelist_frame_t::VL_MAX_SPECS] = +static const char *const vl_header_text[vehicle_desc_row_t::MAX_COLS] = { "Name", "", "Wert", "engine_type", - "Leistung", "TF_", "", "Capacity", - "Max. speed", "curb_weight", "Axle load:", "Intro. date","Retire date" + "Leistung", "TF_", "Max. speed", "", + "Capacity", "curb_weight", "Axle load:", "Intro. date","Retire date" }; static const char *const timeline_filter_button_text[vehiclelist_frame_t::VL_MAX_STATUS_FILTER] = @@ -66,344 +43,29 @@ static const char *const timeline_filter_button_text[vehiclelist_frame_t::VL_MAX "Show future", "Show available", "Show outdated", "Show obsolete", "upgrade_only" }; -vehiclelist_stats_t::vehiclelist_stats_t(const vehicle_desc_t *v) -{ - veh = v; - - // name for tooltip - tooltip_buf.clear(); - tooltip_buf.append( translator::translate( veh->get_name(), world()->get_settings().get_name_language_id() ) ); - - // calculate first column width - if( vehiclelist_frame_t::side_view_mode ) { - // width of image - scr_coord_val x, y, w, h; - const image_id image = veh->get_image_id( ribi_t::dir_southwest, veh->get_freight_type() ); - display_get_base_image_offset(image, &x, &y, &w, &h ); - if( w > MAX_IMG_WIDTH ) { - MAX_IMG_WIDTH = min(w + D_H_SPACE, int(get_base_tile_raster_width()*0.67)); // 1 tile = length 16 - } - height = h; - } - else { - MAX_IMG_WIDTH = max(proportional_string_width(tooltip_buf), MAX_IMG_WIDTH); - } - - height = max( height, LINEASCENT*2 + D_V_SPACE*3 ); -} - - -void vehiclelist_stats_t::draw( scr_coord offset ) -{ - // show tooltip - if (getroffen(get_mouse_pos() - offset)) { - win_set_tooltip(get_mouse_pos() + TOOLTIP_MOUSE_OFFSET, tooltip_buf, this); - } - - const uint32 month = world()->get_current_month(); - offset += pos; - offset.x += D_H_SPACE; - const int text_offset_y = (height-1-LINEASCENT)>>1; - - vehicle_detail_t *win = dynamic_cast(win_get_magic(magic_vehicle_detail)); - const bool selected = win ? (win->get_vehicle()==veh) : false; - - if (vehiclelist_frame_t::side_view_mode) { - if( selected ) { - display_fillbox_wh_clip_rgb(offset.x, offset.y, MAX_IMG_WIDTH - 1, height - 1, SYSCOL_TR_BACKGROUND_SELECTED, false); - } - // show side view image - scr_coord_val x, y, w, h; - const image_id image = veh->get_image_id( ribi_t::dir_southwest, veh->get_freight_type() ); - display_get_base_image_offset(image, &x, &y, &w, &h ); - display_base_img(image, offset.x - x, offset.y - y + D_GET_CENTER_ALIGN_OFFSET(h, height-1), world()->get_active_player_nr(), false, true); - } - else { - // show name - PIXVAL name_colval = veh->get_vehicle_status_color(); - if (veh->is_available_only_as_upgrade()) { - if (name_colval == SYSCOL_OBSOLETE) { - name_colval = color_idx_to_rgb(COL_DARK_PURPLE); - } - else { - name_colval = SYSCOL_UPGRADEABLE; - } - } - if (name_colval==COL_SAFETY) { - name_colval = selected ? SYSCOL_TD_TEXT_SELECTED : SYSCOL_TEXT; - } - display_fillbox_wh_clip_rgb(offset.x, offset.y, MAX_IMG_WIDTH - 1, height - 1, selected ? SYSCOL_TR_BACKGROUND_SELECTED:SYSCOL_TH_BACKGROUND_LEFT, false); - display_proportional_rgb( - offset.x, offset.y + text_offset_y, - translator::translate( veh->get_name(), world()->get_settings().get_name_language_id() ), - ALIGN_LEFT|DT_CLIP, - name_colval, - false - ); - } - - offset.x += MAX_IMG_WIDTH; - for (uint8 col = 1; colget_vehicle_status_color(); - if (veh->is_available_only_as_upgrade()) { - if (status_color == SYSCOL_OBSOLETE) { - status_color = color_idx_to_rgb(COL_DARK_PURPLE); - } - else { - status_color = SYSCOL_UPGRADEABLE; - } - } - - scr_coord_val xoff= offset.x + D_H_SPACE; - display_veh_form_wh_clip_rgb(xoff, offset.y + D_GET_CENTER_ALIGN_OFFSET(VEHICLE_BAR_HEIGHT, height-1), VEHICLE_BAR_HEIGHT*2, VEHICLE_BAR_HEIGHT, status_color, true, false, veh->get_basic_constraint_prev(), veh->get_interactivity()); - xoff += VEHICLE_BAR_HEIGHT * 2; - display_veh_form_wh_clip_rgb(xoff, offset.y + D_GET_CENTER_ALIGN_OFFSET(VEHICLE_BAR_HEIGHT, height-1), VEHICLE_BAR_HEIGHT*2, VEHICLE_BAR_HEIGHT, status_color, true, true, veh->get_basic_constraint_next(), veh->get_interactivity()); - - const uint8 upgradable_state = veh->has_available_upgrade(month); - if( vehiclelist_frame_t::filter_flag&vehiclelist_frame_t::VL_FILTER_UPGRADABLE && upgradable_state && skinverwaltung_t::upgradable ) { - if (world()->get_settings().get_show_future_vehicle_info() || (!world()->get_settings().get_show_future_vehicle_info() && veh->is_future(month) != 2)) { - xoff = xoff + VEHICLE_BAR_HEIGHT * 2 - D_FIXED_SYMBOL_WIDTH; - display_color_img(skinverwaltung_t::upgradable->get_image_id(upgradable_state - 1), xoff, offset.y + height - D_FIXED_SYMBOL_WIDTH, 0, false, false); - } - } - break; - } - case vehiclelist_frame_t::VL_COST: - { - char tmp[ 128 ]; - money_to_string( tmp, veh->get_value() / 100.0, false ); - buf.printf("%8s", tmp); - display_proportional_rgb( offset.x+ vehiclelist_frame_t::cell_width[col]-D_H_SPACE, offset.y+text_offset_y, buf, ALIGN_RIGHT | DT_CLIP, text_color, false); - break; - } - case vehiclelist_frame_t::VL_ENGINE_TYPE: - { - char str[ 256 ]; - const uint8 et = (uint8)veh->get_engine_type() + 1; - if( et ) { - sprintf( str, "%s", translator::translate( vehicle_builder_t::engine_type_names[et] ) ); - display_proportional_rgb( offset.x+D_H_SPACE, offset.y+text_offset_y, str, ALIGN_LEFT|DT_CLIP, text_color, false ); - } - break; - } - case vehiclelist_frame_t::VL_POWER: - if (veh->get_power() > 0) { - buf.printf("%4d kW", veh->get_power()); - display_proportional_rgb(offset.x + vehiclelist_frame_t::cell_width[col] - D_H_SPACE, offset.y + text_offset_y, buf, ALIGN_RIGHT | DT_CLIP, text_color, false); - } - break; - - case vehiclelist_frame_t::VL_TRACTIVE_FORCE: - if (veh->get_power() > 0) { - buf.printf("%3d kN", veh->get_tractive_effort()); - display_proportional_rgb(offset.x + vehiclelist_frame_t::cell_width[col] - D_H_SPACE, offset.y + text_offset_y, buf, ALIGN_RIGHT | DT_CLIP, text_color, false); - } - break; - - case vehiclelist_frame_t::VL_FREIGHT_TYPE: - if( veh->get_total_capacity() || veh->get_overcrowded_capacity() ){ - const uint8 number_of_classes = goods_manager_t::get_classes_catg_index( veh->get_freight_type()->get_catg_index() ); - // owned class indicator - if( number_of_classes>1 ) { - int yoff = D_GET_CENTER_ALIGN_OFFSET((D_FIXED_SYMBOL_WIDTH+veh->get_accommodations()*3), height-1); - display_color_img(veh->get_freight_type()->get_catg_symbol(), offset.x + D_H_SPACE, offset.y + yoff, 0, false, false); - yoff += D_FIXED_SYMBOL_WIDTH+1; - for (uint8 a_class=0; a_classget_capacity(a_class) ) { - int xoff = (vehiclelist_frame_t::cell_width[col]>>1)-(int)(a_class*3/2)-1; - for( uint8 n=0; nheight) { - break; - } - } - } - } - else { - display_color_img(veh->get_freight_type()->get_catg_symbol(),offset.x + D_H_SPACE, offset.y+ D_GET_CENTER_ALIGN_OFFSET(D_FIXED_SYMBOL_WIDTH, height-1),0, false, false); - } - } - break; - - case vehiclelist_frame_t::VL_CAPACITY: - { - int yoff = text_offset_y; - if (!veh->get_total_capacity() && !veh->get_overcrowded_capacity() ) { - buf.append("-"); - text_color = SYSCOL_TEXT_WEAK; - } - else if(veh->get_total_capacity() && veh->get_overcrowded_capacity()) { - // display two lines - buf.printf("%4d", veh->get_total_capacity()); - display_proportional_rgb(offset.x + (vehiclelist_frame_t::cell_width[col]>>1), offset.y + D_V_SPACE, buf, ALIGN_CENTER_H | DT_CLIP, text_color, false); - buf.clear(); - yoff = LINEASCENT+D_V_SPACE*2; - buf.printf("(%d)", veh->get_overcrowded_capacity()); - } - else { - if (veh->get_total_capacity()) { - buf.printf("%4d", veh->get_total_capacity()); - } - if (veh->get_overcrowded_capacity()) { - buf.printf("(%d)", veh->get_overcrowded_capacity()); - } - } - display_proportional_rgb(offset.x + (vehiclelist_frame_t::cell_width[col]>>1), offset.y + yoff, buf, ALIGN_CENTER_H | DT_CLIP, text_color, false); - break; - } - case vehiclelist_frame_t::VL_SPEED: - buf.printf("%3d km/h", veh->get_topspeed()); - display_proportional_rgb(offset.x + vehiclelist_frame_t::cell_width[col] - D_H_SPACE, offset.y + text_offset_y, buf, ALIGN_RIGHT | DT_CLIP, text_color, false); - break; - case vehiclelist_frame_t::VL_WEIGHT: - if (veh->get_weight()) { - buf.printf("%4.1ft", veh->get_weight() / 1000.0); - } - else { - buf.append("-"); - text_color = SYSCOL_TEXT_WEAK; - } - display_proportional_rgb(offset.x + vehiclelist_frame_t::cell_width[col] - D_H_SPACE, offset.y + text_offset_y, buf, ALIGN_RIGHT | DT_CLIP, text_color, false); - break; - case vehiclelist_frame_t::VL_AXLE_LOAD: - if (veh->get_waytype() != water_wt) { - buf.printf("%2it", veh->get_axle_load()); - display_proportional_rgb(offset.x + vehiclelist_frame_t::cell_width[col] - D_H_SPACE, offset.y + text_offset_y, buf, ALIGN_RIGHT | DT_CLIP, text_color, false); - } - break; - case vehiclelist_frame_t::VL_INTRO_DATE: - buf.append( translator::get_short_date(veh->get_intro_year_month()/12, veh->get_intro_year_month()%12) ); - display_proportional_rgb(offset.x + D_H_SPACE, offset.y + text_offset_y, buf, ALIGN_LEFT | DT_CLIP, text_color, false); - break; - case vehiclelist_frame_t::VL_RETIRE_DATE: - if (veh->get_retire_year_month() != DEFAULT_RETIRE_DATE * 12 && - (((!world()->get_settings().get_show_future_vehicle_info() && veh->will_end_prodection_soon(world()->get_timeline_year_month())) - || world()->get_settings().get_show_future_vehicle_info() - || veh->is_retired(world()->get_timeline_year_month())))) - { - buf.append( translator::get_short_date(veh->get_retire_year_month()/12, veh->get_retire_year_month()%12) ); - } - display_proportional_rgb(offset.x + D_H_SPACE, offset.y + text_offset_y, buf, ALIGN_LEFT | DT_CLIP, text_color, false); - break; - - default: - break; - } - offset.x += vehiclelist_frame_t::cell_width[col]; - } -} - - -bool vehiclelist_stats_t::infowin_event(const event_t *ev) -{ - if( IS_LEFTRELEASE(ev) && getroffen( ev->mouse_pos+pos ) ) { - vehicle_detail_t *win = dynamic_cast(win_get_magic(magic_vehicle_detail)); - if (!win) { - create_win(new vehicle_detail_t(veh), w_info, magic_vehicle_detail); - } - else { - win->set_vehicle(veh); - top_win(win, false); - } - } - return false; -} - - -const char *vehiclelist_stats_t::get_text() const -{ - return translator::translate( veh->get_name() ); -} - -scr_size vehiclelist_stats_t::get_size() const -{ - return scr_size(D_MARGINS_X + vehiclelist_frame_t::stats_width, height); -} - -bool vehiclelist_stats_t::compare(const gui_component_t *aa, const gui_component_t *bb) -{ - if (reverse) { - return vehicle_builder_t::compare_vehicles(dynamic_cast(bb)->veh, dynamic_cast(aa)->veh, (vehicle_builder_t::sort_mode_t)vehiclelist_stats_t::sort_mode); - } - return vehicle_builder_t::compare_vehicles( dynamic_cast(aa)->veh, dynamic_cast(bb)->veh, (vehicle_builder_t::sort_mode_t)vehiclelist_stats_t::sort_mode ); -} - vehiclelist_frame_t::vehiclelist_frame_t() : gui_frame_t( translator::translate("vh_title") ), - scrolly(gui_scrolled_list_t::windowskin, vehiclelist_stats_t::compare), - scrollx_tab(&cont_list_table,true,false) + scrolly(gui_scrolled_list_t::windowskin, vehicle_desc_row_t::compare), + scrollx_tab(&cont_sortable,true,true) { last_name_filter[0] = 0; - scrolly.set_cmp( vehiclelist_stats_t::compare ); // Scrolling in x direction should not be possible due to fixed header scrolly.set_show_scroll_x(false); + scrolly.set_checkered(true); + scrolly.set_scroll_amount_y(LINESPACE + D_H_SPACE + 2); // default cell height // init table sort buttons - for (uint8 i=0; i(vl_header_text[col]); } - // calculate table cell width - cell_width[VL_IMAGE] = max(cell_width[VL_IMAGE], bt_table_sort[VL_IMAGE].get_min_size().w); - cell_width[VL_STATUSBAR] = VEHICLE_BAR_HEIGHT*4+D_H_SPACE*2+1; - cell_width[VL_COST] = max(proportional_string_width("88,888,888$"), bt_table_sort[VL_COST].get_min_size().w) + D_H_SPACE*2+1; - cell_width[VL_ENGINE_TYPE] = 0; // need initialization for refresh - for (uint8 i = 0; i < 11; i++) { - cell_width[VL_ENGINE_TYPE]=max(cell_width[VL_ENGINE_TYPE], proportional_string_width( translator::translate( vehicle_builder_t::engine_type_names[i] ))); - } - cell_width[VL_ENGINE_TYPE] = max(cell_width[VL_ENGINE_TYPE], bt_table_sort[VL_ENGINE_TYPE].get_min_size().w) + D_H_SPACE*2+1; - cell_width[VL_ENGINE_TYPE] += D_H_SPACE*2+1; - - cell_width[VL_POWER] = max(proportional_string_width("8,888 kW"), bt_table_sort[VL_POWER].get_min_size().w) + D_H_SPACE*2+1; - cell_width[VL_TRACTIVE_FORCE] = max(proportional_string_width("8,888 kN"), bt_table_sort[VL_TRACTIVE_FORCE].get_min_size().w) + D_H_SPACE*2+1; - cell_width[VL_FREIGHT_TYPE] = D_FIXED_SYMBOL_WIDTH + D_H_SPACE*2+1; - cell_width[VL_CAPACITY] = max(proportional_string_width("(8888)"), bt_table_sort[VL_CAPACITY].get_min_size().w) + D_H_SPACE*2+1; - cell_width[VL_SPEED] = max(proportional_string_width("8,888 km/h"), bt_table_sort[VL_SPEED].get_min_size().w) + D_H_SPACE*2+1; - cell_width[VL_WEIGHT] = max(proportional_string_width("888.8t"), bt_table_sort[VL_WEIGHT].get_min_size().w) + D_H_SPACE*2+1; - cell_width[VL_AXLE_LOAD] = max(proportional_string_width("888t"), bt_table_sort[VL_AXLE_LOAD].get_min_size().w) + D_H_SPACE*2+1; - cell_width[VL_INTRO_DATE] = 0; // need initialization for refresh - for (uint8 i = 0; i < 11; i++) { - cell_width[VL_INTRO_DATE] = max(cell_width[VL_INTRO_DATE], proportional_string_width(translator::get_short_month_name(i))); - } - cell_width[VL_INTRO_DATE] += proportional_string_width("8888 "); - if (translator::translate("YEAR_SYMBOL")!="" && translator::translate("YEAR_SYMBOL") != "YEAR_SYMBOL") { - cell_width[VL_INTRO_DATE] += proportional_string_width(translator::translate("YEAR_SYMBOL")); - } - cell_width[VL_RETIRE_DATE] = cell_width[VL_INTRO_DATE]; - cell_width[VL_INTRO_DATE] = max(cell_width[VL_INTRO_DATE], bt_table_sort[VL_INTRO_DATE].get_min_size().w) + D_H_SPACE * 2 + 1; - cell_width[VL_RETIRE_DATE] = max(cell_width[VL_RETIRE_DATE], bt_table_sort[VL_RETIRE_DATE].get_min_size().w) + D_H_SPACE * 2 + D_SCROLLBAR_WIDTH + 1; // need scrollbar space - - cont_list_table.set_margin(scr_size(0,0), scr_size(0,0)); - cont_list_table.set_spacing(scr_size(0,0)); - cont_list_table.set_table_layout(1,0); - cont_list_table.add_table(VL_MAX_SPECS+1,1)->set_spacing(scr_size(0,0)); - { - cont_list_table.new_component(D_H_SPACE<<1); - for( uint8 i=0; i(translator::translate(vehicle_builder_t::engine_type_names[(vehicle_desc_t::engine_t)i]), SYSCOL_TEXT); } engine_filter.new_component(translator::translate("Trailers"), SYSCOL_TEXT); - filter_flag = 0; + vehicle_desc_row_t::filter_flag = 0; engine_filter.set_selection( 0 ); engine_filter.add_listener( this ); add_component( &engine_filter ); @@ -500,8 +162,8 @@ vehiclelist_frame_t::vehiclelist_frame_t() : bt_show_name.add_listener(this); bt_show_side_view.init(button_t::roundbox_right_state, "show_side_view"); bt_show_side_view.add_listener(this); - bt_show_name.pressed = !side_view_mode; - bt_show_side_view.pressed = side_view_mode; + bt_show_name.pressed = !vehicle_desc_row_t::side_view_mode; + bt_show_side_view.pressed = vehicle_desc_row_t::side_view_mode; add_component( &bt_show_name ); add_component( &bt_show_side_view); } @@ -515,7 +177,7 @@ vehiclelist_frame_t::vehiclelist_frame_t() : fill_list(); set_resizemode(diagonal_resize); - scrolly.set_maximize(true); + scrollx_tab.set_maximize(false); } @@ -549,15 +211,21 @@ bool vehiclelist_frame_t::action_triggered( gui_action_creator_t *comp,value_t v else if( comp == &bt_show_name ) { bt_show_name.pressed = true; bt_show_side_view.pressed = false; - side_view_mode = false; + vehicle_desc_row_t::side_view_mode = false; fill_list(); } else if( comp == &bt_show_side_view) { bt_show_name.pressed = false; bt_show_side_view.pressed = true; - side_view_mode = true; + vehicle_desc_row_t::side_view_mode = true; fill_list(); } + else if (comp == &table_header) { + vehicle_desc_row_t::sort_mode = v.i; + table_header.set_selection(vehicle_desc_row_t::sort_mode); + vehicle_desc_row_t::sortreverse = table_header.is_reversed(); + scrolly.sort(0); + } else { for( uint8 i=0; iget_current_month(); const goods_desc_t *ware = idx_to_ware[ max( 0, ware_filter.get_selection() ) ]; const bool show_all_upgrade_only_vehicle = bt_timeline_filters[VL_FILTER_UPGRADE_ONLY].pressed @@ -689,7 +337,8 @@ void vehiclelist_frame_t::fill_list() continue; } } - scrolly.new_component( veh ); + scrolly.new_component(veh); + //scrolly.new_component( veh, side_view_mode ); if( veh->is_available_only_as_upgrade() ){ status_counts[VL_FILTER_UPGRADE_ONLY]++; } @@ -774,7 +423,8 @@ void vehiclelist_frame_t::fill_list() continue; } } - scrolly.new_component( veh ); + //scrolly.new_component( veh, side_view_mode ); + scrolly.new_component(veh); if( veh->is_available_only_as_upgrade() ){ status_counts[VL_FILTER_UPGRADE_ONLY]++; } @@ -795,12 +445,8 @@ void vehiclelist_frame_t::fill_list() count++; } } - if( vehiclelist_stats_t::sort_mode != 0 ) { - scrolly.sort(0); - } - else { - scrolly.set_size( scrolly.get_size() ); - } + scrolly.sort(0); + scrolly.set_size( scrolly.get_size() ); switch (count) { case 0: lb_count.buf().printf(translator::translate("Vehicle not found"), count); @@ -817,6 +463,37 @@ void vehiclelist_frame_t::fill_list() } lb_count.update(); + // recalc stats table width + scr_coord_val max_widths[vehicle_desc_row_t::MAX_COLS] = {}; + + // check column widths + table_header.set_selection(vehicle_desc_row_t::sort_mode); + table_header.set_width(D_H_SPACE); // init width + for (uint c = 0; c < vehicle_desc_row_t::MAX_COLS; c++) { + // get header widths + max_widths[c] = table_header.get_min_width(c); + } + for (int r = 0; r < scrolly.get_count(); r++) { + vehicle_desc_row_t* row = (vehicle_desc_row_t*)scrolly.get_element(r); + for (uint c = 0; c < vehicle_desc_row_t::MAX_COLS; c++) { + max_widths[c] = max(max_widths[c], row->get_min_width(c)); + } + } + + // set column widths + for (uint c = 0; c < vehicle_desc_row_t::MAX_COLS; c++) { + table_header.set_col(c, max_widths[c]); + } + table_header.set_width(table_header.get_size().w + D_SCROLLBAR_WIDTH); + + for (int r = 0; r < scrolly.get_count(); r++) { + vehicle_desc_row_t* row = (vehicle_desc_row_t*)scrolly.get_element(r); + row->set_size(scr_size(0, row->get_size().h)); + for (uint c = 0; c < vehicle_desc_row_t::MAX_COLS; c++) { + row->set_col(c, max_widths[c]); + } + } + for( uint8 i=0; irdwr_bool(vehiclelist_stats_t::reverse); + file->rdwr_bool(vehicle_desc_row_t::sortreverse); file->rdwr_bool(bt_timeline_filters[VL_SHOW_OUT_OBSOLETE].pressed); file->rdwr_bool(bt_timeline_filters[VL_SHOW_FUTURE].pressed); file->rdwr_bool(bt_timeline_filters[VL_SHOW_OUT_OF_PROD].pressed); diff --git a/gui/vehiclelist_frame.h b/gui/vehiclelist_frame.h index b0af671758..79713883bb 100644 --- a/gui/vehiclelist_frame.h +++ b/gui/vehiclelist_frame.h @@ -16,6 +16,8 @@ #include "components/gui_image.h" #include "components/gui_waytype_tab_panel.h" #include "components/gui_table.h" +#include "components/sortable_table_vehicle.h" +#include "components/sortable_table_header.h" class vehicle_desc_t; class goods_desc_t; @@ -24,25 +26,6 @@ class goods_desc_t; class vehiclelist_frame_t : public gui_frame_t, private action_listener_t { public: - enum veh_spec_col_t { - VL_IMAGE, - VL_STATUSBAR, - VL_COST, - VL_ENGINE_TYPE, - VL_POWER, - VL_TRACTIVE_FORCE, - VL_FREIGHT_TYPE, - VL_CAPACITY, - VL_SPEED, - VL_WEIGHT, - VL_AXLE_LOAD, - VL_INTRO_DATE, - VL_RETIRE_DATE, - VL_MAX_SPECS - }; - static int cell_width[vehiclelist_frame_t::VL_MAX_SPECS]; - static int stats_width; - // vehicle status(mainly timeline) filter index enum status_filter_t { VL_SHOW_FUTURE =0, // gray @@ -53,22 +36,11 @@ class vehiclelist_frame_t : public gui_frame_t, private action_listener_t VL_MAX_STATUS_FILTER, }; - // 1=fuel filer on, 2=freight type fiter on - enum { - VL_NO_FILTER = 0, - VL_FILTER_FUEL = 1<<0, - VL_FILTER_FREIGHT = 1<<1, - VL_FILTER_UPGRADABLE = 1<<2 - }; - static uint8 filter_flag; - - // false=show name, true=show side view - static bool side_view_mode; - private: button_t bt_timeline_filters[VL_MAX_STATUS_FILTER]; button_t bt_upgradable; - gui_aligned_container_t cont_list_table; + gui_sort_table_header_t table_header; + gui_aligned_container_t cont_sortable; gui_scrolled_list_t scrolly; gui_scrollpane_t scrollx_tab; gui_waytype_tab_panel_t tabs; @@ -84,7 +56,6 @@ class vehiclelist_frame_t : public gui_frame_t, private action_listener_t static char status_counts_text[10][VL_MAX_STATUS_FILTER]; button_t bt_show_name, bt_show_side_view; - table_sort_button_t bt_table_sort[VL_MAX_SPECS]; static char name_filter[256]; char last_name_filter[256]; @@ -104,31 +75,4 @@ class vehiclelist_frame_t : public gui_frame_t, private action_listener_t uint32 get_rdwr_id() OVERRIDE { return magic_vehiclelist; } }; - -class vehiclelist_stats_t : public gui_scrolled_list_t::scrollitem_t -{ -private: - const vehicle_desc_t *veh; - cbuffer_t tooltip_buf; - cbuffer_t buf; - int height; - -public: - static int sort_mode; - static bool reverse; - - vehiclelist_stats_t(const vehicle_desc_t *); - - char const* get_text() const OVERRIDE; - scr_size get_size() const OVERRIDE; - scr_size get_min_size() const OVERRIDE { return get_size(); }; - scr_size get_max_size() const OVERRIDE { return get_min_size(); } - - static bool compare(const gui_component_t *a, const gui_component_t *b ); - - bool infowin_event(event_t const *ev) OVERRIDE; - - void draw( scr_coord offset ) OVERRIDE; -}; - #endif From 98c7be70caa95485b1a4b889dc82ed7650496750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 19 Jul 2024 06:49:58 +0900 Subject: [PATCH 12/32] CODE] remove unnecessary include --- gui/vehiclelist_frame.h | 1 - 1 file changed, 1 deletion(-) diff --git a/gui/vehiclelist_frame.h b/gui/vehiclelist_frame.h index 79713883bb..c1bd7c166f 100644 --- a/gui/vehiclelist_frame.h +++ b/gui/vehiclelist_frame.h @@ -15,7 +15,6 @@ #include "components/gui_label.h" #include "components/gui_image.h" #include "components/gui_waytype_tab_panel.h" -#include "components/gui_table.h" #include "components/sortable_table_vehicle.h" #include "components/sortable_table_header.h" From 0790d21162b54a0ea1fd4232522ffbb50bd54ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 19 Jul 2024 23:58:46 +0900 Subject: [PATCH 13/32] FIX: The borders are slightly misaligned --- gui/components/sortable_table.cc | 2 +- gui/components/sortable_table_header.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index e02a9ecefa..ccd9d44c30 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -56,7 +56,7 @@ void table_cell_item_t::draw(scr_coord offset) display_fillbox_wh_clip_rgb(offset.x, offset.y, size.w, size.h, SYSCOL_TD_BACKGROUND_HIGHLIGHT, false); } // draw border - display_ddd_box_clip_rgb(offset.x-1, offset.y-1, size.w+1, size.h+1, SYSCOL_TD_BORDER, SYSCOL_TD_BORDER); + display_ddd_box_clip_rgb(offset.x, offset.y-1, size.w+1, size.h+1, SYSCOL_TD_BORDER, SYSCOL_TD_BORDER); } diff --git a/gui/components/sortable_table_header.cc b/gui/components/sortable_table_header.cc index 2202ae1eb4..57bfb28ee4 100644 --- a/gui/components/sortable_table_header.cc +++ b/gui/components/sortable_table_header.cc @@ -35,7 +35,7 @@ void sortable_header_cell_t::draw(scr_coord offset) display_fillbox_wh_clip_rgb(pos.x + offset.x + 1, pos.y + offset.y + 1, get_size().w - 2, get_size().h - 2, SYSCOL_TH_BACKGROUND_SELECTED, false); } PIXVAL text_color = selected ? SYSCOL_TH_TEXT_SELECTED : SYSCOL_TH_TEXT_TOP; - display_ddd_box_clip_rgb(pos.x + offset.x, pos.y + offset.y, get_size().w, get_size().h, SYSCOL_TH_BORDER, SYSCOL_TH_BORDER); + display_ddd_box_clip_rgb(pos.x + offset.x, pos.y + offset.y, get_size().w+1, get_size().h, SYSCOL_TH_BORDER, SYSCOL_TH_BORDER); // draw text const scr_rect area(offset + pos, size-scr_size(5,0)); From d1c7e574a183cea22864a2f02059828fe425733a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 00:00:21 +0900 Subject: [PATCH 14/32] FIX: the layout will be broken if the height is small --- gui/vehiclelist_frame.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/vehiclelist_frame.cc b/gui/vehiclelist_frame.cc index c26feb8c49..55c86e7919 100644 --- a/gui/vehiclelist_frame.cc +++ b/gui/vehiclelist_frame.cc @@ -64,6 +64,7 @@ vehiclelist_frame_t::vehiclelist_frame_t() : cont_sortable.set_margin(NO_SPACING, NO_SPACING); cont_sortable.set_spacing(NO_SPACING); cont_sortable.set_table_layout(1,2); + cont_sortable.set_alignment(ALIGN_TOP); // Without this, the layout will be broken if the height is small. cont_sortable.add_component(&table_header); cont_sortable.add_component(&scrolly); From 2d997e2708716129c9d43ccc6fa059e3564154f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 00:08:56 +0900 Subject: [PATCH 15/32] =?UTF-8?q?=F0=9F=92=B0=F0=9F=9A=83=20NEW:=20Vehicle?= =?UTF-8?q?=20trading=20between=20players?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 1 + Simutrans-Extended.vcxproj | 2 + cmake/SimutransSourceList.cmake | 1 + gui/components/gui_convoy_assembler.cc | 11 + gui/components/gui_convoy_assembler.h | 2 + gui/components/gui_scrolled_list.cc | 5 +- gui/components/sortable_table_vehicle.cc | 94 ++++ gui/components/sortable_table_vehicle.h | 44 ++ gui/depot_frame.cc | 114 +++-- gui/depot_frame.h | 7 +- gui/depotlist_frame.cc | 4 + gui/depotlist_frame.h | 6 +- gui/simwin.cc | 4 + gui/simwin.h | 1 + gui/vehicle_manager.cc | 545 +++++++++++++++++++++++ gui/vehicle_manager.h | 108 +++++ simdepot.cc | 91 +++- simdepot.h | 26 +- simmenu.cc | 2 + simmenu.h | 1 + simtool.cc | 88 ++++ simtool.h | 8 + simversion.h | 2 +- simworld.cc | 34 +- simworld.h | 7 + 25 files changed, 1108 insertions(+), 100 deletions(-) create mode 100644 gui/vehicle_manager.cc create mode 100644 gui/vehicle_manager.h diff --git a/Makefile b/Makefile index 72ae214969..a83c9c4c61 100644 --- a/Makefile +++ b/Makefile @@ -496,6 +496,7 @@ SOURCES += gui/obj_info.cc SOURCES += gui/slim_obj_info.cc SOURCES += gui/vehicle_class_manager.cc SOURCES += gui/vehicle_detail.cc +SOURCES += gui/vehicle_manager.cc SOURCES += gui/water_info.cc SOURCES += gui/way_info.cc SOURCES += gui/welt.cc diff --git a/Simutrans-Extended.vcxproj b/Simutrans-Extended.vcxproj index d7bcc2c3dc..99d6563fdb 100644 --- a/Simutrans-Extended.vcxproj +++ b/Simutrans-Extended.vcxproj @@ -1941,6 +1941,7 @@ + true @@ -2633,6 +2634,7 @@ + diff --git a/cmake/SimutransSourceList.cmake b/cmake/SimutransSourceList.cmake index e04627b7f3..12d7350ad0 100644 --- a/cmake/SimutransSourceList.cmake +++ b/cmake/SimutransSourceList.cmake @@ -232,6 +232,7 @@ target_sources(simutrans-extended PRIVATE gui/vehiclelist_frame.cc gui/vehicle_class_manager.cc gui/vehicle_detail.cc + gui/vehicle_manager.cc gui/water_info.cc gui/way_info.cc gui/welt.cc diff --git a/gui/components/gui_convoy_assembler.cc b/gui/components/gui_convoy_assembler.cc index ac7f49b13d..4c5a72c727 100644 --- a/gui/components/gui_convoy_assembler.cc +++ b/gui/components/gui_convoy_assembler.cc @@ -577,6 +577,7 @@ gui_convoy_assembler_t::gui_convoy_assembler_t(depot_frame_t *frame) : scrolly_waggons(&waggons) { depot_frame = frame; + old_stored_vehicles = depot_frame->get_depot()->get_vehicle_list().get_count(); replace_frame = NULL; } @@ -707,6 +708,7 @@ void gui_convoy_assembler_t::init(waytype_t wt, signed char player_nr, bool elec bt_class_management.set_image(skinverwaltung_t::open_window->get_image_id(0)); bt_class_management.set_image_position_right(true); } + bt_class_management.set_rigid(true); bt_class_management.add_listener(this); add_component(&bt_class_management); } @@ -2269,6 +2271,15 @@ void gui_convoy_assembler_t::draw(scr_coord offset) { if (depot_frame==NULL && replace_frame==NULL) return; + if (depot_frame){ + bt_class_management.set_visible(vehicles.get_count()); + + if( old_stored_vehicles != depot_frame->get_depot()->get_vehicle_list().get_count()) { + old_stored_vehicles=depot_frame->get_depot()->get_vehicle_list().get_count(); + build_vehicle_lists(); + } + } + update_vehicle_info_text(pos+offset); const uint8 player_nr = depot_frame ? depot_frame->get_depot()->get_owner_nr() : replace_frame->get_player_nr(); diff --git a/gui/components/gui_convoy_assembler.h b/gui/components/gui_convoy_assembler.h index be49b59c03..f19b9f32b3 100644 --- a/gui/components/gui_convoy_assembler.h +++ b/gui/components/gui_convoy_assembler.h @@ -121,6 +121,8 @@ class gui_convoy_assembler_t : public gui_aligned_container_t, public gui_action uint16 livery_scheme_index=UINT16_MAX; + uint32 old_stored_vehicles = 0; // update vehicle list triggar + // The selected convoy so far... vector_tpl vehicles; diff --git a/gui/components/gui_scrolled_list.cc b/gui/components/gui_scrolled_list.cc index 3a58f9cefd..2b93599b07 100644 --- a/gui/components/gui_scrolled_list.cc +++ b/gui/components/gui_scrolled_list.cc @@ -89,6 +89,7 @@ gui_scrolled_list_t::gui_scrolled_list_t(enum type type, item_compare_func cmp) { container.set_table_layout(1,0); container.set_spacing(NO_SPACING); // Spaces between components create spaces that do not accept clicks + container.set_margin(scr_size(D_H_SPACE, 0), scr_size(D_SCROLLBAR_HEIGHT, D_SCROLLBAR_WIDTH)); set_component(&container); @@ -202,8 +203,8 @@ void gui_scrolled_list_t::set_size(scr_size size) void gui_scrolled_list_t::reset_container_size() { // reset element positioning - container.set_margin( scr_size( D_H_SPACE, 0 ), scr_size( D_H_SPACE, 0 ) ); - container.set_spacing( scr_size( D_H_SPACE, 0 ) ); + container.set_margin( scr_size( D_H_SPACE, 0 ), scr_size( D_SCROLLBAR_HEIGHT, D_SCROLLBAR_WIDTH ) ); + container.set_spacing( NO_SPACING ); // Spaces between components create spaces that do not accept clicks scr_size csize = container.get_min_size(); diff --git a/gui/components/sortable_table_vehicle.cc b/gui/components/sortable_table_vehicle.cc index af99fdde45..6a9e643fe2 100644 --- a/gui/components/sortable_table_vehicle.cc +++ b/gui/components/sortable_table_vehicle.cc @@ -27,6 +27,9 @@ #include "../vehicle_detail.h" #include "../../descriptor/intro_dates.h" +int vehicle_row_t::sort_mode = vehicle_row_t::VH_PURCHASE_DATE; +bool vehicle_row_t::sortreverse = false; + int vehicle_desc_row_t::sort_mode = vehicle_desc_row_t::VD_SPEED; bool vehicle_desc_row_t::sortreverse = false; bool vehicle_desc_row_t::side_view_mode = true; @@ -267,6 +270,77 @@ void vehicle_desc_row_t::draw(scr_coord offset) } +vehicle_row_t::vehicle_row_t(vehicle_t* v) +{ + veh = v; + const vehicle_desc_t* veh_type = veh->get_desc(); + + tooltip_buf.printf(veh_type->get_name()); + + // 1. image + new_component(veh_type->get_image_id(ribi_t::dir_southwest, goods_manager_t::none, veh->get_current_livery()), veh_type->get_name()); + // 2. color bar + new_component(veh_type); + // 3. value + new_component((sint64)veh->calc_sale_value(), gui_chart_t::MONEY, table_cell_item_t::right); + // 4. enigine type + new_component(veh_type->get_engine_type()); + // 5. power + new_component((sint64)veh_type->get_power(), gui_chart_t::KW, table_cell_item_t::right); + // 6. force + new_component((sint64)veh_type->get_tractive_effort(), gui_chart_t::FORCE, table_cell_item_t::right); + // 7. speed + new_component((sint64)veh_type->get_topspeed(), gui_chart_t::KMPH, table_cell_item_t::right); + // 8. catg + new_component(veh_type); + // 9. capacity + new_component((sint64)veh_type->get_total_capacity(), veh_type->get_overcrowded_capacity()); + // 10. weight + new_component((sint64)veh_type->get_weight(), gui_chart_t::TONNEN, table_cell_item_t::right); + // 11. axle load + new_component(veh_type->get_waytype()==water_wt ? 0: (sint64)veh_type->get_axle_load()*1000, gui_chart_t::TONNEN, table_cell_item_t::right); + // 12. purchase date + new_component((sint64)veh->get_purchase_time(), gui_chart_t::TIME, table_cell_item_t::right); + // 13. intro date + PIXVAL status_color = veh_type->get_vehicle_status_color(); + new_component((sint64)veh_type->get_intro_year_month(), gui_chart_t::TIME, table_cell_item_t::right, status_color==COL_SAFETY ? SYSCOL_TEXT : status_color); + // owner + //new_component(veh->get_owner()->get_name()); + + //init cell height + for (auto& cell : owned_cells) { + cell->set_height(row_height); + } +} + + +bool vehicle_row_t::infowin_event(const event_t* ev) +{ + bool swallowed = gui_scrolled_list_t::scrollitem_t::infowin_event(ev); + if( !swallowed && veh && IS_RIGHTRELEASE(ev) ) { + vehicle_detail_t* win = dynamic_cast(win_get_magic(magic_vehicle_detail)); + if (!win) { + create_win(new vehicle_detail_t(veh->get_desc()), w_info, magic_vehicle_detail); + } + else { + win->set_vehicle(veh->get_desc()); + top_win(win, false); + } + return false; + } + return swallowed; +} + +void vehicle_row_t::draw(scr_coord offset) +{ + gui_sort_table_row_t::draw(offset); + // show tooltip + if (getroffen(get_mouse_pos() - offset)) { + win_set_tooltip(get_mouse_pos() + TOOLTIP_MOUSE_OFFSET, tooltip_buf, this); + } +} + + bool vehicle_desc_row_t::compare(const gui_component_t* aa, const gui_component_t* bb) { const vehicle_desc_row_t* row_a = dynamic_cast(aa); @@ -286,3 +360,23 @@ bool vehicle_desc_row_t::compare(const gui_component_t* aa, const gui_component_ int cmp = gui_sort_table_row_t::compare(a, b); return sortreverse ? cmp < 0 : cmp > 0; // Do not include 0 } + +bool vehicle_row_t::compare(const gui_component_t* aa, const gui_component_t* bb) +{ + const vehicle_row_t* row_a = dynamic_cast(aa); + const vehicle_row_t* row_b = dynamic_cast(bb); + if (row_a == NULL || row_b == NULL) { + dbg->warning("vehicle_row_t::compare()", "row data error"); + return false; + } + + const table_cell_item_t* a = row_a->get_element(sort_mode); + const table_cell_item_t* b = row_b->get_element(sort_mode); + if (a == NULL || b == NULL) { + dbg->warning("vehicle_row_t::compare()", "Could not get table_cell_item_t successfully"); + return false; + } + + int cmp = gui_sort_table_row_t::compare(a, b); + return sortreverse ? cmp < 0 : cmp > 0; // Do not include 0 +} diff --git a/gui/components/sortable_table_vehicle.h b/gui/components/sortable_table_vehicle.h index 0e92f81e13..3fbab2d03c 100644 --- a/gui/components/sortable_table_vehicle.h +++ b/gui/components/sortable_table_vehicle.h @@ -123,5 +123,49 @@ class vehicle_desc_row_t : public gui_sort_table_row_t static bool compare(const gui_component_t* aa, const gui_component_t* bb); }; +// Generate list based on vehicle_t instead of vehicle_desc +class vehicle_row_t : public gui_sort_table_row_t +{ +public: + //VD_xxx : Fields that reference vehicle_desc + //VH_xxx : Fields that reference vehicle_t + enum sort_mode_t { + VD_LENGTH, // image with livery + VD_STATUSBAR, + VH_COST, + VD_ENGINE_TYPE, + VD_POWER, + VD_TRACTIVE_FORCE, + VD_SPEED, + VD_FREIGHT_TYPE, + VD_CAPACITY, + VD_WEIGHT, + VD_AXLE_LOAD, + VH_PURCHASE_DATE, + VD_INTRO_DATE, + MAX_COLS + }; + + static int sort_mode; + static bool sortreverse; + +private: + vehicle_t* veh; + cbuffer_t tooltip_buf; + +public: + vehicle_row_t(vehicle_t* v); + + vehicle_t* get_vehicle() const { return veh; } + + char const* get_text() const OVERRIDE { return veh->get_desc()->get_name(); } + + bool infowin_event(event_t const* ev) OVERRIDE; + + void draw(scr_coord offset) OVERRIDE; + + static bool compare(const gui_component_t* aa, const gui_component_t* bb); +}; + #endif diff --git a/gui/depot_frame.cc b/gui/depot_frame.cc index 8c9208706c..b42049f531 100644 --- a/gui/depot_frame.cc +++ b/gui/depot_frame.cc @@ -51,6 +51,7 @@ #include "depot_frame.h" #include "convoi_detail_t.h" +#include "vehicle_manager.h" bool depot_frame_t::compare_line(linehandle_t const& a, linehandle_t const& b) @@ -111,7 +112,7 @@ depot_frame_t::depot_frame_t(depot_t* depot) : void depot_frame_t::init(depot_t *dep) { depot = dep; - reset_depot_name(); + set_name(translator::translate(depot->get_name())); set_owner(depot->get_owner()); icnv = depot->convoi_count()-1; @@ -184,21 +185,31 @@ void depot_frame_t::init_table() set_margin(scr_size(0,0), scr_size(0,0)); add_table(1,0)->set_margin(scr_size(D_MARGIN_LEFT, D_MARGIN_TOP), scr_size(D_MARGIN_RIGHT, 0)); - add_table(3,1); + add_table(5,1); { - name_input.set_text(name, sizeof(name)); - name_input.add_listener(this); - add_component(&name_input); - // Bolt image for electrified depots: img_bolt.set_image(skinverwaltung_t::electricity->get_image_id(0), true); img_bolt.set_rigid(true); add_component(&img_bolt); lb_traction_types.set_color(SYSCOL_TRACTION_TYPE); add_component(&lb_traction_types); + + new_component(); + + lb_vehicle_count.init(SYSCOL_TEXT, gui_label_t::right); + add_component(&lb_vehicle_count); + + bt_manage.init(button_t::roundbox_state | button_t::flexible, "veh_mgr"); + if (skinverwaltung_t::open_window) { + bt_manage.set_image(skinverwaltung_t::open_window->get_image_id(0)); + bt_manage.set_image_position_right(true); + } + bt_manage.add_listener(this); + bt_manage.set_tooltip("Open the vehicle management window"); + add_component(&bt_manage); } end_table(); - add_table(3,2); + add_table(2,2); { // text will be translated by ourselves (after update data)! add_component(&lb_convois); @@ -206,8 +217,6 @@ void depot_frame_t::init_table() convoy_selector.set_highlight_color(color_idx_to_rgb(depot->get_owner()->get_player_color1() + 1)); convoy_selector.add_listener(this); add_component(&convoy_selector); - lb_vehicle_count.init(SYSCOL_TEXT,gui_label_t::right); - add_component(&lb_vehicle_count); /* * [SELECT ROUTE]: @@ -228,32 +237,38 @@ void depot_frame_t::init_table() } end_table(); - line_selector.add_listener(this); - line_selector.set_highlight_color( color_idx_to_rgb(depot->get_owner()->get_player_color1() + 1)); - line_selector.set_wrapping(false); - line_selector.set_focusable(true); - add_component(&line_selector); - - add_table(3,1)->set_spacing(scr_size(0,0)); + add_table(2, 1); { - // [freight type filter buttons] - filter_btn_all_pas.init(button_t::roundbox_state, NULL, scr_coord(0,0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); - filter_btn_all_pas.set_image(skinverwaltung_t::passengers->get_image_id(0)); - filter_btn_all_pas.set_tooltip("filter_pas_line"); - filter_btn_all_pas.add_listener(this); - add_component(&filter_btn_all_pas); - - filter_btn_all_mails.init(button_t::roundbox_state, NULL, scr_coord(0,0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); - filter_btn_all_mails.set_image(skinverwaltung_t::mail->get_image_id(0)); - filter_btn_all_mails.set_tooltip("filter_mail_line"); - filter_btn_all_mails.add_listener(this); - add_component(&filter_btn_all_mails); - - filter_btn_all_freights.init(button_t::roundbox_state, NULL, scr_coord(0,0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); - filter_btn_all_freights.set_image(skinverwaltung_t::goods->get_image_id(0)); - filter_btn_all_freights.set_tooltip("filter_freight_line"); - filter_btn_all_freights.add_listener(this); - add_component(&filter_btn_all_freights); + line_selector.add_listener(this); + line_selector.set_highlight_color( color_idx_to_rgb(depot->get_owner()->get_player_color1() + 1)); + line_selector.set_wrapping(false); + line_selector.set_focusable(true); + add_component(&line_selector); + + add_table(3,1)->set_spacing(scr_size(0,0)); + { + // [freight type filter buttons] + filter_btn_all_pas.init(button_t::imagebox_state, NULL, scr_coord(0,0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); + filter_btn_all_pas.set_image(skinverwaltung_t::passengers->get_image_id(0)); + filter_btn_all_pas.set_tooltip(translator::translate("filter_pas_line")); + filter_btn_all_pas.set_no_translate(false); + filter_btn_all_pas.add_listener(this); + add_component(&filter_btn_all_pas); + + filter_btn_all_mails.init(button_t::imagebox_state, NULL, scr_coord(0,0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); + filter_btn_all_mails.set_image(skinverwaltung_t::mail->get_image_id(0)); + filter_btn_all_mails.set_tooltip("filter_mail_line"); + filter_btn_all_mails.set_no_translate(false); + filter_btn_all_mails.add_listener(this); + add_component(&filter_btn_all_mails); + + filter_btn_all_freights.init(button_t::imagebox_state, NULL, scr_coord(0,0), scr_size(D_BUTTON_HEIGHT, D_BUTTON_HEIGHT)); + filter_btn_all_freights.set_image(skinverwaltung_t::goods->get_image_id(0)); + filter_btn_all_freights.set_tooltip("filter_freight_line"); + filter_btn_all_freights.add_listener(this); + add_component(&filter_btn_all_freights); + } + end_table(); } end_table(); } @@ -476,34 +491,12 @@ void depot_frame_t::build_line_list() } -void depot_frame_t::rename_depot() -{ - const char *t = name_input.get_text(); - // only change if old name and current name are the same - // otherwise some unintended undo if renaming would occur - if( t && t[0] && strcmp(t, depot->get_name()) && strcmp(old_name, depot->get_name())==0) { - // text changed => call tool - cbuffer_t buf; - buf.printf("d%s,%s", depot->get_pos().get_str(), t); - tool_t *tool = create_tool(TOOL_RENAME | SIMPLE_TOOL); - tool->set_default_param(buf); - welt->set_tool(tool, depot->get_owner()); - // since init always returns false, it is safe to delete immediately - delete tool; - // do not trigger this command again - tstrncpy(old_name, depot->get_name(), sizeof(old_name)); - } -} - void depot_frame_t::reset_depot_name() { - tstrncpy(old_name, depot->get_name(), sizeof(old_name)); - tstrncpy(name, depot->get_name(), sizeof(name)); set_name(translator::translate(depot->get_name())); } - sint64 depot_frame_t::calc_sale_value(const vehicle_desc_t *veh_type) { sint64 wert = 0; @@ -593,6 +586,10 @@ bool depot_frame_t::action_triggered( gui_action_creator_t *comp, value_t p) create_win({ 20, 20 }, new convoi_detail_t(cnv), w_info, magic_convoi_detail + cnv.get_id()); return true; } + else if (comp == &bt_manage) { + create_win({ 20, 20 }, new vehicle_manager_t(depot), w_info, magic_vehicle_manager + depot->get_owner_nr()); + return true; + } else if( comp == &bt_copy_convoi ) { if( cnv.is_bound() && cnv->all_vehicles_are_buildable()) @@ -689,10 +686,6 @@ bool depot_frame_t::action_triggered( gui_action_creator_t *comp, value_t p) build_line_list(); return true; } - else if (comp == &name_input) { - // send rename command if necessary - rename_depot(); - } else { return false; } @@ -787,6 +780,7 @@ void depot_frame_t::draw(scr_coord pos, scr_size size) bt_start.enable( action_allowed ); bt_schedule.enable( action_allowed ); bt_sell.enable( action_allowed ); + bt_manage.enable(action_allowed); convoihandle_t cnv = depot->get_convoi(icnv); line_button.enable( action_allowed && cnv.is_bound() && cnv->get_line().is_bound() ); diff --git a/gui/depot_frame.h b/gui/depot_frame.h index 6110450281..10c81d0dc2 100644 --- a/gui/depot_frame.h +++ b/gui/depot_frame.h @@ -51,9 +51,6 @@ class depot_frame_t : public gui_frame_t, public action_listener_t */ gui_label_buf_t lb_convois, lb_vehicle_count, lb_traction_types; - char name[256], old_name[256]; - gui_textinput_t name_input; - /// contains the current translation of "new convoi" const char* new_convoy_text; gui_combobox_t convoy_selector; @@ -63,6 +60,7 @@ class depot_frame_t : public gui_frame_t, public action_listener_t button_t bt_schedule; button_t bt_sell; button_t bt_details; + button_t bt_manage; cbuffer_t txt_convoi_cost; @@ -111,9 +109,6 @@ class depot_frame_t : public gui_frame_t, public action_listener_t static bool compare_line(linehandle_t const& l1, linehandle_t const& l2); - /// Renames the depot to the name given in the text input field - void rename_depot(); - public: // the next two are only needed for depot_t update notifications void activate_convoi( convoihandle_t cnv ); diff --git a/gui/depotlist_frame.cc b/gui/depotlist_frame.cc index 4aef052e57..e933a49535 100644 --- a/gui/depotlist_frame.cc +++ b/gui/depotlist_frame.cc @@ -150,6 +150,10 @@ void depotlist_stats_t::update_label() else { lb_vh_count.buf().printf( translator::translate( "%d vehicles" ), vhls ); } + if(uint32 for_sale_cnt=depot->get_vehicles_for_sale().get_count()){ + lb_vh_count.buf().printf("(%u)", for_sale_cnt); + } + lb_vh_count.update(); } diff --git a/gui/depotlist_frame.h b/gui/depotlist_frame.h index 422bf3c64d..92caa9be3e 100644 --- a/gui/depotlist_frame.h +++ b/gui/depotlist_frame.h @@ -66,7 +66,11 @@ class depotlist_stats_t : public gui_aligned_container_t, public gui_scrolled_li { private: depot_t *depot; - gui_label_buf_t lb_name, lb_cnv_count, lb_vh_count, lb_region; + gui_label_buf_t + lb_name, + lb_cnv_count, + lb_vh_count, + lb_region; gui_image_t waytype_symbol; button_t gotopos; diff --git a/gui/simwin.cc b/gui/simwin.cc index 1c7c90efb6..8e413172bd 100644 --- a/gui/simwin.cc +++ b/gui/simwin.cc @@ -78,6 +78,7 @@ #include "optionen.h" #include "vehicle_class_manager.h" #include "player_ranking_frame.h" +#include "vehicle_manager.h" #include "../simversion.h" @@ -674,6 +675,9 @@ void rdwr_all_win(loadsave_t *file) else if (id >= magic_depotlist && id < magic_depotlist + MAX_PLAYER_COUNT) { w = new depotlist_frame_t(wl->get_player(id - magic_depotlist)); } + //else if (id >= magic_vehicle_manager && id < magic_vehicle_manager + MAX_PLAYER_COUNT) { + // w = new vehicle_manager_t(); // TODO: support_rdwr + //} else if( id>=magic_replace && id < magic_replace +0x10000 ) { w = new replace_frame_t(); } diff --git a/gui/simwin.h b/gui/simwin.h index 7fcc017ea1..356c3e228d 100644 --- a/gui/simwin.h +++ b/gui/simwin.h @@ -134,6 +134,7 @@ enum magic_numbers { magic_pier_rotation_select, magic_depot, // only used to load/save magic_replace_line, + magic_vehicle_manager = magic_replace_line + MAX_PLAYER_COUNT, magic_consist_order, magic_script_error, magic_max diff --git a/gui/vehicle_manager.cc b/gui/vehicle_manager.cc new file mode 100644 index 0000000000..46730a547d --- /dev/null +++ b/gui/vehicle_manager.cc @@ -0,0 +1,545 @@ +/* + * This file is part of the Simutrans-Extended project under the Artistic License. + * (see LICENSE.txt) + */ + +#include "vehicle_manager.h" +#include "vehicle_detail.h" + +#include "../simworld.h" +#include "../simmenu.h" +#include "../convoy.h" + +#include "../bauer/goods_manager.h" +#include "../bauer/vehikelbauer.h" +#include "../display/viewport.h" +#include "../descriptor/vehicle_desc.h" +#include "../descriptor/intro_dates.h" +#include "../utils/simstring.h" +#include "components/gui_colorbox.h" +#include "components/gui_divider.h" +#include "components/gui_waytype_image_box.h" + +#include "vehiclelist_frame.h" + + +static const char* const vl_header_text[vehicle_row_t::MAX_COLS] = +{ + "Name", "", "Wert", "engine_type", + "Leistung", "TF_", "Max. speed", "", "Capacity", + "curb_weight", "Axle load:", "Built date", "Intro. date" +}; + + +vehicle_manager_t::vehicle_manager_t(depot_t* dep) : + gui_frame_t(""), + scrolly(gui_scrolled_list_t::windowskin, vehicle_row_t::compare), + scroll_sortable(&cont_sortable, true, true) +{ + old_selections = 0; + old_vhicles = 0; + + if (dep) { + depot=dep; + gui_frame_t::set_name(translator::translate("vehicle_management")); + gui_frame_t::set_owner(depot->get_owner()); + set_table_layout(1, 0); + init_table(); + } +} + +void vehicle_manager_t::reset_depot_name() +{ + tstrncpy(old_name, depot->get_name(), sizeof(old_name)); + tstrncpy(name, depot->get_name(), sizeof(name)); + set_name(translator::translate(depot->get_name())); +} + +void vehicle_manager_t::update_list() +{ + old_month = world()->get_current_month(); + scrolly.clear_elements(); + + old_listed_vehicles=world()->get_listed_vehicle_number(depot->get_waytype()); + if (dep_action==da_buy) { + if (old_listed_vehicles-depot->get_vehicles_for_sale().get_count()) { + player_t *player=depot->get_owner(); + for (depot_t* const other_depot : depot_t::get_depot_list()) { + // filter + if (player == other_depot->get_owner()) continue; + if (depot->get_waytype() != other_depot->get_waytype()) continue; + + for (auto vehicle : other_depot->get_vehicles_for_sale()) { + // Check if this depot can accept the vehicle + if( !depot->is_suitable_for( vehicle, vehicle->get_desc()->get_traction_type(), true ) ) continue; + scrolly.new_component(vehicle); + } + } + } + } + else { + for (auto vehicle : dep_action==da_cancel_listing ? depot->get_vehicles_for_sale() : depot->get_vehicle_list()){ + scrolly.new_component(vehicle); + } + } + scrolly.set_selection(-1); + scrolly.sort(0); + // recalc stats table width + scr_coord_val max_widths[vehicle_row_t::MAX_COLS]={}; + + // check column widths + table_header.set_selection(vehicle_row_t::sort_mode); + table_header.set_width(D_H_SPACE); // init width + for (uint c = 0; c < vehicle_row_t::MAX_COLS; c++) { + // get header widths + max_widths[c] = table_header.get_min_width(c); + } + for (int r = 0; r < scrolly.get_count(); r++) { + vehicle_row_t* row = (vehicle_row_t*)scrolly.get_element(r); + for (uint c=0; cget_min_width(c)); + } + } + + // set column widths + for (uint c = 0; c < vehicle_row_t::MAX_COLS; c++) { + table_header.set_col(c, max_widths[c]); + } + table_header.set_width(table_header.get_size().w+D_SCROLLBAR_WIDTH); + + for (int r = 0; r < scrolly.get_count(); r++) { + vehicle_row_t* row = (vehicle_row_t*)scrolly.get_element(r); + row->set_size(scr_size(0, row->get_size().h)); + for (uint c = 0; c < vehicle_row_t::MAX_COLS; c++) { + row->set_col(c, max_widths[c]); + } + } + + old_vhicles = depot->get_vehicle_list().get_count(); + lb_vehicle_count.buf().clear(); + if (old_vhicles == 0) { + lb_vehicle_count.buf().append( translator::translate( "Keine Einzelfahrzeuge im Depot" ) ); + } + else { + lb_vehicle_count.buf().append(translator::translate("Stored")); + lb_vehicle_count.buf().append(": "); + if (old_vhicles == 1) { + lb_vehicle_count.buf().append(translator::translate("1 vehicle")); + } + else { + lb_vehicle_count.buf().printf(translator::translate("%d vehicles"), old_vhicles); + } + } + uint32 for_sale_cnt = depot->get_vehicles_for_sale().get_count(); + if (for_sale_cnt) { + if (old_vhicles) { + lb_vehicle_count.buf().append(", "); + } + lb_vehicle_count.buf().append(translator::translate("Listed")); + lb_vehicle_count.buf().append(": "); + if (for_sale_cnt == 1) { + lb_vehicle_count.buf().append(translator::translate("1 vehicle")); + } + else { + lb_vehicle_count.buf().printf(translator::translate("%d vehicles"), for_sale_cnt); + } + } + lb_vehicle_count.update(); + resize(scr_size(0, 0)); + + bt_mode_scrap.enable(old_vhicles); + bt_mode_sell.enable(old_vhicles); + bt_mode_cancel_listing.enable(for_sale_cnt); + bt_mode_buy.enable( old_listed_vehicles - for_sale_cnt ); + + scroll_sortable.set_visible(scrolly.get_count()); + + calc_total_cost(); +} + +void vehicle_manager_t::init_table() +{ + if (depot == NULL) { + destroy_win(this); + } + + reset_depot_name(); + + scrolly.add_listener(this); + scrolly.set_show_scroll_x(false); + scrolly.set_multiple_selection(2); + scrolly.set_checkered(true); + scrolly.set_scroll_amount_y(LINESPACE + D_H_SPACE +2); // default cell height + + scroll_sortable.set_rigid(true); + scroll_sortable.set_maximize(true); + + table_header.add_listener(this); + for (uint8 col=0; col(vl_header_text[col]); + } + + cont_sortable.set_margin(NO_SPACING, NO_SPACING); + cont_sortable.set_spacing(NO_SPACING); + cont_sortable.set_table_layout(1,2); + cont_sortable.set_alignment(ALIGN_TOP); // Without this, the layout will be broken if the height is small. + cont_sortable.add_component(&table_header); + cont_sortable.add_component(&scrolly); + + add_table(3,1); + { + new_component(depot->get_waytype()); + name_input.set_text(name, sizeof(name)); + name_input.add_listener(this); + add_component(&name_input); + + gui_label_buf_t *lb = new_component(); + if (depot->get_traction_types() == 0) + { + lb->buf().printf("%s", translator::translate("Unpowered vehicles only")); + } + else if (depot->get_traction_types() == 65535) + { + lb->buf().printf("%s", translator::translate("All traction types")); + } + else + { + uint16 shifter; + bool first = true; + for (uint16 i = 0; i < (vehicle_desc_t::MAX_TRACTION_TYPE); i++) + { + shifter = 1 << i; + if ((shifter & depot->get_traction_types())) + { + if (first) + { + first = false; + lb->buf().clear(); + } + else + { + lb->buf().printf(", "); + } + lb->buf().printf("%s", translator::translate(vehicle_builder_t::engine_type_names[(vehicle_desc_t::engine_t)(i + 1)])); + } + } + } + } + end_table(); + + add_table(2, 1); + { + add_component(&lb_vehicle_count); + new_component(); + } + end_table(); + + add_table(8,1)->set_spacing(NO_SPACING); + { + bt_mode_scrap.init(button_t::roundbox_left_state, translator::translate("Scrap")); + bt_mode_scrap.pressed=true; + bt_mode_scrap.add_listener(this); + add_component(&bt_mode_scrap); + bt_mode_sell.init(button_t::roundbox_middle_state, translator::translate("Sell")); + bt_mode_sell.add_listener(this); + add_component(&bt_mode_sell); + bt_mode_cancel_listing.init(button_t::roundbox_middle_state, translator::translate("Listed")); + bt_mode_cancel_listing.add_listener(this); + add_component(&bt_mode_cancel_listing); + bt_mode_buy.init(button_t::roundbox_right_state, translator::translate("Buy")); + bt_mode_buy.add_listener(this); + add_component(&bt_mode_buy); + + new_component(LINESPACE); + bt_sel_all.init(button_t::roundbox, translator::translate("clf_btn_alle")); + bt_sel_all.add_listener(this); + add_component(&bt_sel_all); + bt_reset.init(button_t::roundbox, translator::translate("clf_btn_keine")); + bt_reset.add_listener(this); + add_component(&bt_reset); + new_component(); + } + end_table(); + + add_component(&scroll_sortable); + update_list(); + add_component(&lb_total_cost); + bt_execute.init(button_t::roundbox, "execute_scrap"); + bt_execute.add_listener(this); + add_component(&bt_execute); + + set_resizemode(diagonal_resize); + reset_min_windowsize(); + resize(scr_size(0,0)); +} + +void vehicle_manager_t::calc_total_cost() +{ + last_selected = scrolly.get_selection(); // current focused one + old_selections = scrolly.get_selections().get_count(); // selected vehicle count + if ( bt_mode_cancel_listing.pressed ){ + lb_total_cost.buf().append(translator::translate("Cancel the listing request for the selected vehicles")); + } + else { + sint64 total=0; + for (auto i : scrolly.get_selections()) { + vehicle_row_t* vr = (vehicle_row_t*)scrolly.get_element(i); + vehicle_t* veh = vr->get_vehicle(); + total += (sint64)veh->calc_sale_value(); + } + + char number[64]; + money_to_string(number, total / 100.0); + if (bt_mode_buy.pressed) { + lb_total_cost.buf().printf("%s: ", translator::translate("Price")); + } + else { + lb_total_cost.buf().printf("%s ", translator::translate("Restwert:")); + } + lb_total_cost.buf().append(number); + } + lb_total_cost.update(); + lb_total_cost.set_size(lb_total_cost.get_min_size()); // When the width is increased, the text may be cut off. + + bt_execute.enable(old_selections); +} + +void vehicle_manager_t::scrap_vehicles() +{ + // standard's code only allows players to sell the newest vehicle, + // but this UI requires players to sell the specific vehicle selected precisely. + uint16 stored_idx= (uint16)depot->get_vehicle_list().get_count(); + // The process is done backwards so that the vehicle index does not change. + for (uint16 stored_idx = depot->get_vehicle_list().get_count(); stored_idx>0; stored_idx--) { + vehicle_t *veh = depot->get_vehicle_list().at(stored_idx-1); + for (auto i : scrolly.get_selections()) { + vehicle_row_t* vi = (vehicle_row_t*)scrolly.get_element(i); + if (vi->get_vehicle() && vi->get_vehicle() == veh) { + depot->call_depot_tool('S', convoihandle_t(), vi->get_text(), stored_idx-1); + break; // check next + } + } + } +} + +void vehicle_manager_t::offer_vehicles_for_sale() +{ + uint16 stored_idx = (uint16)depot->get_vehicle_list().get_count(); + // The process is done backwards so that the vehicle index does not change. + for (uint16 stored_idx = depot->get_vehicle_list().get_count(); stored_idx>0; stored_idx--) { + vehicle_t *veh = depot->get_vehicle_list().at(stored_idx-1); + for (auto i : scrolly.get_selections()) { + vehicle_row_t* vi = (vehicle_row_t*)scrolly.get_element(i); + if (vi->get_vehicle() && vi->get_vehicle() == veh) { + depot->call_depot_tool('f', convoihandle_t(), vi->get_text(), stored_idx-1); + break; // check next + } + } + } +} + +void vehicle_manager_t::cancel_vehicles_for_sale() +{ + // The process is done backwards so that the vehicle index does not change. + for (uint16 listed_idx = depot->get_vehicles_for_sale().get_count(); listed_idx >0; listed_idx--) { + vehicle_t *veh = depot->get_vehicles_for_sale().at(listed_idx-1); + for (auto i : scrolly.get_selections()) { + vehicle_row_t* vi = (vehicle_row_t*)scrolly.get_element(i); + if (vi->get_vehicle() && vi->get_vehicle() == veh) { + depot->call_depot_tool('F', convoihandle_t(), vi->get_text(), listed_idx -1); + break; // check next + } + } + } +} + +void vehicle_manager_t::takeover_vehicles() +{ + for (uint32 i=scrolly.get_selections().get_count(); i>0; i--) { + vehicle_row_t* vinfo = (vehicle_row_t*)scrolly.get_element(scrolly.get_selections().get_element(i-1)); + vehicle_t *veh = vinfo->get_vehicle(); + + if (grund_t* gr = welt->lookup(veh->get_pos())) { + if (depot_t* seller_dep = gr->get_depot()) { + uint32 j=0; + for (auto vj : seller_dep->get_vehicles_for_sale()) { + if (veh==vj) { + tool_t* tmp_tool = create_tool(TOOL_TRANSFER_VEHICLE | SIMPLE_TOOL); + cbuffer_t buf; + buf.append(seller_dep->get_pos().get_str()); + buf.append(","); + buf.append(depot->get_pos().get_str()); + buf.printf(",%u",j); + tmp_tool->set_default_param(buf); + welt->set_tool(tmp_tool, depot->get_owner()); + // since init always returns false, it is safe to delete immediately + delete tmp_tool; + break; + } + j++; + } + } + else { + dbg->warning("vehicle_manager_t::takeover_vehicles", "Depot not found at %s", veh->get_pos().get_fullstr()); + } + } + else { + dbg->warning("vehicle_manager_t::takeover_vehicles", "Invalid coord - %s", veh->get_pos().get_fullstr()); + } + } +} + + +void vehicle_manager_t::rename_depot() +{ + const char* t = name_input.get_text(); + // only change if old name and current name are the same + // otherwise some unintended undo if renaming would occur + if (t && t[0] && strcmp(t, depot->get_name()) && strcmp(old_name, depot->get_name()) == 0) { + // text changed => call tool + cbuffer_t buf; + buf.printf("d%s,%s", depot->get_pos().get_str(), t); + tool_t* tool = create_tool(TOOL_RENAME | SIMPLE_TOOL); + tool->set_default_param(buf); + welt->set_tool(tool, depot->get_owner()); + // since init always returns false, it is safe to delete immediately + delete tool; + // do not trigger this command again + tstrncpy(old_name, depot->get_name(), sizeof(old_name)); + + reset_depot_name(); + } +} + + +void vehicle_manager_t::draw(scr_coord pos, scr_size size) +{ + if (depot == NULL || depot->get_owner_nr() != world()->get_active_player_nr()) { + destroy_win(this); + } + + // update + if( depot->get_vehicle_list().get_count()!=old_vhicles + || old_month != world()->get_current_month() + || old_listed_vehicles != world()->get_listed_vehicle_number(depot->get_waytype()) ) { + update_list(); + } + + if( last_selected != scrolly.get_selection() || old_selections != scrolly.get_selections().get_count() ) { + calc_total_cost(); + } + + gui_frame_t::draw(pos, size); +} + +void vehicle_manager_t::init_mode_buttons() +{ + bt_mode_scrap.pressed = dep_action == da_scrap; + bt_mode_sell.pressed = dep_action == da_listing; + bt_mode_buy.pressed = dep_action == da_buy; + bt_mode_cancel_listing.pressed = dep_action == da_cancel_listing; + switch (dep_action) + { + default: + bt_execute.set_text("execute"); + break; + case da_scrap: + bt_execute.set_text("execute_scrap"); + break; + case da_listing: + bt_execute.set_text("execute_listing"); + break; + case da_cancel_listing: + bt_execute.set_text("cancel_the_listing"); + cancel_vehicles_for_sale(); + break; + case da_buy: + bt_execute.set_text("execute_purchase"); + takeover_vehicles(); + break; + } +} + + +bool vehicle_manager_t::action_triggered(gui_action_creator_t *comp, value_t v) +{ + if (depot->get_owner_nr() != world()->get_active_player_nr()) return false; + + if( comp==&bt_sel_all || comp == &bt_reset) { + const bool select = comp==&bt_sel_all; + for (int i=0; iselected = select; + } + scrolly.set_selection(-1); + } + bool need_update=false; + if( comp == &bt_mode_scrap ) { + need_update = (dep_action!=da_scrap && dep_action!=da_listing); + dep_action=da_scrap; + init_mode_buttons(); + } + if( comp == &bt_mode_sell ) { + need_update = (dep_action!=da_scrap && dep_action!=da_listing); + dep_action=da_listing; + init_mode_buttons(); + } + if( comp == &bt_mode_cancel_listing ) { + need_update= dep_action != da_cancel_listing; + dep_action=da_cancel_listing; + init_mode_buttons(); + } + if( comp==&bt_mode_buy) { + need_update = dep_action != da_buy; + dep_action= da_buy; + init_mode_buttons(); + } + if (need_update) { + update_list(); + return true; + } + if (comp == &table_header) { + vehicle_row_t::sort_mode = v.i; + table_header.set_selection(vehicle_row_t::sort_mode); + vehicle_row_t::sortreverse = table_header.is_reversed(); + scrolly.sort(0); + } + if (comp == &bt_execute) { + switch (dep_action) + { + default: + break; + case da_scrap: + scrap_vehicles(); + break; + case da_listing: + offer_vehicles_for_sale(); + break; + case da_cancel_listing: + cancel_vehicles_for_sale(); + break; + case da_buy: + takeover_vehicles(); + break; + } + } + else if (comp == &name_input) { + // send rename command if necessary + rename_depot(); + } + + return false; +} + + +// returns position of depot on the map +koord3d vehicle_manager_t::get_weltpos(bool) +{ + return depot->get_pos(); +} + + +bool vehicle_manager_t::is_weltpos() +{ + return (world()->get_viewport()->is_on_center(get_weltpos(false))); +} diff --git a/gui/vehicle_manager.h b/gui/vehicle_manager.h new file mode 100644 index 0000000000..b878e0923e --- /dev/null +++ b/gui/vehicle_manager.h @@ -0,0 +1,108 @@ +/* + * This file is part of the Simutrans-Extended project under the Artistic License. + * (see LICENSE.txt) + */ + +#ifndef GUI_VEHICLE_MANAGER_H +#define GUI_VEHICLE_MANAGER_H + + +#include "simwin.h" +#include "gui_frame.h" +#include "../simdepot.h" +#include "components/gui_button.h" +#include "components/gui_scrolled_list.h" +#include "components/gui_label.h" +#include "components/gui_image.h" +#include "components/gui_textinput.h" +#include "components/gui_table.h" +#include "components/sortable_table_vehicle.h" +#include "components/sortable_table_header.h" + +class vehicle_desc_t; + +class vehicle_manager_t : public gui_frame_t, action_listener_t +{ + depot_t *depot; + + // update triggars + uint32 old_vhicles; // stored vehicles + uint32 old_listed_vehicles; // waytype total in the world + uint32 old_selections; // selected vehicles + sint32 last_selected=-1; // last selected vehicle + uint32 old_month; // Update flag when the month changes + +public: + + enum { + da_scrap, + da_listing, + da_cancel_listing, + da_buy + }; + uint8 dep_action=da_scrap; + +private: + //static sort_mode_t sortby; + //static const char* sort_text[vehicle_row_t::MAX_COLS]; // ? + + button_t + bt_mode_scrap, + bt_mode_sell, + bt_mode_cancel_listing, + bt_mode_buy, + bt_sel_all, + bt_reset, + bt_execute; + gui_label_buf_t + lb_vehicle_count, + lb_total_cost; + + char name[256], old_name[256]; + gui_textinput_t name_input; + + gui_sort_table_header_t table_header; + gui_aligned_container_t cont_sortable; + + gui_scrolled_list_t scrolly; + gui_scrollpane_t scroll_sortable; + + /// refill the list of vehicle info elements + void update_list(); + + void init_table(); + void init_mode_buttons(); + + // calculate total selected vehicles cost and update the label + void calc_total_cost(); + + // execute vechile trade command + void scrap_vehicles(); + void offer_vehicles_for_sale(); + void cancel_vehicles_for_sale(); + + // buy vehicles from other players + void takeover_vehicles(); + + /// Renames the depot to the name given in the text input field + void rename_depot(); + +public: + vehicle_manager_t(depot_t* depot); + + void reset_depot_name(); + + const char *get_help_filename() const OVERRIDE {return "vehicle_manager.txt"; } + + bool action_triggered(gui_action_creator_t *comp, value_t v) OVERRIDE; + + void draw(scr_coord pos, scr_size size) OVERRIDE; + + koord3d get_weltpos(bool) OVERRIDE; + bool is_weltpos() OVERRIDE; + + uint32 get_rdwr_id() OVERRIDE { return magic_vehicle_manager + depot->get_owner_nr(); } +}; + + +#endif diff --git a/simdepot.cc b/simdepot.cc index 0257af0016..a5321524d7 100644 --- a/simdepot.cc +++ b/simdepot.cc @@ -201,7 +201,7 @@ void depot_t::convoi_arrived(convoihandle_t acnv, bool fpl_adjust) vehicle_t *v = acnv->get_vehicle(i); // Hajo: reset vehicle data v->discard_cargo(); - v->set_pos( koord3d::invalid ); + v->set_pos( get_pos() ); v->set_leading( i==0 ); v->set_last( i+1==acnv->get_vehicle_count() ); } @@ -332,6 +332,43 @@ void depot_t::sell_vehicle(vehicle_t* veh) delete veh; } +void depot_t::set_vehicle_for_sale(vehicle_t* veh) +{ + vehicles.remove(veh); + vehicles_for_sale.insert(veh); + veh->set_pos(get_pos()); // to identify this depot; +} + +void depot_t::cancel_vehicle_for_sale(vehicle_t* veh) +{ + vehicles_for_sale.remove(veh); + vehicles.append(veh); +} + +void depot_t::takeover_vehicle(vehicle_t* veh) +{ + if (grund_t* gr = welt->lookup(veh->get_pos())) { + if (depot_t* seller_dep = gr->get_depot()) { + veh->set_owner(get_owner()); + veh->set_pos(get_pos()); + vehicles.append(veh); + player_t *seller= seller_dep->get_owner(); + const sint64 cost = (sint64)veh->calc_sale_value(); + get_owner()->book_vehicle_number(1, get_waytype()); + seller->book_vehicle_number(-1, get_waytype()); + get_owner()->book_new_vehicle(-cost, get_pos().get_2d(), get_waytype()); + seller->book_new_vehicle(cost, get_pos().get_2d(), get_waytype()); + + seller_dep->remove_vehicle_from_listed(veh); + } + } +} + +void depot_t::remove_vehicle_from_listed(vehicle_t* veh) +{ + vehicles_for_sale.remove(veh); +} + // returns the indest of the old/newest vehicle in a list //@author: isidoro @@ -707,12 +744,22 @@ void depot_t::rdwr(loadsave_t *file) if (file->is_version_less(81, 33)) { // wagons are stored extra, just add them to vehicles assert(file->is_loading()); - rdwr_vehicle(vehicles, file); + rdwr_vehicle(vehicles, file, true); + } + if (file->is_version_ex_atleast(14, 67)){ + DBG_MESSAGE("depot_t::rdwr_vehicles_for_sale", "loading %d vehicles", vehicles_for_sale.get_count()); + rdwr_vehicle(vehicles_for_sale, file, true); + if (file->is_loading()) { + welt->add_listed_vehicle_count(vehicles_for_sale.get_count(), get_wegtyp()); + } + } + else { + vehicles_for_sale.clear(); } } -void depot_t::rdwr_vehicle(slist_tpl &list, loadsave_t *file) +void depot_t::rdwr_vehicle(slist_tpl &list, loadsave_t *file, bool skip_depot_name) { // read/write vehicles in the depot, which are not part of a convoi. @@ -741,20 +788,20 @@ void depot_t::rdwr_vehicle(slist_tpl &list, loadsave_t *file) const bool last = false; switch (typ) { - case old_road_vehicle: - case road_vehicle: v = new road_vehicle_t(file, first, last); break; - case old_waggon: - case rail_vehicle: v = new rail_vehicle_t(file, first, last); break; - case old_schiff: - case water_vehicle: v = new water_vehicle_t(file, first, last); break; - case old_aircraft: - case air_vehicle: v = new air_vehicle_t(file, first, last); break; - case old_monorail_vehicle: - case monorail_vehicle: v = new monorail_rail_vehicle_t(file, first, last); break; - case maglev_vehicle: v = new maglev_rail_vehicle_t(file, first, last); break; - case narrowgauge_vehicle: v = new narrowgauge_rail_vehicle_t(file, first, last); break; - default: - dbg->fatal("depot_t::vehicle_laden()", "invalid vehicle type $%X", typ); + case old_road_vehicle: + case road_vehicle: v = new road_vehicle_t(file, first, last); break; + case old_waggon: + case rail_vehicle: v = new rail_vehicle_t(file, first, last); break; + case old_schiff: + case water_vehicle: v = new water_vehicle_t(file, first, last); break; + case old_aircraft: + case air_vehicle: v = new air_vehicle_t(file, first, last); break; + case old_monorail_vehicle: + case monorail_vehicle: v = new monorail_rail_vehicle_t(file, first, last); break; + case maglev_vehicle: v = new maglev_rail_vehicle_t(file, first, last); break; + case narrowgauge_vehicle: v = new narrowgauge_rail_vehicle_t(file, first, last); break; + default: + dbg->fatal("depot_t::vehicle_laden()", "invalid vehicle type $%X", typ); } const vehicle_desc_t* desc = v->get_desc(); if (desc) { @@ -779,6 +826,8 @@ void depot_t::rdwr_vehicle(slist_tpl &list, loadsave_t *file) } } + // depot name + if(skip_depot_name) return; if (file->is_version_ex_atleast(14, 56)) { file->rdwr_str(name, lengthof(name)); @@ -823,7 +872,7 @@ const char * depot_t:: is_deletable(const player_t *player) if(player!=get_owner() && player!=welt->get_public_player()) { return NOTICE_OWNED_BY_OTHER_PLAYER; } - if (!vehicles.empty()) { + if (!vehicles.empty() || !vehicles_for_sale.empty()) { return "There are still vehicles\nstored in this depot!\n"; } @@ -926,12 +975,12 @@ uint16 depot_t::get_traction_types() const * - 0 if we don't want to filter by traction type * - a bitmask of possible traction types; we need only match one */ -bool depot_t::is_suitable_for( const vehicle_t * test_vehicle, const uint16 traction_types /* = 0 */ ) const +bool depot_t::is_suitable_for( const vehicle_t * test_vehicle, const uint16 traction_types /* = 0 */, bool ignore_owner ) const { assert(test_vehicle != NULL); - // Owner must be the same - if ( this->get_owner() != test_vehicle->get_owner() ) { + // When transferring vehicles between players, the owner must be ignored. + if ( !ignore_owner && this->get_owner() != test_vehicle->get_owner() ) { return false; } diff --git a/simdepot.h b/simdepot.h index 869c72d0d8..ededd63e41 100644 --- a/simdepot.h +++ b/simdepot.h @@ -36,9 +36,12 @@ class depot_t : public gebaeude_t * Vehicles are accessed by type. */ slist_tpl vehicles; + slist_tpl vehicles_for_sale; slist_tpl convois; - void rdwr_vehicle(slist_tpl &list, loadsave_t *file); + // Railway depots do not go through rdwr, so read the depot name with rdwr_vehicle + // skip_depot_name: Option to not load depot name again when loading vehicles_for_sale + void rdwr_vehicle(slist_tpl &list, loadsave_t *file, bool skip_depot_name=false); static slist_tpl all_depots; @@ -52,9 +55,10 @@ class depot_t : public gebaeude_t * @param traction_types * - 0 if we don't want to filter by traction type * - a bitmask of possible traction types; we need only match one + * @param ignore_owner -- In the case of vehicle transfer, the owner must be ignored. */ uint16 get_traction_types() const; - bool is_suitable_for( const vehicle_t * test_vehicle, const uint16 traction_types = 0) const; + bool is_suitable_for( const vehicle_t * test_vehicle, const uint16 traction_types = 0, bool ignore_owner=false) const; // finds the next/previous depot relative to the current position static depot_t *find_depot( koord3d start, const obj_t::typ depot_type, const player_t *player, bool next); @@ -144,6 +148,7 @@ class depot_t : public gebaeude_t */ unsigned vehicle_count() const { return vehicles.get_count(); } slist_tpl & get_vehicle_list() { return vehicles; } + slist_tpl& get_vehicles_for_sale() { return vehicles_for_sale; } /** * A new vehicle is bought and added to the vehicle list. @@ -160,6 +165,15 @@ class depot_t : public gebaeude_t */ void sell_vehicle(vehicle_t* veh); + // Put the vehicle up for sale + void set_vehicle_for_sale(vehicle_t* veh); + void cancel_vehicle_for_sale(vehicle_t* veh); + + // Receiving a vehicle from another player + void takeover_vehicle(vehicle_t* veh); + // for takeover + void remove_vehicle_from_listed(vehicle_t* veh); + /** * Returns the waytype for a certain vehicle; only way to distinguish differnt depots ... */ @@ -263,7 +277,13 @@ class bahndepot_t : public depot_t simline_t::linetype get_line_type() const OVERRIDE { return simline_t::trainline; } - void rdwr_vehicles(loadsave_t *file) { depot_t::rdwr_vehicle(vehicles,file); } + void rdwr_vehicles(loadsave_t *file) + { + depot_t::rdwr_vehicle(vehicles,file); + if (file->is_version_ex_atleast(14, 67)) { + depot_t::rdwr_vehicle(vehicles_for_sale, file, true); + } + } waytype_t get_wegtyp() const OVERRIDE {return track_wt;} #ifdef INLINE_OBJ_TYPE diff --git a/simmenu.cc b/simmenu.cc index 8f079ec116..b0468e92a9 100644 --- a/simmenu.cc +++ b/simmenu.cc @@ -177,6 +177,7 @@ const char *tool_t::id_to_string(uint16 id) CASE_TO_STRING(TOOL_CONVOY_LOADINGBAR); CASE_TO_STRING(TOOL_SHOW_FACTORY_STORAGE); CASE_TO_STRING(TOOL_REASSIGN_SIGNAL_INTERNAL); + CASE_TO_STRING(TOOL_TRANSFER_VEHICLE); } } else if (id & DIALOG_TOOL) { @@ -359,6 +360,7 @@ tool_t *create_simple_tool(int toolnr) case TOOL_RECOLOUR_TOOL: tool = new tool_recolour_t(); break; case TOOL_ACCESS_TOOL: tool = new tool_access_t(); break; case TOOL_REASSIGN_SIGNAL_INTERNAL: tool = new tool_reassign_signal_internal_t(); break; + case TOOL_TRANSFER_VEHICLE: tool = new tool_transfer_vehicle_t(); break; case UNUSED_WKZ_PWDHASH_TOOL: dbg->warning("create_simple_tool()","deprecated tool [%i] requested", toolnr); return NULL; diff --git a/simmenu.h b/simmenu.h index ced66e23f9..be3419ad67 100644 --- a/simmenu.h +++ b/simmenu.h @@ -145,6 +145,7 @@ enum { TOOL_SHOW_FACTORY_STORAGE, TOOL_TOGGLE_CONTROL, TOOL_REASSIGN_SIGNAL_INTERNAL, + TOOL_TRANSFER_VEHICLE, SIMPLE_TOOL_COUNT, SIMPLE_TOOL = 0x2000 }; diff --git a/simtool.cc b/simtool.cc index a9acd3984a..435e6f2e47 100644 --- a/simtool.cc +++ b/simtool.cc @@ -10298,8 +10298,11 @@ bool tool_change_line_t::init( player_t *player ) * 'a' : appends a vehicle (+vehicle_name) uses the oldest * 'i' : inserts a vehicle in front (+vehicle_name) uses the oldest * 's' : sells a vehicle (+vehicle_name) uses the newest + * 'S' : Sell ​​a specific vehicle specified by its index number * 'r' : removes a vehicle (+number in convoi) * 'R' : removes all vehicles including (+number in convoi) to end + * 'f' : change "for_sale" state of the vehicle (vehicle name is not used) + * 'F' : cancel "for_sale" state of the vehicle (vehicle name is not used) */ bool tool_change_depot_t::init( player_t *player ) { @@ -10404,6 +10407,52 @@ bool tool_change_depot_t::init( player_t *player ) } break; } + case 'S': + { + // Sell ​​a specific vehicle. Not the newest one. + // Use liveryscheme_index as vehicle index. + vehicle_t* veh = depot->get_vehicle_list().at(livery_scheme_index); + if (veh != NULL) { + depot->sell_vehicle(veh); + } + break; + } + case 'f': + { + // Use liveryscheme_index as vehicle index. + vehicle_t* veh = depot->get_vehicle_list().at(livery_scheme_index); + if (veh != NULL) { + depot->set_vehicle_for_sale(veh); + cbuffer_t buf; + if (welt->get_active_player_nr()==depot->get_owner_nr()) { + buf.printf(translator::translate("You put %s up for sale."), translator::translate(veh->get_desc()->get_name())); + } + else{ + buf.printf(translator::translate("%s offer %s for sale."), depot->get_owner()->get_name(), translator::translate(veh->get_desc()->get_name())); + } + welt->get_message()->add_message(buf, koord::invalid, message_t::new_vehicle, color_idx_to_rgb(depot->get_owner()->get_player_color1() + env_t::gui_player_color_dark), veh->get_base_image()); + welt->add_listed_vehicle_count(1, veh->get_waytype()); + } + break; + } + case 'F': + { + // Use liveryscheme_index as vehicle index. + vehicle_t* veh = depot->get_vehicles_for_sale().at(livery_scheme_index); + if (veh != NULL) { + depot->cancel_vehicle_for_sale(veh); + cbuffer_t buf; + if (welt->get_active_player_nr()==depot->get_owner_nr()) { + buf.printf(translator::translate("You have cancelled the listing for %s."), translator::translate(veh->get_desc()->get_name())); + } + else{ + buf.printf(translator::translate("%s cancelled the listing for %s."), depot->get_owner()->get_name(), translator::translate(veh->get_desc()->get_name())); + } + welt->get_message()->add_message(buf, koord::invalid, message_t::new_vehicle, color_idx_to_rgb(depot->get_owner()->get_player_color1() + env_t::gui_player_color_dark), veh->get_base_image()); + welt->add_listed_vehicle_count(-1, veh->get_waytype()); + } + break; + } case 'a': // append a vehicle case 'i': // insert a vehicle in front case 's': // sells a vehicle @@ -11215,3 +11264,42 @@ bool tool_reassign_signal_internal_t::init(player_t *player) } return false; } + + +bool tool_transfer_vehicle_t::init(player_t* player) +{ + koord3d pos_from; + koord3d pos_to; + uint32 veh_index; + + if (7 != sscanf(default_param, "%hi,%hi,%hhi,%hi,%hi,%hhi,%u", &pos_from.x, &pos_from.y, &pos_from.z, &pos_to.x, &pos_to.y, &pos_to.z, &veh_index)) + { + dbg->error("tool_transfer_vehicle_t::init", "could not perform (%s)", default_param); + return false; + } + + if (grund_t* gr = welt->lookup(pos_from)) { + if (depot_t* from = gr->get_depot()) { + if (grund_t* gr2 = welt->lookup(pos_to)) { + if (depot_t* to = gr2->get_depot()) { + vehicle_t* veh = from->get_vehicles_for_sale().at(veh_index); + if (veh != NULL) { + to->takeover_vehicle(veh); + player_t *buyer=to->get_owner(); + player_t *seller=from->get_owner(); + cbuffer_t buf; + if (welt->get_active_player() == buyer) { + buf.printf(translator::translate("You purchased %s from %s."), translator::translate(veh->get_desc()->get_name()), seller->get_name()); + } + else { + buf.printf(translator::translate("%s purchased %s that you had listed."), buyer->get_name(), translator::translate(veh->get_desc()->get_name())); + } + welt->get_message()->add_message(buf, koord::invalid, message_t::new_vehicle, color_idx_to_rgb(buyer->get_player_color1() + env_t::gui_player_color_dark), veh->get_base_image()); + welt->add_listed_vehicle_count(-1, veh->get_waytype()); + } + } + } + } + } + return false; +} diff --git a/simtool.h b/simtool.h index 2ab159b692..a1d2dcdedb 100644 --- a/simtool.h +++ b/simtool.h @@ -1450,4 +1450,12 @@ class tool_reassign_signal_internal_t : public tool_t { bool is_init_keeps_game_state() const OVERRIDE { return false; } }; +// internal tool: Transfer a vehicle from one depot to another in order to give it away +class tool_transfer_vehicle_t : public tool_t { +public: + tool_transfer_vehicle_t() : tool_t(TOOL_TRANSFER_VEHICLE | SIMPLE_TOOL) {} + bool init(player_t* player) OVERRIDE; + bool is_init_keeps_game_state() const OVERRIDE { return false; } +}; + #endif diff --git a/simversion.h b/simversion.h index 3bc2ee5cb4..b837c3cee3 100644 --- a/simversion.h +++ b/simversion.h @@ -35,7 +35,7 @@ extern "C" FILE * __cdecl __iob_func(void) { return _iob; } #define EX_VERSION_MAJOR 14 #define EX_VERSION_MINOR 23 -#define EX_SAVE_MINOR 66 +#define EX_SAVE_MINOR 67 // Do not forget to increment the save game versions in settings_stats.cc when changing this diff --git a/simworld.cc b/simworld.cc index a81b29b1c3..3f99f2c464 100644 --- a/simworld.cc +++ b/simworld.cc @@ -645,6 +645,11 @@ void karte_t::destroy() DBG_MESSAGE("karte_t::destroy()", "world destroyed"); destroying = false; + + for(uint8 i=0; i< simline_t::MAX_LINE_TYPE-1; i++){ + world_listed_vehicles[i] = 0; + } + #ifdef MULTI_THREAD cities_to_process = 0; terminating_threads = false; @@ -664,6 +669,19 @@ void karte_t::rem_convoi(convoihandle_t const &cnv) convoi_array.remove(cnv); } +void karte_t::add_listed_vehicle_count(int amount, waytype_t wt) +{ + if (wt == invalid_wt) { dbg->warning("karte_t::add_listed_vehicle_count", "Invalid waytype!"); return; } + + world_listed_vehicles[simline_t::waytype_to_linetype(wt)-1]+=amount; +} + +uint32 karte_t::get_listed_vehicle_number(waytype_t wt) const +{ + if( wt==invalid_wt ){ dbg->warning("karte_t::get_listed_vehicle_number", "Invalid waytype!"); return 0; } + + return world_listed_vehicles[simline_t::waytype_to_linetype(wt)-1]; +} void karte_t::add_city(stadt_t *s) { @@ -1543,6 +1561,10 @@ DBG_DEBUG("karte_t::init()","built timeline"); pedestrian_t::check_timeline_pedestrians(); + for (uint8 i = 0; i < simline_t::MAX_LINE_TYPE-1; i++) { + world_listed_vehicles[i] = 0; + } + #ifdef MULTI_THREAD init_threads(); #else @@ -8159,7 +8181,7 @@ DBG_MESSAGE("karte_t::save(loadsave_t *file)", "motd filename %s", env_t::server } } - if (file->get_extended_version() >= 15 || (file->get_extended_version() == 14 && file->get_extended_revision() >= 19)) + if (file->is_version_ex_atleast(14,19)) { if (file->get_extended_version() == 14 && file->get_extended_revision() < 20) { @@ -8169,7 +8191,7 @@ DBG_MESSAGE("karte_t::save(loadsave_t *file)", "motd filename %s", env_t::server } } - if (file->get_extended_version() >= 15 || (file->get_extended_version() == 14 && file->get_extended_revision() >= 20)) + if (file->is_version_ex_atleast(14,20)) { file->rdwr_long(weg_t::private_car_routes_currently_reading_element); } @@ -8179,7 +8201,7 @@ DBG_MESSAGE("karte_t::save(loadsave_t *file)", "motd filename %s", env_t::server path_explorer_t::rdwr(file); } - if (file->get_extended_version() >= 15 || (file->get_extended_version() == 14 && file->get_extended_revision() >= 35)) + if (file->is_version_ex_atleast(14,35)) { uint32 count = cities_awaiting_private_car_route_check.get_count(); file->rdwr_long(count); @@ -9563,7 +9585,7 @@ DBG_MESSAGE("karte_t::load()", "%d factories loaded", fab_list.get_count()); } } - if (file->get_extended_version() >= 15 || (file->get_extended_version() == 14 && file->get_extended_revision() >= 19)) + if (file->is_version_ex_atleast(14, 19)) { if (file->get_extended_version() == 14 && file->get_extended_revision() < 20) { @@ -9573,7 +9595,7 @@ DBG_MESSAGE("karte_t::load()", "%d factories loaded", fab_list.get_count()); } } - if (file->get_extended_version() >= 15 || (file->get_extended_version() == 14 && file->get_extended_revision() >= 20)) + if (file->is_version_ex_atleast(14, 20)) { file->rdwr_long(weg_t::private_car_routes_currently_reading_element); } @@ -9594,7 +9616,7 @@ DBG_MESSAGE("karte_t::load()", "%d factories loaded", fab_list.get_count()); path_explorer_t::reset_must_refresh_on_loading(); cities_awaiting_private_car_route_check.clear(); - if (file->get_extended_version() >= 15 || (file->get_extended_version() == 14 && file->get_extended_revision() >= 35)) + if (file->is_version_ex_atleast(14, 35)) { uint32 count = 0; file->rdwr_long(count); diff --git a/simworld.h b/simworld.h index be9316b9ab..3b3d2a7d3c 100644 --- a/simworld.h +++ b/simworld.h @@ -361,6 +361,9 @@ class karte_t */ vector_tpl convoi_array; + // Total number of vehicles currently listed by players + uint32 world_listed_vehicles[8/*simline_t::MAX_LINE_TYPE-1*/]; + /** * Array containing the factories. */ @@ -2102,6 +2105,10 @@ class karte_t void rem_convoi(convoihandle_t const &cnv); vector_tpl const& convoys() const { return convoi_array; } + // To access the world listed vehicle number + void add_listed_vehicle_count(int amount, waytype_t wt); + uint32 get_listed_vehicle_number(waytype_t wt) const; + /** * To access the cities array. */ From ea4cf887d385dc69454c0a931cbdc26e06d0e72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 19 Jul 2024 23:58:46 +0900 Subject: [PATCH 16/32] FIX: The borders are slightly misaligned --- gui/components/sortable_table.cc | 2 +- gui/components/sortable_table_header.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index e02a9ecefa..ccd9d44c30 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -56,7 +56,7 @@ void table_cell_item_t::draw(scr_coord offset) display_fillbox_wh_clip_rgb(offset.x, offset.y, size.w, size.h, SYSCOL_TD_BACKGROUND_HIGHLIGHT, false); } // draw border - display_ddd_box_clip_rgb(offset.x-1, offset.y-1, size.w+1, size.h+1, SYSCOL_TD_BORDER, SYSCOL_TD_BORDER); + display_ddd_box_clip_rgb(offset.x, offset.y-1, size.w+1, size.h+1, SYSCOL_TD_BORDER, SYSCOL_TD_BORDER); } diff --git a/gui/components/sortable_table_header.cc b/gui/components/sortable_table_header.cc index 2202ae1eb4..57bfb28ee4 100644 --- a/gui/components/sortable_table_header.cc +++ b/gui/components/sortable_table_header.cc @@ -35,7 +35,7 @@ void sortable_header_cell_t::draw(scr_coord offset) display_fillbox_wh_clip_rgb(pos.x + offset.x + 1, pos.y + offset.y + 1, get_size().w - 2, get_size().h - 2, SYSCOL_TH_BACKGROUND_SELECTED, false); } PIXVAL text_color = selected ? SYSCOL_TH_TEXT_SELECTED : SYSCOL_TH_TEXT_TOP; - display_ddd_box_clip_rgb(pos.x + offset.x, pos.y + offset.y, get_size().w, get_size().h, SYSCOL_TH_BORDER, SYSCOL_TH_BORDER); + display_ddd_box_clip_rgb(pos.x + offset.x, pos.y + offset.y, get_size().w+1, get_size().h, SYSCOL_TH_BORDER, SYSCOL_TH_BORDER); // draw text const scr_rect area(offset + pos, size-scr_size(5,0)); From 39959a5c0d5aeacd6ce89976caeb76b5044ef980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 00:00:21 +0900 Subject: [PATCH 17/32] FIX: the layout will be broken if the height is small --- gui/vehiclelist_frame.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/vehiclelist_frame.cc b/gui/vehiclelist_frame.cc index c26feb8c49..55c86e7919 100644 --- a/gui/vehiclelist_frame.cc +++ b/gui/vehiclelist_frame.cc @@ -64,6 +64,7 @@ vehiclelist_frame_t::vehiclelist_frame_t() : cont_sortable.set_margin(NO_SPACING, NO_SPACING); cont_sortable.set_spacing(NO_SPACING); cont_sortable.set_table_layout(1,2); + cont_sortable.set_alignment(ALIGN_TOP); // Without this, the layout will be broken if the height is small. cont_sortable.add_component(&table_header); cont_sortable.add_component(&scrolly); From c322a3007997f618a3c9f81e0a6d6d45926f16c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 05:31:41 +0900 Subject: [PATCH 18/32] :jp: ADD Japanese translations for vehicle trading feature --- simutrans/text/ja.tab | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/simutrans/text/ja.tab b/simutrans/text/ja.tab index b05bc157be..0d95280d3f 100644 --- a/simutrans/text/ja.tab +++ b/simutrans/text/ja.tab @@ -2267,6 +2267,38 @@ Zu nah am Kartenrand %s大通り%s #___________________________Simutrans Extended Texts____________________________ #___________________________Simutrans Extended Texts____________________________ +You put %s up for sale. +「%s」を出品しました。 +You have cancelled the listing for %s. +「%s」の出品を中止しました。 +You purchased %s from %s. +%2$sから「%1$s」を購入しました。 +%s offer %s for sale. +%sは「%s」の買い手を探しています。 +%s cancelled the listing for %s." +%sは「%s」の出品を中止しました。 +%s purchased %s that you had listed. +%sがあなたが出品中の「%s」を購入しました。 +Stored +入庫中 +1 vehicle +1台(両) +Listed +出品中 +veh_mgr +車庫名変更/車両売買 +Open the vehicle management window +ここから車庫名の変更と車両の売買が行えます +execute_scrap +廃車解体する +execute_listing +出品する +cancel_the_listing +出品を中止する +execute_purchase +中古車両を購入 +Cancel the listing request for the selected vehicles +選択した車両の出品を取り下げます hd_sv_mode_frequency 運行頻度、編成数 hd_sv_mode_catg @@ -2427,6 +2459,10 @@ building 建築物 Built 建設年月 +Built date +製造年月 +Buy +中古車の購入 Buy/sell 購入/売却 cab_signalling @@ -3794,7 +3830,7 @@ map_btn_building_level sort_pas_arrived 旅客輸送実績 Scrap -車両を解体 +廃車解体 Scrap all vehicles in the convoy. 編成中の車両を全て解体します。車両購入費用は一切戻ってきません。 Return the vehicle(s) for a full refund. From 421c97c52dc4c8ca435050232b3d9587a49de5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 15:20:58 +0900 Subject: [PATCH 19/32] Update ja.tab --- simutrans/text/ja.tab | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/simutrans/text/ja.tab b/simutrans/text/ja.tab index 0d95280d3f..f709ae8ed9 100644 --- a/simutrans/text/ja.tab +++ b/simutrans/text/ja.tab @@ -845,8 +845,6 @@ convoi passed last month: 前月交通量: Convois 編成数 -Convois: %d\nProfit: %s -就役編成: %d\n利益: %s Convoys 編成 Copy Convoi @@ -2463,8 +2461,6 @@ Built date 製造年月 Buy 中古車の購入 -Buy/sell -購入/売却 cab_signalling 車内信号閉塞式 call_on @@ -4555,6 +4551,10 @@ line_network 接続路線 #_______________________________unnecessary_text________________________________ #_______________________________unnecessary_text________________________________ +Buy/sell +購入/売却 +Convois: %d\nProfit: %s +就役編成: %d\n利益: %s Free Capacity 空席 100 km/h = %i tiles/month From 3d14fffe0d5d279346d455c19cb42dcbe979f706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 15:37:01 +0900 Subject: [PATCH 20/32] FIX: table layout --- gui/components/sortable_table.cc | 2 +- gui/components/sortable_table_header.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index ccd9d44c30..12d51e74a9 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -53,7 +53,7 @@ void table_cell_item_t::draw(scr_coord offset) { offset+=pos; if (highlight) { // for filter - display_fillbox_wh_clip_rgb(offset.x, offset.y, size.w, size.h, SYSCOL_TD_BACKGROUND_HIGHLIGHT, false); + display_fillbox_wh_clip_rgb(offset.x+1, offset.y, size.w, size.h, SYSCOL_TD_BACKGROUND_HIGHLIGHT, false); } // draw border display_ddd_box_clip_rgb(offset.x, offset.y-1, size.w+1, size.h+1, SYSCOL_TD_BORDER, SYSCOL_TD_BORDER); diff --git a/gui/components/sortable_table_header.cc b/gui/components/sortable_table_header.cc index 57bfb28ee4..984faf3274 100644 --- a/gui/components/sortable_table_header.cc +++ b/gui/components/sortable_table_header.cc @@ -25,14 +25,14 @@ sortable_header_cell_t::sortable_header_cell_t(char const* const text_, bool yes { enabled=yesno; text = text_; - min_width = proportional_string_width(translator::translate(text)) + 7 /* arrow width */; + min_width = proportional_string_width(translator::translate(text)) + 10 /* arrow width */; size.h=D_BUTTON_HEIGHT; } void sortable_header_cell_t::draw(scr_coord offset) { if (selected) { - display_fillbox_wh_clip_rgb(pos.x + offset.x + 1, pos.y + offset.y + 1, get_size().w - 2, get_size().h - 2, SYSCOL_TH_BACKGROUND_SELECTED, false); + display_fillbox_wh_clip_rgb(pos.x + offset.x + 1, pos.y + offset.y + 1, get_size().w - 1, get_size().h - 2, SYSCOL_TH_BACKGROUND_SELECTED, false); } PIXVAL text_color = selected ? SYSCOL_TH_TEXT_SELECTED : SYSCOL_TH_TEXT_TOP; display_ddd_box_clip_rgb(pos.x + offset.x, pos.y + offset.y, get_size().w+1, get_size().h, SYSCOL_TH_BORDER, SYSCOL_TH_BORDER); From b94afca64f0271c79d9b0c7af27d39d5c43c2d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 21:14:50 +0900 Subject: [PATCH 21/32] UPDATE value_cell_t, add distance and time format --- gui/components/gui_chart.h | 2 +- gui/components/sortable_table.cc | 21 +++++++++++++++++++-- gui/components/sortable_table.h | 2 +- gui/components/sortable_table_vehicle.cc | 4 ++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gui/components/gui_chart.h b/gui/components/gui_chart.h index 79faa69c8f..2ae1565237 100644 --- a/gui/components/gui_chart.h +++ b/gui/components/gui_chart.h @@ -21,7 +21,7 @@ class gui_chart_t : public gui_component_t enum chart_marker_t { square = 0, cross, diamond, round_box, none }; // NOTE: KMPH and FORCE hacks drawing accuracy and should not be mixed with other types // CURVE TYPES - enum chart_suffix_t { STANDARD = 0, MONEY, PERCENT, DISTANCE, KMPH, FORCE, PAX_KM, KG_KM, TON_KM, TON_KM_MAIL, KW,/* WATT,*/ TONNEN, TIME }; + enum chart_suffix_t { STANDARD = 0, MONEY, PERCENT, DISTANCE, KMPH, FORCE, PAX_KM, KG_KM, TON_KM, TON_KM_MAIL, KW,/* WATT,*/ TONNEN, TIME, DATE }; /** * Set background color. -1 means no background diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index 12d51e74a9..58c32579dd 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -119,7 +119,7 @@ value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix, al buf.printf("%.1ft", (float)value/1000.0); } break; - case gui_chart_t::TIME: // as date + case gui_chart_t::DATE: if (value == DEFAULT_RETIRE_DATE*12) { // empty cell ////buf.append("-"); @@ -129,6 +129,19 @@ value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix, al buf.append(translator::get_short_date((uint16)value / 12, (uint16)value % 12)); } break; + case gui_chart_t::TIME: + { + if (value==0) { + buf.append("--:--:--"); + color = COL_INACTIVE; + } + else { + char as_clock[32]; + world()->sprintf_ticks(as_clock, sizeof(as_clock), value); + buf.printf("%s", as_clock); + } + break; + } case gui_chart_t::FORCE: if (value == 0) { buf.append("-"); @@ -140,7 +153,11 @@ value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix, al buf.append(" kN"); } break; - case gui_chart_t::DISTANCE: // currentry not used + case gui_chart_t::DISTANCE: + { + buf.printf("%.1fkm", (float)(value*world()->get_settings().get_meters_per_tile()/1000.0)); + break; + } case gui_chart_t::STANDARD: default: buf.append(value); diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index 26b57f560f..6845fc8250 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -53,7 +53,7 @@ class table_cell_item_t : virtual public gui_component_t scr_coord_val check_height(scr_coord_val new_height); - virtual const uint8 get_type() const { return cell_text; } + virtual const uint8 get_type() const { return cell_no_sorting; } bool is_focusable() OVERRIDE { return false; } diff --git a/gui/components/sortable_table_vehicle.cc b/gui/components/sortable_table_vehicle.cc index af99fdde45..ff34bf2ef2 100644 --- a/gui/components/sortable_table_vehicle.cc +++ b/gui/components/sortable_table_vehicle.cc @@ -210,7 +210,7 @@ vehicle_desc_row_t::vehicle_desc_row_t(const vehicle_desc_t* desc) new_component(veh_type->get_waytype() == water_wt ? 0 : (sint64)veh_type->get_axle_load() * 1000, gui_chart_t::TONNEN, table_cell_item_t::right); // 12. intro date PIXVAL status_color = veh_type->get_vehicle_status_color(); - new_component((sint64)veh_type->get_intro_year_month(), gui_chart_t::TIME, table_cell_item_t::right, status_color == COL_SAFETY ? SYSCOL_TEXT : status_color); + new_component((sint64)veh_type->get_intro_year_month(), gui_chart_t::DATE, table_cell_item_t::right, status_color == COL_SAFETY ? SYSCOL_TEXT : status_color); // 13. retire date sint64 retire_date= DEFAULT_RETIRE_DATE * 12; if (veh_type->get_retire_year_month() != DEFAULT_RETIRE_DATE * 12 && @@ -221,7 +221,7 @@ vehicle_desc_row_t::vehicle_desc_row_t(const vehicle_desc_t* desc) retire_date = (sint64)veh_type->get_retire_year_month(); } - new_component(retire_date, gui_chart_t::TIME, table_cell_item_t::right); + new_component(retire_date, gui_chart_t::DATE, table_cell_item_t::right); //init cell height for (auto& cell : owned_cells) { From 7659316b596cfcf971aa63f4bfc7a4d4792853ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 21:17:35 +0900 Subject: [PATCH 22/32] UPDATE sort table, coord type cell --- gui/components/sortable_table.cc | 9 +++++++++ gui/components/sortable_table.h | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index 58c32579dd..b818ff9e60 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -78,6 +78,15 @@ void text_cell_t::draw(scr_coord offset) display_proportional_clip_rgb(offset.x+ draw_offset.x, offset.y+ draw_offset.y, translator::translate(text), ALIGN_LEFT, color, false); } +coord_cell_t::coord_cell_t(const char* text, koord coord_, PIXVAL color, align_t align) + : text_cell_t((text==NULL && coord_!=koord::invalid) ? coord.get_fullstr() : text, color, align) +{ + coord = coord_; + min_size = scr_size(proportional_string_width(translator::translate(get_text())), LINESPACE); + set_size(min_size); +} + + value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix, align_t align_, PIXVAL col) { color = col; diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index 6845fc8250..f545b6702b 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -77,6 +77,19 @@ class text_cell_t : public table_cell_item_t void draw(scr_coord offset) OVERRIDE; }; + +// Hold the coordinates and click a cell to jump to the coordinates. +class coord_cell_t : public text_cell_t +{ + koord coord; + +public: + coord_cell_t(const char* text = NULL, koord coord=koord::invalid, PIXVAL color = SYSCOL_TEXT, align_t align = left); + + koord get_coord() const { return coord; } +}; + + // The cell holds a single value for sorting // Can specify a suffix. class value_cell_t : public table_cell_item_t From 555c466cd0d6d7aaefc47997537e9a9cc88da693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sat, 20 Jul 2024 21:23:51 +0900 Subject: [PATCH 23/32] CODE: change date format name --- gui/components/sortable_table_vehicle.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/components/sortable_table_vehicle.cc b/gui/components/sortable_table_vehicle.cc index ede313c039..59f8fb4988 100644 --- a/gui/components/sortable_table_vehicle.cc +++ b/gui/components/sortable_table_vehicle.cc @@ -300,10 +300,10 @@ vehicle_row_t::vehicle_row_t(vehicle_t* v) // 11. axle load new_component(veh_type->get_waytype()==water_wt ? 0: (sint64)veh_type->get_axle_load()*1000, gui_chart_t::TONNEN, table_cell_item_t::right); // 12. purchase date - new_component((sint64)veh->get_purchase_time(), gui_chart_t::TIME, table_cell_item_t::right); + new_component((sint64)veh->get_purchase_time(), gui_chart_t::DATE, table_cell_item_t::right); // 13. intro date PIXVAL status_color = veh_type->get_vehicle_status_color(); - new_component((sint64)veh_type->get_intro_year_month(), gui_chart_t::TIME, table_cell_item_t::right, status_color==COL_SAFETY ? SYSCOL_TEXT : status_color); + new_component((sint64)veh_type->get_intro_year_month(), gui_chart_t::DATE, table_cell_item_t::right, status_color==COL_SAFETY ? SYSCOL_TEXT : status_color); // owner //new_component(veh->get_owner()->get_name()); From c381b6a69d517a09d73ec2e8c3c48869d738251d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Mon, 22 Jul 2024 08:27:35 +0900 Subject: [PATCH 24/32] CHG: Make it possible to jump by clicking on the coord cell --- gui/components/sortable_table.h | 5 ++++- gui/components/sortable_table_header.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index f545b6702b..5f0154f6c3 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -26,7 +26,8 @@ class table_cell_item_t : virtual public gui_component_t cell_no_sorting = 0, cell_value = 1, cell_values = 2, - cell_text = 3 + cell_text = 3, + cell_coord = 4 }; enum align_t { @@ -87,6 +88,8 @@ class coord_cell_t : public text_cell_t coord_cell_t(const char* text = NULL, koord coord=koord::invalid, PIXVAL color = SYSCOL_TEXT, align_t align = left); koord get_coord() const { return coord; } + + const uint8 get_type() const OVERRIDE { return cell_coord; } }; diff --git a/gui/components/sortable_table_header.cc b/gui/components/sortable_table_header.cc index 984faf3274..5df5db4064 100644 --- a/gui/components/sortable_table_header.cc +++ b/gui/components/sortable_table_header.cc @@ -129,7 +129,7 @@ bool gui_sort_table_header_t::infowin_event(const event_t* ev) { bool swallowed = gui_container_t::infowin_event(ev); - if (IS_LEFTRELEASE(ev) && getroffen(ev->mouse_pos)) { + if (!swallowed && IS_LEFTRELEASE(ev) && getroffen(ev->mouse_pos)) { uint idx=0; for (auto& cell : owned_cells) { if (cell->getroffen(ev->mouse_pos)) { From a4aacd8ff4ada1bccfc280d17da51fa97767998a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Thu, 25 Jul 2024 00:29:10 +0900 Subject: [PATCH 25/32] FIX: missing compare coord_cell --- gui/components/sortable_table.cc | 16 ++++++++++++++++ gui/components/sortable_table.h | 1 + 2 files changed, 17 insertions(+) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index b818ff9e60..c71c078e65 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -320,6 +320,19 @@ int gui_sort_table_row_t::compare_text(const table_cell_item_t* a, const table_c return STRICMP(a_text, b_text); } +int gui_sort_table_row_t::compare_coord(const table_cell_item_t* a, const table_cell_item_t* b) +{ + int cmp = 0; + const coord_cell_t* cell_a = dynamic_cast(a); + const coord_cell_t* cell_b = dynamic_cast(b); + cmp = cell_a->get_coord().x - cell_b->get_coord().x; + if (cmp == 0) { + cmp = cell_a->get_coord().y - cell_b->get_coord().y; + } + return cmp; +} + + int gui_sort_table_row_t::compare(const table_cell_item_t* a, const table_cell_item_t* b) { sint64 cmp = 0; @@ -336,6 +349,9 @@ int gui_sort_table_row_t::compare(const table_cell_item_t* a, const table_cell_i case table_cell_item_t::cell_text: cmp = gui_sort_table_row_t::compare_text(a, b); break; + case table_cell_item_t::cell_coord: + cmp = gui_sort_table_row_t::compare_coord(a, b); + break; case table_cell_item_t::cell_no_sorting: default: // nothing to do diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index 5f0154f6c3..2a6b2c9e54 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -141,6 +141,7 @@ class gui_sort_table_row_t : public gui_container_t, public gui_scrolled_list_t: static sint64 compare_value(const table_cell_item_t* a, const table_cell_item_t* b); static sint64 compare_values(const table_cell_item_t* a, const table_cell_item_t* b); static int compare_text(const table_cell_item_t* a, const table_cell_item_t* b); + static int compare_coord(const table_cell_item_t* a, const table_cell_item_t* b); protected: From c7781a89d0ac201bf2550099b18d4738f383713c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Thu, 25 Jul 2024 00:30:41 +0900 Subject: [PATCH 26/32] CHG: text_cell can be underlined --- gui/components/sortable_table.cc | 8 ++++++-- gui/components/sortable_table.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index c71c078e65..f1efc4c9ff 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -61,11 +61,12 @@ void table_cell_item_t::draw(scr_coord offset) -text_cell_t::text_cell_t(const char* text_, PIXVAL col, align_t align_) +text_cell_t::text_cell_t(const char* text_, PIXVAL col, align_t align_, bool underlined_) { text= text_; color= col; align=align_; + underlined = underlined_; min_size = scr_size(proportional_string_width(translator::translate(text)), LINESPACE); set_size(min_size); } @@ -76,10 +77,13 @@ void text_cell_t::draw(scr_coord offset) offset+=pos; display_proportional_clip_rgb(offset.x+ draw_offset.x, offset.y+ draw_offset.y, translator::translate(text), ALIGN_LEFT, color, false); + if (underlined) { + display_fillbox_wh_clip_rgb(offset.x + draw_offset.x, offset.y + draw_offset.y + LINESPACE-1, min_size.w, 1, color, false); + } } coord_cell_t::coord_cell_t(const char* text, koord coord_, PIXVAL color, align_t align) - : text_cell_t((text==NULL && coord_!=koord::invalid) ? coord.get_fullstr() : text, color, align) + : text_cell_t((text==NULL && coord_!=koord::invalid) ? coord.get_fullstr() : text, color, align, coord_ == koord::invalid ? false : true) { coord = coord_; min_size = scr_size(proportional_string_width(translator::translate(get_text())), LINESPACE); diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index 2a6b2c9e54..17711e2912 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -66,10 +66,11 @@ class text_cell_t : public table_cell_item_t { const char* text; // only for direct access of non-translatable things. Do not use! PIXVAL color; + bool underlined; // bool is_bold; public: - text_cell_t(const char* text = NULL, PIXVAL color = SYSCOL_TEXT, align_t align = left); + text_cell_t(const char* text = NULL, PIXVAL color = SYSCOL_TEXT, align_t align = left, bool underlined = false); const uint8 get_type() const OVERRIDE { return cell_text; } From 7479d50ddcd2981db37ad54ed894485b924933f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Thu, 25 Jul 2024 00:31:43 +0900 Subject: [PATCH 27/32] =?UTF-8?q?CHG:=20can=20choose=20to=20display=20the?= =?UTF-8?q?=20values=20=E2=80=8B=E2=80=8Bcell=20in=20one=20or=20two=20line?= =?UTF-8?q?s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/components/sortable_table.cc | 35 ++++++++++++++++++-------------- gui/components/sortable_table.h | 4 +++- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index f1efc4c9ff..c4c80b74d8 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -189,7 +189,7 @@ void value_cell_t::draw(scr_coord offset) } -values_cell_t::values_cell_t(sint64 value_, sint64 sub_value_, PIXVAL col) +values_cell_t::values_cell_t(sint64 value_, sint64 sub_value_, PIXVAL col, bool single_line_) : value_cell_t(value_) { buf.clear(); @@ -198,11 +198,10 @@ values_cell_t::values_cell_t(sint64 value_, sint64 sub_value_, PIXVAL col) color = col; min_size.h = LINESPACE; align = centered; + single_line = single_line_; sub_value=sub_value_; - bool two_lines = false; - if (value==0 && sub_value==0) { buf.append("-"); color = SYSCOL_TEXT_WEAK; @@ -212,20 +211,22 @@ values_cell_t::values_cell_t(sint64 value_, sint64 sub_value_, PIXVAL col) } if (sub_value != 0) { if (value != 0) { - // display two lines - sub_buf.printf("(%i)", sub_value); - min_size.h += LINESPACE; - two_lines = true; + if (single_line) { + buf.printf(" (%i)", sub_value); + } + else { + // display two lines + sub_buf.printf("(%i)", sub_value); + min_size.h += LINESPACE; + sub_draw_offset_x = proportional_string_width(sub_buf) / 2; + min_size.w = max(proportional_string_width(buf), sub_draw_offset_x * 2 + 1); + } } else { buf.printf("(%i)", sub_value); } } - if (two_lines) { - sub_draw_offset_x = proportional_string_width(sub_buf) / 2; - min_size.w = max(proportional_string_width(buf), sub_draw_offset_x * 2 + 1); - } - else { + if (single_line) { min_size.w = proportional_string_width(buf); } set_size(min_size); @@ -233,10 +234,14 @@ values_cell_t::values_cell_t(sint64 value_, sint64 sub_value_, PIXVAL col) void values_cell_t::set_width(scr_coord_val new_width) { - const scr_coord_val row1_width = proportional_string_width(buf); - size.w = new_width + L_CELL_PADDING * 2; - draw_offset.x = (size.w - row1_width) / 2; + if (single_line) { + draw_offset.x = (size.w - min_size.w) / 2; + } + else { + draw_offset.x = (size.w - proportional_string_width(buf)) / 2; + } + } void values_cell_t::draw(scr_coord offset) diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index 17711e2912..b3533be0b0 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -122,9 +122,11 @@ class values_cell_t : public value_cell_t cbuffer_t sub_buf; sint64 sub_value; scr_coord_val sub_draw_offset_x = 0; + bool single_line; public: - values_cell_t(sint64 value, sint64 sub_value, PIXVAL color = SYSCOL_TEXT); + // single_line: Displaying two values ​​on the same line + values_cell_t(sint64 value, sint64 sub_value, PIXVAL color = SYSCOL_TEXT, bool single_line=false); void set_width(scr_coord_val new_width) OVERRIDE; From 03e6fbd71b2a1d531b7d7d66237c5bc2a0c54ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Thu, 25 Jul 2024 07:50:44 +0900 Subject: [PATCH 28/32] CHG: The cell value can be updated externally later --- gui/components/sortable_table.cc | 42 ++++++++++++++++++++++++-------- gui/components/sortable_table.h | 15 +++++++++--- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index c4c80b74d8..331fc5e44f 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -91,11 +91,20 @@ coord_cell_t::coord_cell_t(const char* text, koord coord_, PIXVAL color, align_t } -value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix, align_t align_, PIXVAL col) +value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix_, align_t align_, PIXVAL col) { color = col; align = align_; - value=value_; + suffix= suffix_; + + set_value(value_); + set_size(min_size); +} + +void value_cell_t::set_value(sint64 value_) +{ + value = value_; + buf.clear(); switch(suffix) { @@ -177,7 +186,10 @@ value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix, al break; } min_size = scr_size(proportional_string_width(buf), LINESPACE); - set_size(min_size); + if (min_size.w> (size.w - L_CELL_PADDING*2) ) { + dbg->warning("value_cell_t::set_value", "Cell's text width has been changed to %i, exceeding the column width of %i.", min_size.w, size.w); + } + set_width(size.w - L_CELL_PADDING*2); // recalc draw_offset.x } void value_cell_t::draw(scr_coord offset) @@ -190,19 +202,26 @@ void value_cell_t::draw(scr_coord offset) values_cell_t::values_cell_t(sint64 value_, sint64 sub_value_, PIXVAL col, bool single_line_) - : value_cell_t(value_) { - buf.clear(); - sub_buf.clear(); - color = col; min_size.h = LINESPACE; align = centered; single_line = single_line_; - sub_value=sub_value_; + set_values(value_, sub_value_); - if (value==0 && sub_value==0) { + set_size(min_size); +} + +void values_cell_t::set_values(sint64 value_, sint64 sub_value_) +{ + value = value_; + sub_value = sub_value_; + + buf.clear(); + sub_buf.clear(); + + if (value == 0 && sub_value == 0) { buf.append("-"); color = SYSCOL_TEXT_WEAK; } @@ -229,7 +248,10 @@ values_cell_t::values_cell_t(sint64 value_, sint64 sub_value_, PIXVAL col, bool if (single_line) { min_size.w = proportional_string_width(buf); } - set_size(min_size); + if (min_size.w > (size.w - L_CELL_PADDING * 2)) { + dbg->warning("values_cell_t::set_value", "Cell's text width has been changed to %i, exceeding the column width of %i.", min_size.w, size.w); + } + set_width(size.w - L_CELL_PADDING * 2); // recalc draw_offset.x } void values_cell_t::set_width(scr_coord_val new_width) diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index b3533be0b0..16099bb339 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -98,6 +98,7 @@ class coord_cell_t : public text_cell_t // Can specify a suffix. class value_cell_t : public table_cell_item_t { + gui_chart_t::chart_suffix_t suffix; protected: cbuffer_t buf; PIXVAL color; @@ -107,6 +108,9 @@ class value_cell_t : public table_cell_item_t public: value_cell_t(sint64 value, gui_chart_t::chart_suffix_t suffix= gui_chart_t::STANDARD, align_t align = left, PIXVAL color = SYSCOL_TEXT); + // When resetting the value, care must be taken not to increase the column width. + void set_value(sint64 value); + sint64 get_value() const { return value; } const uint8 get_type() const OVERRIDE { return cell_value; } @@ -116,11 +120,12 @@ class value_cell_t : public table_cell_item_t // The cell holds two values for sorting // There is no suffix -class values_cell_t : public value_cell_t +class values_cell_t : public table_cell_item_t { protected: - cbuffer_t sub_buf; - sint64 sub_value; + cbuffer_t buf, sub_buf; + PIXVAL color; + sint64 value, sub_value; scr_coord_val sub_draw_offset_x = 0; bool single_line; @@ -130,6 +135,10 @@ class values_cell_t : public value_cell_t void set_width(scr_coord_val new_width) OVERRIDE; + // When resetting the value, care must be taken not to increase the column width. + void set_values(sint64 value, sint64 sub_value=0); + + sint64 get_value() const { return value; } sint64 get_sub_value() const { return sub_value; } const uint8 get_type() const OVERRIDE { return cell_values; } From 9cb16ae47de36d56f2b23267452776945758a916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Thu, 25 Jul 2024 22:46:08 +0900 Subject: [PATCH 29/32] CHG: Preparing for value cell inheritance --- gui/components/sortable_table.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index 16099bb339..0fc5e805a4 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -109,10 +109,12 @@ class value_cell_t : public table_cell_item_t value_cell_t(sint64 value, gui_chart_t::chart_suffix_t suffix= gui_chart_t::STANDARD, align_t align = left, PIXVAL color = SYSCOL_TEXT); // When resetting the value, care must be taken not to increase the column width. - void set_value(sint64 value); + virtual void set_value(sint64 value); sint64 get_value() const { return value; } + void set_color(PIXVAL color_) { color = color_; } + const uint8 get_type() const OVERRIDE { return cell_value; } void draw(scr_coord offset) OVERRIDE; From e336f6307248cc0962d2bc330145a4f5b0dff771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 26 Jul 2024 19:30:29 +0900 Subject: [PATCH 30/32] CHG: Highlight coordinate cells when selected --- gui/components/sortable_table.cc | 47 ++++++++++++++++++++++++++++++-- gui/components/sortable_table.h | 9 ++++-- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/gui/components/sortable_table.cc b/gui/components/sortable_table.cc index 331fc5e44f..010a0e9145 100644 --- a/gui/components/sortable_table.cc +++ b/gui/components/sortable_table.cc @@ -12,6 +12,7 @@ #include "../../simworld.h" #include "../../simcolor.h" #include "../../display/simgraph.h" +#include "../../display/viewport.h" #include "../../dataobj/translator.h" @@ -82,14 +83,54 @@ void text_cell_t::draw(scr_coord offset) } } -coord_cell_t::coord_cell_t(const char* text, koord coord_, PIXVAL color, align_t align) - : text_cell_t((text==NULL && coord_!=koord::invalid) ? coord.get_fullstr() : text, color, align, coord_ == koord::invalid ? false : true) + +coord_cell_t::coord_cell_t(const char* alt_text, koord coord_, align_t align_) { coord = coord_; - min_size = scr_size(proportional_string_width(translator::translate(get_text())), LINESPACE); + align = align_; + if (alt_text != NULL) { + buf.printf("%s", alt_text); + } + else { + buf.append("-"); + } + min_size = scr_size(proportional_string_width(buf), LINESPACE); + set_size(min_size); +} + +coord_cell_t::coord_cell_t(koord coord_, align_t align_) +{ + coord = coord_; + align = align_; + if (coord != koord::invalid) { + buf.printf("%s", coord.get_str()); + show_posicon = true; + } + else { + buf.append("-"); + } + min_size = scr_size(proportional_string_width(buf) + (D_POS_BUTTON_WIDTH + 2) * show_posicon, show_posicon ? max(LINESPACE, D_POS_BUTTON_HEIGHT) : LINESPACE); set_size(min_size); } +void coord_cell_t::draw(scr_coord offset) +{ + table_cell_item_t::draw(offset); + + offset += pos; + PIXVAL text_col= SYSCOL_TEXT; + if (world()->get_viewport()->get_world_position() == coord) { + text_col=SYSCOL_TEXT_HIGHLIGHT; + if (show_posicon){ + display_color_img(skinverwaltung_t::posbutton->get_image_id(SKIN_BUTTON_POS_PRESSED), offset.x + draw_offset.x, offset.y + (size.h-D_POS_BUTTON_HEIGHT)/2, 0, false, false); + } + } + display_proportional_clip_rgb(offset.x + draw_offset.x + (D_POS_BUTTON_WIDTH+2) * show_posicon, offset.y + draw_offset.y, buf, ALIGN_LEFT, text_col, false); + if (coord != koord::invalid) { + display_fillbox_wh_clip_rgb(offset.x + draw_offset.x + (D_POS_BUTTON_WIDTH + 2) * show_posicon, offset.y + draw_offset.y + LINESPACE - 1, min_size.w - (D_POS_BUTTON_WIDTH + 2) * show_posicon, 1, text_col, false); + } +} + value_cell_t::value_cell_t(sint64 value_, gui_chart_t::chart_suffix_t suffix_, align_t align_, PIXVAL col) { diff --git a/gui/components/sortable_table.h b/gui/components/sortable_table.h index 0fc5e805a4..92da9d66ee 100644 --- a/gui/components/sortable_table.h +++ b/gui/components/sortable_table.h @@ -81,16 +81,21 @@ class text_cell_t : public table_cell_item_t // Hold the coordinates and click a cell to jump to the coordinates. -class coord_cell_t : public text_cell_t +class coord_cell_t : public table_cell_item_t { koord coord; + cbuffer_t buf; + bool show_posicon=false; public: - coord_cell_t(const char* text = NULL, koord coord=koord::invalid, PIXVAL color = SYSCOL_TEXT, align_t align = left); + coord_cell_t(const char* alt_text = NULL, koord coord=koord::invalid, align_t align = left); + coord_cell_t(koord coord = koord::invalid, align_t align = left); koord get_coord() const { return coord; } const uint8 get_type() const OVERRIDE { return cell_coord; } + + void draw(scr_coord offset) OVERRIDE; }; From b18314ef23be002fbd6a2d8bd8633b8d4bfe33c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 26 Jul 2024 19:59:16 +0900 Subject: [PATCH 31/32] CHG: overhaul of depotlist doalog --- gui/depotlist_frame.cc | 449 +++++++++++++++++++---------------------- gui/depotlist_frame.h | 96 +++++---- simdepot.cc | 5 + 3 files changed, 275 insertions(+), 275 deletions(-) diff --git a/gui/depotlist_frame.cc b/gui/depotlist_frame.cc index e933a49535..3e28d37230 100644 --- a/gui/depotlist_frame.cc +++ b/gui/depotlist_frame.cc @@ -10,7 +10,6 @@ #include "../player/simplay.h" #include "../simcity.h" -#include "../simdepot.h" #include "../simskin.h" #include "../simworld.h" @@ -25,248 +24,193 @@ #include "../boden/wege/strasse.h" #include "../bauer/vehikelbauer.h" -enum sort_mode_t { by_name, by_waytype, by_convoys, by_vehicle, by_coord, by_region, SORT_MODES }; +#include "../descriptor/building_desc.h" +#include "../display/viewport.h" + +static const char* const dl_header_text[depotlist_row_t::MAX_COLS] = +{ + "", "Name", "convoys stored", "vehicles stored", "koord", "by_region", "City", "Fixed Costs", "Built in" +}; + +int depotlist_row_t::sort_mode = 0; +bool depotlist_row_t::sortreverse = false; + -uint8 depotlist_stats_t::sort_mode = by_name; -bool depotlist_stats_t::reverse = false; -uint16 depotlist_stats_t::name_width = D_LABEL_WIDTH; uint8 depotlist_frame_t::selected_tab = 0; static karte_ptr_t welt; -bool depotlist_frame_t::is_available_wt(waytype_t wt) + +depot_type_cell_t::depot_type_cell_t(obj_t::typ typ, bool is_electrified) : values_cell_t((sint64)typ, (sint64)is_electrified, SYSCOL_TEXT, true) { - switch (wt) { - case maglev_wt: - return maglev_t::default_maglev ? true : false; - case monorail_wt: - return monorail_t::default_monorail ? true : false; - case track_wt: - return schiene_t::default_schiene ? true : false; - case tram_wt: - return vehicle_builder_t::get_info(tram_wt).empty() ? false : true; - case narrowgauge_wt: - return narrowgauge_t::default_narrowgauge ? true : false; - case road_wt: - return strasse_t::default_strasse ? true : false; - case water_wt: - return vehicle_builder_t::get_info(water_wt).empty() ? false : true; - case air_wt: - return runway_t::default_runway ? true : false; - default: - return false; - } - return false; + align = centered; + min_size = scr_size(D_FIXED_SYMBOL_WIDTH + LINESPACE, ((LINESPACE-2)*2/3-1)); + color = minimap_t::get_depot_color(typ); + + set_size(min_size); } -depotlist_stats_t::depotlist_stats_t(depot_t *d) +void depot_type_cell_t::draw(scr_coord offset) { - this->depot = d; - set_table_layout(7,1); - new_component(0); - const waytype_t wt = d->get_wegtyp(); + table_cell_item_t::draw(offset); - const weg_t *w = welt->lookup(depot->get_pos())->get_weg(wt != tram_wt ? wt : track_wt); - const bool way_electrified = w ? w->is_electrified() : false; - if (way_electrified) { - new_component()->set_image(skinverwaltung_t::electricity->get_image_id(0), true); - } - else { - new_component(skinverwaltung_t::electricity->get_image(0)->w); - } - - lb_name.buf().append( translator::translate(depot->get_name()) ); - const scr_coord_val temp_w = proportional_string_width( translator::translate(depot->get_name()) ); - if (temp_w > name_width) { - name_width = temp_w; - } - lb_name.set_fixed_width(name_width); - add_component(&lb_name); + offset += pos; - lb_cnv_count.init(SYSCOL_TEXT, gui_label_t::right); - lb_cnv_count.set_fixed_width(proportional_string_width(translator::translate("%d convois"))); - add_component(&lb_cnv_count); - lb_vh_count.init(SYSCOL_TEXT, gui_label_t::right); - lb_vh_count.set_fixed_width(proportional_string_width(translator::translate("%d vehicles"))); - add_component(&lb_vh_count); + display_depot_symbol_rgb(offset.x + draw_offset.x, offset.y + draw_offset.y-1, LINESPACE-2, color, false); - add_table(2,1)->set_spacing(scr_size(0,0)); - { - // pos button (depot type) - //// Change the symbol size in the button depending on the depot level - ////const uint8 symbol_width = LINEASCENT-2 + min(2,d->get_tile()->get_desc()->get_level()/3)*2; - //gotopos.set_typ(button_t::posbutton_automatic); - gotopos.set_typ(button_t::depot_automatic); - gotopos.set_targetpos3d(depot->get_pos()); - gotopos.text_color = minimap_t::get_depot_color(depot->get_typ()); - add_component(&gotopos); - - lb_region.buf().printf( " %s ", depot->get_pos().get_2d().get_fullstr() ); - stadt_t* c = welt->get_city(depot->get_pos().get_2d()); - if (c) { - lb_region.buf().append("- "); - lb_region.buf().append( c->get_name() ); - } - if (!welt->get_settings().regions.empty()) { - if (!c) { - lb_region.buf().append("-"); - } - lb_region.buf().printf(" (%s)", translator::translate(welt->get_region_name(depot->get_pos().get_2d()).c_str())); - } - lb_region.update(); - add_component(&lb_region); + if (sub_value) { + display_color_img(skinverwaltung_t::electricity->get_image_id(0), offset.x + draw_offset.x + LINESPACE+2, offset.y + draw_offset.y + (LINESPACE * 2 / 3 - 1)/2 - D_FIXED_SYMBOL_WIDTH/2, 0, false, false); } - end_table(); - update_label(); - - new_component(); } - -void depotlist_stats_t::update_label() +depotlist_row_t::depotlist_row_t(depot_t *dep) { - lb_cnv_count.buf().clear(); - int cnvs = depot->convoi_count(); - if( cnvs == 0 ) { -// buf.append( translator::translate( "no convois" ) ); - } - else if( cnvs == 1 ) { - lb_cnv_count.buf().append( translator::translate( "1 convoi" ) ); - } - else { - lb_cnv_count.buf().printf( translator::translate( "%d convois" ), cnvs ); - } - lb_cnv_count.update(); + assert(depot!=NULL); + depot = dep; - int vhls = depot->get_vehicle_list().get_count(); - lb_vh_count.buf().clear(); - if( vhls == 0 ) { - //buf.append( translator::translate( "Keine Einzelfahrzeuge im Depot" ) ); - } - else if( vhls == 1 ) { - lb_vh_count.buf().append( translator::translate( "1 vehicle" ) ); - } - else { - lb_vh_count.buf().printf( translator::translate( "%d vehicles" ), vhls ); - } - if(uint32 for_sale_cnt=depot->get_vehicles_for_sale().get_count()){ - lb_vh_count.buf().printf("(%u)", for_sale_cnt); + // 1. type + const waytype_t wt = depot->get_wegtyp(); + const weg_t* w = welt->lookup(depot->get_pos())->get_weg(wt != tram_wt ? wt : track_wt); + const bool way_electrified = w ? w->is_electrified() : false; + new_component(depot->get_typ(), way_electrified); + // 2. name + new_component(depot->get_name()); + // 3. convoys + old_convoys = depot->get_convoy_list().get_count(); + new_component((sint64)old_convoys, gui_chart_t::STANDARD, table_cell_item_t::right, old_convoys ? SYSCOL_TEXT : SYSCOL_TEXT_INACTIVE); + // 4. vehicle count and listed count + const sint64 listed_vehicles = (sint64)depot->get_vehicles_for_sale().get_count(); + old_vehicles = depot->get_vehicle_list().get_count(); + new_component((sint64)old_vehicles+listed_vehicles, listed_vehicles, SYSCOL_TEXT, true); + // 5. pos + const koord depot_pos = depot->get_pos().get_2d(); + new_component(depot_pos, table_cell_item_t::centered); + // 6. region + new_component(welt->get_settings().regions.empty() ? "" : translator::translate(welt->get_region_name(depot_pos).c_str())); + // 7. city + stadt_t* c = welt->get_city(depot_pos); + new_component(c ? c->get_name() : "-", c ? c->get_center(): koord::invalid); + // 8. Fixed Costs + sint64 maintenance = depot->get_tile()->get_desc()->get_maintenance(); + if (maintenance == PRICE_MAGIC) + { + maintenance = depot->get_tile()->get_desc()->get_level() * welt->get_settings().maint_building; } + new_component((double)welt->calc_adjusted_monthly_figure(maintenance), gui_chart_t::MONEY, table_cell_item_t::right); + // 9. Built date + new_component((sint64)depot->get_purchase_time(), gui_chart_t::DATE, table_cell_item_t::right); - lb_vh_count.update(); -} + // Possibility of adding items: + // supported traction types + // init cells height + for (auto& cell : owned_cells) { + cell->set_height(row_height); + } -void depotlist_stats_t::set_size(scr_size size) -{ - gui_aligned_container_t::set_size(size); } - -bool depotlist_stats_t::is_valid() const +void depotlist_row_t::draw(scr_coord offset) { - return depot_t::get_depot_list().is_contained(depot); + if (old_convoys != depot->get_convoy_list().get_count()) { + value_cell_t *cell = dynamic_cast(owned_cells[DEPOT_CONVOYS]); + old_convoys = depot->get_convoy_list().get_count(); + cell->set_value((sint64)old_convoys); + cell->set_color(old_convoys ? SYSCOL_TEXT : SYSCOL_TEXT_INACTIVE); + } + if (old_vehicles != depot->get_vehicle_list().get_count()) { + values_cell_t* cell = dynamic_cast(owned_cells[DEPOT_VEHICLES]); + old_vehicles = depot->get_vehicle_list().get_count(); + cell->set_values((sint64)old_vehicles, (sint64)depot->get_vehicles_for_sale().get_count()); + } + gui_sort_table_row_t::draw(offset); } - -bool depotlist_stats_t::infowin_event(const event_t * ev) +void depotlist_row_t::show_depot() { - bool swallowed = gui_aligned_container_t::infowin_event(ev); - - if( !swallowed && IS_LEFTRELEASE(ev) ) { + if (depot->get_owner() == world()->get_active_player() ) { depot->show_info(); - swallowed = true; } - return swallowed; -} - - -void depotlist_stats_t::draw(scr_coord pos) -{ - update_label(); - - gui_aligned_container_t::draw(pos); } -bool depotlist_stats_t::compare(const gui_component_t *aa, const gui_component_t *bb) +bool depotlist_row_t::infowin_event(const event_t* ev) { - const depotlist_stats_t* fa = dynamic_cast(aa); - const depotlist_stats_t* fb = dynamic_cast(bb); - // good luck with mixed lists - assert(fa != NULL && fb != NULL); - depot_t *a=fa->depot, *b=fb->depot; - - int cmp; - switch( sort_mode ) { - default: - case by_coord: - cmp = 0; - break; - - case by_region: - cmp = welt->get_region(a->get_pos().get_2d()) - welt->get_region(b->get_pos().get_2d()); - if (cmp == 0) { - const koord a_city_koord = welt->get_city(a->get_pos().get_2d()) ? welt->get_city(a->get_pos().get_2d())->get_pos() : koord(0, 0); - const koord b_city_koord = welt->get_city(b->get_pos().get_2d()) ? welt->get_city(b->get_pos().get_2d())->get_pos() : koord(0, 0); - cmp = a_city_koord.x - b_city_koord.x; - if (cmp == 0) { - cmp = a_city_koord.y - b_city_koord.y; + bool swallowed = gui_scrolled_list_t::scrollitem_t::infowin_event(ev); + + if (!swallowed && depot) { + if (IS_RIGHTRELEASE(ev)) { + for (auto& cell : owned_cells) { + if (cell->get_type() == table_cell_item_t::cell_coord && cell->getroffen(ev->mouse_pos)) { + const coord_cell_t* coord_cell = dynamic_cast(cell); + const koord k = coord_cell->get_coord(); + if (k != koord::invalid) { + world()->get_viewport()->change_world_position(k); + return true; + } + return false; + } } } - break; - - case by_name: - cmp = strcmp(a->get_name(), b->get_name()); - break; - - case by_waytype: - cmp = a->get_waytype() - b->get_waytype(); - if (cmp == 0) { - cmp = strcmp(a->get_name(), b->get_name()); - } - break; + } + return swallowed; +} - case by_convoys: - cmp = a->convoi_count() - b->convoi_count(); - if( cmp == 0 ) { - cmp = a->get_vehicle_list().get_count() - b->get_vehicle_list().get_count(); - } - break; - case by_vehicle: - cmp = a->get_vehicle_list().get_count() - b->get_vehicle_list().get_count(); - if( cmp == 0 ) { - cmp = a->convoi_count() - b->convoi_count(); - } - break; +bool depotlist_row_t::compare(const gui_component_t* aa, const gui_component_t* bb) +{ + const depotlist_row_t* row_a = dynamic_cast(aa); + const depotlist_row_t* row_b = dynamic_cast(bb); + if (row_a == NULL || row_b == NULL) { + dbg->warning("depotlist_row_t::compare()", "row data error"); + return false; } - if (cmp == 0) { - cmp = koord_distance( a->get_pos(), koord( 0, 0 ) ) - koord_distance( b->get_pos(), koord( 0, 0 ) ); - if( cmp == 0 ) { - cmp = a->get_pos().x - b->get_pos().x; - } + + const table_cell_item_t* a = row_a->get_element(sort_mode); + const table_cell_item_t* b = row_b->get_element(sort_mode); + if (a == NULL || b == NULL) { + dbg->warning("depotlist_row_t::compare()", "Could not get table_cell_item_t successfully"); + return false; } - return reverse ? cmp > 0 : cmp < 0; + + int cmp = gui_sort_table_row_t::compare(a, b); + return sortreverse ? cmp < 0 : cmp > 0; // Do not include 0 } +bool depotlist_frame_t::is_available_wt(waytype_t wt) +{ + switch (wt) { + case maglev_wt: + return maglev_t::default_maglev ? true : false; + case monorail_wt: + return monorail_t::default_monorail ? true : false; + case track_wt: + return schiene_t::default_schiene ? true : false; + case tram_wt: + return vehicle_builder_t::get_info(tram_wt).empty() ? false : true; + case narrowgauge_wt: + return narrowgauge_t::default_narrowgauge ? true : false; + case road_wt: + return strasse_t::default_strasse ? true : false; + case water_wt: + return vehicle_builder_t::get_info(water_wt).empty() ? false : true; + case air_wt: + return runway_t::default_runway ? true : false; + default: + return false; + } + return false; +} -static const char *sort_text[SORT_MODES] = { - "hl_btn_sort_name", - "waytype", - "convoys stored", - "vehicles stored", - "koord", - "by_region" -}; depotlist_frame_t::depotlist_frame_t(player_t *player) : gui_frame_t( translator::translate("dp_title"), player ), - scrolly(gui_scrolled_list_t::windowskin, depotlist_stats_t::compare) + scrolly(gui_scrolled_list_t::windowskin, depotlist_row_t::compare), + scroll_tab(&cont_sortable, true, false) { this->player = player; @@ -276,7 +220,8 @@ depotlist_frame_t::depotlist_frame_t(player_t *player) : depotlist_frame_t::depotlist_frame_t() : gui_frame_t(translator::translate("dp_title"), NULL), - scrolly(gui_scrolled_list_t::windowskin, depotlist_stats_t::compare) + scrolly(gui_scrolled_list_t::windowskin, depotlist_row_t::compare), + scroll_tab(&cont_sortable, true, false) { player = NULL; @@ -288,48 +233,38 @@ void depotlist_frame_t::init_table() { last_depot_count = 0; - set_table_layout(1,0); + scrolly.add_listener(this); + scrolly.set_show_scroll_x(false); + scrolly.set_checkered(true); + scrolly.set_scroll_amount_y(LINESPACE + D_H_SPACE + 2); // default cell height - add_table(3,1); - { - new_component("hl_txt_sort"); - add_table(3,1); - { - sortedby.clear_elements(); - for (int i = 0; i < SORT_MODES; i++) { - sortedby.new_component(translator::translate(sort_text[i]), SYSCOL_TEXT); - } - sortedby.set_selection(depotlist_stats_t::sort_mode); - sortedby.add_listener(this); - sortedby.set_width_fixed(true); - sortedby.set_width(LINESPACE*12); - add_component(&sortedby); - - // sort asc/desc switching button - sort_order.init(button_t::sortarrow_state, ""); - sort_order.set_tooltip(translator::translate("hl_btn_sort_order")); - sort_order.add_listener(this); - sort_order.pressed = depotlist_stats_t::reverse; - add_component(&sort_order); - - new_component(D_H_SPACE*2); - } - end_table(); + scroll_tab.set_maximize(true); - lb_depot_counter.set_fixed_width(proportional_string_width("8888/8888")); - add_component(&lb_depot_counter); + // init table sort buttons + table_header.add_listener(this); + for (uint8 col = 0; col < depotlist_row_t::MAX_COLS; col++) { + table_header.new_component(dl_header_text[col]); } - end_table(); - tabs.init_tabs(&scrolly); + cont_sortable.set_margin(NO_SPACING, NO_SPACING); + cont_sortable.set_spacing(NO_SPACING); + cont_sortable.set_table_layout(1, 2); + cont_sortable.set_alignment(ALIGN_TOP); // Without this, the layout will be broken if the height is small. + cont_sortable.add_component(&table_header); + cont_sortable.add_component(&scrolly); + + set_table_layout(1,0); + + lb_depot_counter.set_fixed_width(proportional_string_width("8888/8888")); + add_component(&lb_depot_counter); + + tabs.init_tabs(&scroll_tab); tabs.add_listener(this); add_component(&tabs); + set_min_windowsize(scr_size(LINESPACE*24, LINESPACE*12)); fill_list(); set_resizemode(diagonal_resize); - scrolly.set_maximize(true); - scrolly.set_checkered(true); - reset_min_windowsize(); } /** @@ -340,15 +275,18 @@ bool depotlist_frame_t::action_triggered( gui_action_creator_t *comp,value_t v) if (comp == &tabs) { fill_list(); } - else if(comp == &sortedby) { - depotlist_stats_t::sort_mode = max(0, v.i); + else if (comp == &table_header) { + depotlist_row_t::sort_mode = v.i; + table_header.set_selection(depotlist_row_t::sort_mode); + depotlist_row_t::sortreverse = table_header.is_reversed(); scrolly.sort(0); } - else if (comp == &sort_order) { - depotlist_stats_t::reverse = !depotlist_stats_t::reverse; - scrolly.sort(0); - sort_order.pressed = depotlist_stats_t::reverse; + else if ( comp == &scrolly ) { + scrolly.get_selection(); + depotlist_row_t* row = (depotlist_row_t*)scrolly.get_element(v.i); + row->show_depot(); } + return true; } @@ -360,7 +298,7 @@ void depotlist_frame_t::fill_list() for(depot_t* const depot : depot_t::get_depot_list()) { if( depot->get_owner() == player ) { if( tabs.get_active_tab_index() == 0 || depot->get_waytype() == tabs.get_active_tab_waytype() ) { - scrolly.new_component(depot); + scrolly.new_component(depot); } p_total++; } @@ -370,6 +308,39 @@ void depotlist_frame_t::fill_list() scrolly.sort(0); scrolly.set_size(scr_size(get_windowsize().w, scrolly.get_size().h)); + // recalc stats table width + scr_coord_val max_widths[depotlist_row_t::MAX_COLS] = {}; + + // check column widths + table_header.set_selection(depotlist_row_t::sort_mode); + table_header.set_width(D_H_SPACE); // init width + for (uint c = 0; c < depotlist_row_t::MAX_COLS; c++) { + // get header widths + max_widths[c] = table_header.get_min_width(c); + } + for (int r = 0; r < scrolly.get_count(); r++) { + depotlist_row_t* row = (depotlist_row_t*)scrolly.get_element(r); + for (uint c = 0; c < depotlist_row_t::MAX_COLS; c++) { + max_widths[c] = max(max_widths[c], row->get_min_width(c)); + } + } + + // set column widths + for (uint c = 0; c < depotlist_row_t::MAX_COLS; c++) { + table_header.set_col(c, max_widths[c]); + } + table_header.set_width(table_header.get_size().w + D_SCROLLBAR_WIDTH); + + for (int r = 0; r < scrolly.get_count(); r++) { + depotlist_row_t* row = (depotlist_row_t*)scrolly.get_element(r); + row->set_size(scr_size(0, row->get_size().h)); + for (uint c = 0; c < depotlist_row_t::MAX_COLS; c++) { + row->set_col(c, max_widths[c]); + } + } + + cont_sortable.set_size(cont_sortable.get_min_size()); + last_depot_count = depot_t::get_depot_list().get_count(); resize(scr_coord(0, 0)); } @@ -392,8 +363,8 @@ void depotlist_frame_t::rdwr(loadsave_t *file) selected_tab = tabs.get_active_tab_index(); file->rdwr_byte(selected_tab); - file->rdwr_bool(sort_order.pressed); - uint8 s = depotlist_stats_t::sort_mode; + file->rdwr_bool(depotlist_row_t::sortreverse); + uint8 s = (uint8)depotlist_row_t::sort_mode; file->rdwr_byte(s); file->rdwr_byte(player_nr); size.rdwr(file); @@ -402,9 +373,7 @@ void depotlist_frame_t::rdwr(loadsave_t *file) player = welt->get_player(player_nr); gui_frame_t::set_owner(player); win_set_magic(this, magic_depotlist + player_nr); - sortedby.set_selection(s); - depotlist_stats_t::sort_mode = s; - depotlist_stats_t::reverse = sort_order.pressed; + depotlist_row_t::sort_mode = (int)s; tabs.set_active_tab_index(selected_tabget_name(); } + + void show_depot(); + + bool infowin_event(event_t const* ev) OVERRIDE; + + void draw(scr_coord offset) OVERRIDE; + + static bool compare(const gui_component_t* aa, const gui_component_t* bb); +}; + class depotlist_frame_t : public gui_frame_t, private action_listener_t { private: - gui_combobox_t sortedby; - button_t sort_order; + gui_sort_table_header_t table_header; + gui_aligned_container_t cont_sortable; gui_scrolled_list_t scrolly; + gui_scrollpane_t scroll_tab; + gui_label_buf_t lb_depot_counter; gui_waytype_tab_panel_t tabs; @@ -33,8 +90,6 @@ class depotlist_frame_t : public gui_frame_t, private action_listener_t uint32 last_depot_count; static uint8 selected_tab; - void fill_list(); - void init_table(); player_t *player; @@ -46,6 +101,8 @@ class depotlist_frame_t : public gui_frame_t, private action_listener_t const char *get_help_filename() const OVERRIDE {return "depotlist.txt"; } + void fill_list(); + bool action_triggered(gui_action_creator_t*, value_t) OVERRIDE; void draw(scr_coord pos, scr_size size) OVERRIDE; @@ -62,35 +119,4 @@ class depotlist_frame_t : public gui_frame_t, private action_listener_t }; -class depotlist_stats_t : public gui_aligned_container_t, public gui_scrolled_list_t::scrollitem_t -{ -private: - depot_t *depot; - gui_label_buf_t - lb_name, - lb_cnv_count, - lb_vh_count, - lb_region; - gui_image_t waytype_symbol; - button_t gotopos; - - void update_label(); - -public: - static uint8 sort_mode; - static bool reverse; - static uint16 name_width; - - depotlist_stats_t(depot_t *); - - void draw( scr_coord pos) OVERRIDE; - - char const* get_text() const OVERRIDE { return ""; /* label.buf().get_str(); */ } - bool infowin_event(const event_t *) OVERRIDE; - bool is_valid() const OVERRIDE; - void set_size(scr_size size) OVERRIDE; - - static bool compare(const gui_component_t *a, const gui_component_t *b ); -}; - #endif diff --git a/simdepot.cc b/simdepot.cc index a5321524d7..fff10d96b5 100644 --- a/simdepot.cc +++ b/simdepot.cc @@ -22,6 +22,7 @@ #include "gui/depot_frame.h" #include "gui/messagebox.h" +#include "gui/depotlist_frame.h" #include "dataobj/schedule.h" #include "dataobj/loadsave.h" @@ -850,6 +851,10 @@ void depot_t::set_name(const char* value) if (win) { win->reset_depot_name(); } + depotlist_frame_t *win2 = dynamic_cast(win_get_magic(magic_depotlist+get_owner_nr())); + if (win2) { + win2->fill_list(); + } } const char* depot_t::get_name() const From 01033ed0dd9eb56a57d71ed23a1c0cdc156d0495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Fri, 2 Aug 2024 01:18:07 +0900 Subject: [PATCH 32/32] FIX: Name Filter Highlighting --- gui/components/sortable_table_vehicle.cc | 3 +++ gui/components/sortable_table_vehicle.h | 7 ++++--- gui/vehiclelist_frame.cc | 9 ++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/gui/components/sortable_table_vehicle.cc b/gui/components/sortable_table_vehicle.cc index 59f8fb4988..a95d3baf6b 100644 --- a/gui/components/sortable_table_vehicle.cc +++ b/gui/components/sortable_table_vehicle.cc @@ -235,6 +235,9 @@ vehicle_desc_row_t::vehicle_desc_row_t(const vehicle_desc_t* desc) void vehicle_desc_row_t::update_highlight() { old_filter_flag=filter_flag; + if (!side_view_mode) { + set_highlight(VD_NAME, filter_flag & VL_FILTER_NAME); + } set_highlight(VD_ENGINE_TYPE, filter_flag&VL_FILTER_FUEL); set_highlight(VD_FREIGHT_TYPE, filter_flag&VL_FILTER_FREIGHT); set_highlight(VD_STATUSBAR, filter_flag&VL_FILTER_UPGRADABLE); diff --git a/gui/components/sortable_table_vehicle.h b/gui/components/sortable_table_vehicle.h index 3fbab2d03c..4ef3c8712d 100644 --- a/gui/components/sortable_table_vehicle.h +++ b/gui/components/sortable_table_vehicle.h @@ -98,9 +98,10 @@ class vehicle_desc_row_t : public gui_sort_table_row_t // 1=fuel filer on, 2=freight type fiter on enum { VL_NO_FILTER = 0, - VL_FILTER_FUEL = 1 << 0, - VL_FILTER_FREIGHT = 1 << 1, - VL_FILTER_UPGRADABLE = 1 << 2 + VL_FILTER_NAME = 1 << 0, + VL_FILTER_FUEL = 1 << 1, + VL_FILTER_FREIGHT = 1 << 2, + VL_FILTER_UPGRADABLE = 1 << 3 }; static uint8 filter_flag; uint8 old_filter_flag=0; diff --git a/gui/vehiclelist_frame.cc b/gui/vehiclelist_frame.cc index 55c86e7919..08082a4812 100644 --- a/gui/vehiclelist_frame.cc +++ b/gui/vehiclelist_frame.cc @@ -262,9 +262,16 @@ void vehiclelist_frame_t::fill_list() vehicle_desc_row_t::filter_flag &= ~vehicle_desc_row_t::VL_FILTER_UPGRADABLE; } + strcpy(last_name_filter, name_filter); + if (last_name_filter[0] == 0) { + vehicle_desc_row_t::filter_flag &= ~vehicle_desc_row_t::VL_FILTER_NAME; + } + else { + vehicle_desc_row_t::filter_flag |= vehicle_desc_row_t::VL_FILTER_NAME; + } + scrolly.clear_elements(); - strcpy(last_name_filter, name_filter); count = 0; uint32 month = world()->get_current_month(); const goods_desc_t *ware = idx_to_ware[ max( 0, ware_filter.get_selection() ) ];