gui/gui_theme.cc | 7 ++++++- gui/gui_theme.h | 3 +++ gui/map_frame.cc | 6 ++++-- simhalt.cc | 26 +++++++++++++------------- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/gui/gui_theme.cc b/gui/gui_theme.cc index a5865b616..e491f4faa 100644 --- a/gui/gui_theme.cc +++ b/gui/gui_theme.cc @@ -91,6 +91,7 @@ KOORD_VAL gui_theme_t::gui_frame_right; KOORD_VAL gui_theme_t::gui_frame_bottom; KOORD_VAL gui_theme_t::gui_hspace; KOORD_VAL gui_theme_t::gui_vspace; +KOORD_VAL gui_theme_t::gui_waitingbar_width; /* those are the 3x3 images which are used for stretching * also 1x3 and 3x1 subsets are possible @@ -196,6 +197,7 @@ void gui_theme_t::init_gui_defaults() gui_hspace = 4; gui_vspace = 4; gui_divider_size.h = D_V_SPACE*2; + gui_waitingbar_width = 4; gui_drop_shadows = false; } @@ -501,7 +503,10 @@ bool gui_theme_t::themes_init(const char *file_name, bool init_fonts ) gui_theme_t::gui_shadow_color = (PIXVAL)contents.get_color("gui_shadow_color", SYSCOL_SHADOW); // those two may be rather an own control later on? - gui_theme_t::gui_indicator_size = contents.get_scr_size("gui_indicator_size", gui_theme_t::gui_indicator_size ); + gui_theme_t::gui_indicator_size.w = (uint32)contents.get_int("gui_indicator_width", gui_theme_t::gui_indicator_size.w ); + gui_theme_t::gui_indicator_size.h = (uint32)contents.get_int("gui_indicator_height", gui_theme_t::gui_indicator_size.h ); + gui_theme_t::gui_waitingbar_width = (uint32)contents.get_int("gui_waitingbar_width", gui_theme_t::gui_waitingbar_width); + gui_tab_panel_t::header_vsize = (uint32)contents.get_int("gui_tab_header_vsize", gui_tab_panel_t::header_vsize ); diff --git a/gui/gui_theme.h b/gui/gui_theme.h index 73fc1a2fa..b061c3790 100644 --- a/gui/gui_theme.h +++ b/gui/gui_theme.h @@ -95,6 +95,8 @@ class image_t; #define D_STATUSBAR_HEIGHT (max(16,LINESPACE)) // statusbar bottom of screen #define D_TAB_HEADER_HEIGHT (gui_tab_panel_t::header_vsize) // Tab page params (replace with real values from the skin images) +#define D_WAITINGBAR_WIDTH (gui_theme_t::gui_waitingbar_width) // bars of goods waiting in stations + // Dialog borders #define D_MARGIN_LEFT (gui_theme_t::gui_frame_left) #define D_MARGIN_TOP (gui_theme_t::gui_frame_top) @@ -269,6 +271,7 @@ public: static KOORD_VAL gui_frame_bottom; static KOORD_VAL gui_hspace; static KOORD_VAL gui_vspace; + static KOORD_VAL gui_waitingbar_width; /// @} // those are the 3x3 images which are used for stretching diff --git a/gui/map_frame.cc b/gui/map_frame.cc index 0bcb28a61..425229a99 100644 --- a/gui/map_frame.cc +++ b/gui/map_frame.cc @@ -79,9 +79,11 @@ public: } void draw(scr_coord offset) OVERRIDE - { + { scr_coord pos = get_pos() + offset; - display_fillbox_wh_clip_rgb(pos.x, pos.y + D_GET_CENTER_ALIGN_OFFSET(D_INDICATOR_BOX_HEIGHT,LINESPACE), D_INDICATOR_BOX_WIDTH, D_INDICATOR_BOX_HEIGHT, color, false); + + display_ddd_box_clip_rgb(pos.x, pos.y + D_GET_CENTER_ALIGN_OFFSET(D_INDICATOR_BOX_HEIGHT,LINESPACE), D_INDICATOR_BOX_WIDTH, D_INDICATOR_HEIGHT, color_idx_to_rgb(MN_GREY0), color_idx_to_rgb(MN_GREY4)); + display_fillbox_wh_clip_rgb(pos.x + 1, pos.y + 1 + D_GET_CENTER_ALIGN_OFFSET(D_INDICATOR_BOX_HEIGHT,LINESPACE), D_INDICATOR_BOX_WIDTH - 2, D_INDICATOR_HEIGHT-2, color, true); label.draw(pos + scr_size(D_INDICATOR_BOX_WIDTH + D_H_SPACE, 0)); } }; diff --git a/simhalt.cc b/simhalt.cc index 85b8afe86..ba07eec00 100644 --- a/simhalt.cc +++ b/simhalt.cc @@ -3009,7 +3009,7 @@ void haltestelle_t::recalc_status() goods_desc_t const* const wtyp = goods_manager_t::get_info(i); const uint32 ware_sum = get_ware_summe(wtyp); total_sum += ware_sum; - if(ware_sum>max_ware) { + if(ware_sum>=max_ware) { status_bits |= ware_sum > max_ware + 32 ? 2 : 1; // for now report only serious overcrowding on transfer stops overcrowded[wtyp->get_index()/8] |= 1<<(wtyp->get_index()%8); } @@ -3053,8 +3053,8 @@ void haltestelle_t::display_status(KOORD_VAL xpos, KOORD_VAL ypos) max_bar_height = last_bar_height[i]; } } - const KOORD_VAL x = xpos - (last_bar_count * 4 - get_tile_raster_width()) / 2; - mark_rect_dirty_wc( x - 1 - 4, ypos - 11 - max_bar_height - 6, x + last_bar_count * 4 + 12 - 2, ypos - 11 ); + const KOORD_VAL x = xpos - (last_bar_count * D_WAITINGBAR_WIDTH - get_tile_raster_width()) / 2; + mark_rect_dirty_wc( x - 1 - D_WAITINGBAR_WIDTH, ypos - 11 - max_bar_height - 6, x + last_bar_count * D_WAITINGBAR_WIDTH + 12 - 2, ypos - 11 ); // reset bar heights for new count last_bar_height.clear(); @@ -3065,8 +3065,8 @@ void haltestelle_t::display_status(KOORD_VAL xpos, KOORD_VAL ypos) last_bar_count = count; } - ypos -= 11; - xpos -= (count * 4 - get_tile_raster_width()) / 2; + ypos -= D_LABEL_HEIGHT/2 +D_WAITINGBAR_WIDTH; + xpos -= (count * D_WAITINGBAR_WIDTH - get_tile_raster_width()) / 2; const KOORD_VAL x = xpos; sint16 bar_height_index = 0; @@ -3093,30 +3093,30 @@ void haltestelle_t::display_status(KOORD_VAL xpos, KOORD_VAL ypos) } display_fillbox_wh_clip_rgb( xpos, ypos - v - 1, 1, v, color_idx_to_rgb(COL_GREY4), false); - display_fillbox_wh_clip_rgb( xpos + 1, ypos - v - 1, 2, v, wtyp->get_color(), false); - display_fillbox_wh_clip_rgb( xpos + 3, ypos - v - 1, 1, v, color_idx_to_rgb(COL_GREY1), false); + display_fillbox_wh_clip_rgb( xpos + 1, ypos - v - 1, D_WAITINGBAR_WIDTH-2, v, wtyp->get_color(), false); + display_fillbox_wh_clip_rgb( xpos + D_WAITINGBAR_WIDTH-1, ypos - v - 1, 1, v, color_idx_to_rgb(COL_GREY1), false); // Hajo: show up arrow for capped values if( sum > max_capacity ) { - display_fillbox_wh_clip_rgb( xpos + 1, ypos - v - 6, 2, 4, color_idx_to_rgb(COL_WHITE), false); - display_fillbox_wh_clip_rgb( xpos, ypos - v - 5, 4, 1, color_idx_to_rgb(COL_WHITE), false); + display_fillbox_wh_clip_rgb( xpos + (D_WAITINGBAR_WIDTH/2)-1, ypos - v - 6, 2, 4, color_idx_to_rgb(COL_WHITE), false); + display_fillbox_wh_clip_rgb( xpos + (D_WAITINGBAR_WIDTH/2)-2, ypos - v - 5, 4 , 1, color_idx_to_rgb(COL_WHITE), false); v += 5; // for marking dirty } if( last_bar_height[bar_height_index] != (KOORD_VAL)v ) { if( (KOORD_VAL)v > last_bar_height[bar_height_index] ) { // bar will be longer, mark new height dirty - mark_rect_dirty_wc( xpos, ypos - v - 1, xpos + 3, ypos - 1); + mark_rect_dirty_wc( xpos, ypos - v - 1, xpos + D_WAITINGBAR_WIDTH, ypos - 1); } else { // bar will be shorter, mark old height dirty - mark_rect_dirty_wc( xpos, ypos - last_bar_height[bar_height_index] - 1, xpos + 3, ypos - 1); + mark_rect_dirty_wc( xpos, ypos - last_bar_height[bar_height_index] - 1, xpos + D_WAITINGBAR_WIDTH, ypos - 1); } last_bar_height[bar_height_index] = v; } bar_height_index++; - xpos += 4; + xpos += D_WAITINGBAR_WIDTH; } } @@ -3126,7 +3126,7 @@ void haltestelle_t::display_status(KOORD_VAL xpos, KOORD_VAL ypos) last_status_color = get_status_farbe(); dirty = true; } - display_fillbox_wh_clip_rgb( x - 1 - 4, ypos, count * 4 + 12 - 2, 4, get_status_farbe(), dirty ); + display_fillbox_wh_clip_rgb( x - 1 - 4, ypos, count * D_WAITINGBAR_WIDTH + 12 - 2, D_WAITINGBAR_WIDTH, get_status_farbe(), dirty ); }