Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vehicle trading between players #669

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b9b9a24
FIX: Attempting to send messages when initializing the map
Ranran-the-JuicyPork Jul 10, 2024
5ab8ba4
FIX: Poorly designed because it is not theme-dependent. (Arrange Hajo…
Ranran-the-JuicyPork Jul 11, 2024
799ba8d
CHG: Adjusting the layout when there is no cargo on the vehicle
Ranran-the-JuicyPork Jul 11, 2024
2777c7c
FIX: Image buttons can sometimes be too small for the font
Ranran-the-JuicyPork Jul 16, 2024
07a6ecc
FIX: The width of the combo box is determined ambiguously, so it may …
Ranran-the-JuicyPork Jul 16, 2024
71fce0d
FIX: Convoy display height not being applied correctly
Ranran-the-JuicyPork Jul 16, 2024
08ef575
FIX: Combobox width is too narrow
Ranran-the-JuicyPork Jul 16, 2024
fb5883a
FIX: Image buttons are unintentionally large
Ranran-the-JuicyPork Jul 16, 2024
4eb045d
FIX: broken multiple_selection
Ranran-the-JuicyPork Jun 27, 2024
e839252
CHG: Allow multiple selection without ctrl key
Ranran-the-JuicyPork Jun 27, 2024
486ace3
CODE: overhaul of vehicle list
Ranran-the-JuicyPork Jul 18, 2024
98c7be7
CODE] remove unnecessary include
Ranran-the-JuicyPork Jul 18, 2024
0790d21
FIX: The borders are slightly misaligned
Ranran-the-JuicyPork Jul 19, 2024
d1c7e57
FIX: the layout will be broken if the height is small
Ranran-the-JuicyPork Jul 19, 2024
2d997e2
💰🚃 NEW: Vehicle trading between players
Ranran-the-JuicyPork Jul 19, 2024
ea4cf88
FIX: The borders are slightly misaligned
Ranran-the-JuicyPork Jul 19, 2024
39959a5
FIX: the layout will be broken if the height is small
Ranran-the-JuicyPork Jul 19, 2024
c322a30
:jp: ADD Japanese translations for vehicle trading feature
Ranran-the-JuicyPork Jul 19, 2024
421c97c
Update ja.tab
Ranran-the-JuicyPork Jul 20, 2024
3d14fff
FIX: table layout
Ranran-the-JuicyPork Jul 20, 2024
b94afca
UPDATE value_cell_t, add distance and time format
Ranran-the-JuicyPork Jul 20, 2024
7659316
UPDATE sort table, coord type cell
Ranran-the-JuicyPork Jul 20, 2024
c15d91d
Merge remote-tracking branch 'refs/remotes/origin/2407-S0-sortable-ta…
Ranran-the-JuicyPork Jul 20, 2024
555c466
CODE: change date format name
Ranran-the-JuicyPork Jul 20, 2024
c381b6a
CHG: Make it possible to jump by clicking on the coord cell
Ranran-the-JuicyPork Jul 21, 2024
a4aacd8
FIX: missing compare coord_cell
Ranran-the-JuicyPork Jul 24, 2024
c7781a8
CHG: text_cell can be underlined
Ranran-the-JuicyPork Jul 24, 2024
7479d50
CHG: can choose to display the values ​​cell in one or two lines.
Ranran-the-JuicyPork Jul 24, 2024
03e6fbd
CHG: The cell value can be updated externally later
Ranran-the-JuicyPork Jul 24, 2024
9cb16ae
CHG: Preparing for value cell inheritance
Ranran-the-JuicyPork Jul 25, 2024
e336f63
CHG: Highlight coordinate cells when selected
Ranran-the-JuicyPork Jul 26, 2024
4d5b0db
Merge remote-tracking branch 'refs/remotes/origin/2407-S0-sortable-ta…
Ranran-the-JuicyPork Jul 26, 2024
b18314e
CHG: overhaul of depotlist doalog
Ranran-the-JuicyPork Jul 26, 2024
01033ed
FIX: Name Filter Highlighting
Ranran-the-JuicyPork Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -493,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
Expand Down
8 changes: 8 additions & 0 deletions Simutrans-Extended.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,7 @@
<ClCompile Include="descriptor\way_desc.cc" />
<ClCompile Include="gui\pier_rotation_select.cc" />
<ClCompile Include="gui\vehicle_detail.cc" />
<ClCompile Include="gui\vehicle_manager.cc" />
<ClCompile Include="io\classify_file.cc" />
<ClCompile Include="io\raw_image.cc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (non-graphical server)|Win32'">true</ExcludedFromBuild>
Expand Down Expand Up @@ -2347,6 +2348,9 @@
<ClCompile Include="gui\components\gui_textinput.cc" />
<ClCompile Include="gui\components\gui_vehicle_capacitybar.cc" />
<ClCompile Include="gui\components\gui_vehicle_cargoinfo.cc" />
<ClCompile Include="gui\components\sortable_table.cc" />
<ClCompile Include="gui\components\sortable_table_header.cc" />
<ClCompile Include="gui\components\sortable_table_vehicle.cc" />
<ClCompile Include="gui\components\gui_waytype_image_box.cc" />
<ClCompile Include="gui\components\gui_waytype_tab_panel.cc" />
<ClCompile Include="gui\components\gui_world_view_t.cc" />
Expand Down Expand Up @@ -2630,6 +2634,7 @@
<ClInclude Include="gui\privatesign_info.h" />
<ClInclude Include="gui\scenario_info.h" />
<ClInclude Include="gui\vehicle_detail.h" />
<ClInclude Include="gui\vehicle_manager.h" />
<ClInclude Include="gui\water_info.h" />
<ClInclude Include="gui\server_frame.h" />
<ClInclude Include="gui\signal_connector_gui.h" />
Expand Down Expand Up @@ -2836,6 +2841,9 @@
<ClInclude Include="gui\components\gui_textinput.h" />
<ClInclude Include="gui\components\gui_vehicle_capacitybar.h" />
<ClInclude Include="gui\components\gui_vehicle_cargoinfo.h" />
<ClInclude Include="gui\components\sortable_table.h" />
<ClInclude Include="gui\components\sortable_table_header.h" />
<ClInclude Include="gui\components\sortable_table_vehicle.h" />
<ClInclude Include="gui\components\gui_waytype_image_box.h" />
<ClInclude Include="gui\components\gui_waytype_tab_panel.h" />
<ClInclude Include="gui\components\gui_world_view_t.h" />
Expand Down
4 changes: 4 additions & 0 deletions cmake/SimutransSourceList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -229,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
Expand Down
6 changes: 2 additions & 4 deletions gui/components/gui_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion gui/components/gui_chart.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gui/components/gui_combobox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
4 changes: 2 additions & 2 deletions gui/components/gui_container.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
37 changes: 26 additions & 11 deletions gui/components/gui_convoy_assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -617,16 +618,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<gui_margin_t>(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<gui_margin_t>(0, get_grid(wt).y+8);
}
end_table();

// convoy length
add_table(5,1);
Expand Down Expand Up @@ -702,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);
}
Expand Down Expand Up @@ -857,7 +864,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++) {
Expand Down Expand Up @@ -2265,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();
Expand Down
2 changes: 2 additions & 0 deletions gui/components/gui_convoy_assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<const vehicle_desc_t *> vehicles;

Expand Down
21 changes: 14 additions & 7 deletions gui/components/gui_scrolled_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ 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);

this->type = type;
compare = cmp;
size = scr_size(0,0);
pos = scr_coord(0,0);
multiple_selection = false;
multiple_selection_mode = 0;
maximize = false;
}

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -232,8 +233,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;
}

Expand All @@ -247,7 +250,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<scrollitem_t*>(v);
Expand All @@ -256,9 +259,13 @@ 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;
if (!get_selections().get_count()) {
container.set_focus(NULL);
}
}
else if( IS_SHIFT_PRESSED(&ev) ) {
// shift key is pressed.
Expand Down
6 changes: 4 additions & 2 deletions gui/components/gui_scrolled_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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. */
Expand Down
45 changes: 0 additions & 45 deletions gui/components/gui_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
}
20 changes: 0 additions & 20 deletions gui/components/gui_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion gui/components/gui_vehicle_cargoinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void gui_vehicle_cargo_info_t::update()
if (!total_cargo) {
// no cargo => empty
new_component<gui_label_t>("leer", SYSCOL_TEXT_WEAK, gui_label_t::left);
new_component<gui_empty_t>();
new_component<gui_fill_t>();
}
else {
add_table(2,0)->set_spacing(scr_size(0,1));
Expand Down Expand Up @@ -788,6 +788,7 @@ void gui_cargo_info_t::init(uint8 info_depth_from, uint8 info_depth_to, bool div
else {
new_component<gui_margin_t>(LINEASCENT);
new_component<gui_label_t>("leer", SYSCOL_TEXT_WEAK);
new_component<gui_fill_t>();
}
set_size(get_min_size());
}
Expand Down
Loading
Loading