diff --git a/Nettool.vcxproj b/Nettool.vcxproj deleted file mode 100644 index 2b8780cd4..000000000 --- a/Nettool.vcxproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {F6C54DC9-69F2-4897-87E9-2A4A9FB9F643} - Simutrans - - - - Application - v110 - Unicode - true - - - Application - v110 - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>11.0.50727.1 - - - $(SolutionDir)$(Configuration)-nettool\ - $(Configuration)-nettool\ - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - - - - Disabled - NOMINMAX;ZLIB_WINAPI;LITTLE_ENDIAN;DEBUG=3;NETTOOL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level3 - ProgramDatabase - 4200;4800;4311;4996;4396;%(DisableSpecificWarnings) - - - kernel32.lib;user32.lib;gdi32.lib;winmm.lib;Ws2_32.lib;advapi32.lib;wsock32.lib - true - false - - MachineX86 - - - - - NOMINMAX;ZLIB_WINAPI;LITTLE_ENDIAN;DEBUG=3;NETTOOL;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - 4200;4800;4311;4996;%(DisableSpecificWarnings) - - - kernel32.lib;user32.lib;gdi32.lib;winmm.lib;advapi32.lib;wsock32.lib - true - true - false - - MachineX86 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Nettool.vcxproj.filters b/Nettool.vcxproj.filters deleted file mode 100644 index acdde84dd..000000000 --- a/Nettool.vcxproj.filters +++ /dev/null @@ -1,117 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/dataobj/translator.cc b/dataobj/translator.cc index 76ebfa7c3..8a6b7ac91 100644 --- a/dataobj/translator.cc +++ b/dataobj/translator.cc @@ -596,6 +596,101 @@ const char *translator::get_month_name(uint16 month) return translate(month_names[month % lengthof(month_names)]); } +const char *translator::get_short_month_name(uint16 month) +{ + static const char *const short_month_names[] = { + "Jan.", + "Feb.", + "Mar.", + "Apr.", + "May", + "June", + "July", + "Aug.", + "Sept.", + "Oct.", + "Nov.", + "Dec." + }; + return translate(short_month_names[month % lengthof(short_month_names)]); +} + +const char *translator::get_date(uint16 year, uint16 month) +{ + char const* const month_ = get_month_name(month); + char const* const year_sym = strcmp("YEAR_SYMBOL", translate("YEAR_SYMBOL")) ? translate("YEAR_SYMBOL") : ""; + static char sdate[256]; + switch (env_t::show_month) { + case env_t::DATE_FMT_JAPANESE: + case env_t::DATE_FMT_JAPANESE_NO_SEASON: + sprintf(sdate, "%4d%s %s", year, year_sym, month_); + break; + case env_t::DATE_FMT_GERMAN: + case env_t::DATE_FMT_GERMAN_NO_SEASON: + case env_t::DATE_FMT_US: + case env_t::DATE_FMT_US_NO_SEASON: + default: + sprintf(sdate, "%s %4d%s", month_, year, year_sym); + break; + } + return sdate; +} + +const char *translator::get_date(uint16 year, uint16 month, uint16 day, char const* season) +{ + char const* const month_ = get_month_name(month); + char const* const year_sym = strcmp("YEAR_SYMBOL", translate("YEAR_SYMBOL")) ? translate("YEAR_SYMBOL") : ""; + char const* const day_sym = strcmp("DAY_SYMBOL", translate("DAY_SYMBOL")) ? translate("DAY_SYMBOL") : ""; + static char date[256]; + switch(env_t::show_month) { + case env_t::DATE_FMT_GERMAN: + sprintf(date, "%s %d. %s %d%s", season, day, month_, year, year_sym); + break; + case env_t::DATE_FMT_GERMAN_NO_SEASON: + sprintf(date, "%d. %s %d%s", day, month_, year, year_sym); + break; + case env_t::DATE_FMT_US: + sprintf(date, "%s %s %d %d%s", season, month_, day, year, year_sym); + break; + case env_t::DATE_FMT_US_NO_SEASON: + sprintf(date, "%s %d %d%s", month_, day, year, year_sym); + break; + case env_t::DATE_FMT_JAPANESE: + sprintf(date, "%s %d%s %s %d%s", season, year, year_sym, month_, day, day_sym); + break; + case env_t::DATE_FMT_JAPANESE_NO_SEASON: + sprintf(date, "%d%s %s %d%s", year, year_sym, month_, day, day_sym); + break; + case env_t::DATE_FMT_MONTH: + sprintf(date, "%s, %s %d%s", month_, season, year, year_sym); + break; + case env_t::DATE_FMT_SEASON: + sprintf(date, "%s %d%s", season, year, year_sym); + break; + } + return date; +} + +const char *translator::get_short_date(uint16 year, uint16 month) +{ + char const* const month_ = get_short_month_name(month); + char const* const year_sym = strcmp("YEAR_SYMBOL", translate("YEAR_SYMBOL")) ? translate("YEAR_SYMBOL") : ""; + static char sdate[256]; + switch (env_t::show_month) { + case env_t::DATE_FMT_JAPANESE: + case env_t::DATE_FMT_JAPANESE_NO_SEASON: + sprintf(sdate, "%4d%s %s", year, year_sym , month_); + break; + case env_t::DATE_FMT_GERMAN: + case env_t::DATE_FMT_GERMAN_NO_SEASON: + case env_t::DATE_FMT_US: + case env_t::DATE_FMT_US_NO_SEASON: + default: + sprintf(sdate, "%s %4d%s", month_, year, year_sym); + break; + } + return sdate; +} /* get a name for a non-matching object */ const char *translator::compatibility_name(const char *str) diff --git a/dataobj/translator.h b/dataobj/translator.h index ee90f5b65..590516964 100644 --- a/dataobj/translator.h +++ b/dataobj/translator.h @@ -123,6 +123,12 @@ public: // return the name of the month static const char *get_month_name(uint16 month); + // return the short name of the month + static const char *get_short_month_name(uint16 month); + // return date in selected format + static const char *get_date(uint16 year, uint16 month); + static const char *get_date(uint16 year, uint16 month, uint16 day, char const* season); + static const char *get_short_date(uint16 year, uint16 month); }; #endif diff --git a/dataobj/translator.h.gch b/dataobj/translator.h.gch new file mode 100644 index 000000000..0bb807867 Binary files /dev/null and b/dataobj/translator.h.gch differ diff --git a/gui/convoi_detail_t.cc b/gui/convoi_detail_t.cc index 06cd8baa6..fb6ceb58e 100644 --- a/gui/convoi_detail_t.cc +++ b/gui/convoi_detail_t.cc @@ -262,7 +262,7 @@ void gui_vehicleinfo_t::draw(scr_coord offset) buf.clear(); { const sint32 month = v->get_purchase_time(); - buf.printf( "%s %s %i", translator::translate("Manufactured:"), translator::get_month_name(month%12), month/12 ); + buf.printf( "%s %s", translator::translate("Manufactured:"), translator::get_date(month/12, month%12)); } display_proportional_clip_rgb( pos.x+w+offset.x, pos.y+offset.y+total_height+extra_y, buf, ALIGN_LEFT, SYSCOL_TEXT, true ); extra_y += LINESPACE; diff --git a/gui/depot_frame.cc b/gui/depot_frame.cc index 1e3b0ad87..a0b2597f3 100644 --- a/gui/depot_frame.cc +++ b/gui/depot_frame.cc @@ -83,8 +83,6 @@ depot_frame_t::depot_frame_t(depot_t* depot) : depot(depot), icnv(depot->convoi_count()-1), lb_convoi_line("Serves Line:", SYSCOL_TEXT, gui_label_t::left), - lb_sort_by("Sort by:", SYSCOL_TEXT, gui_label_t::right), - lb_name_filter_input("Search:", SYSCOL_TEXT, gui_label_t::right), lb_veh_action("Fahrzeuge:", SYSCOL_TEXT, gui_label_t::right), convoi_pics(depot->get_max_convoi_length()), convoi(&convoi_pics), @@ -97,6 +95,8 @@ depot_frame_t::depot_frame_t(depot_t* depot) : scrolly_electrics(&cont_electrics), scrolly_loks(&cont_loks), scrolly_waggons(&cont_waggons), + lb_sort_by("Sort by:", SYSCOL_TEXT, gui_label_t::right), + lb_name_filter("Search:", SYSCOL_TEXT, gui_label_t::right), lb_vehicle_filter("Filter:", SYSCOL_TEXT, gui_label_t::right) { scr_size size = scr_size(0,0); @@ -220,8 +220,9 @@ DBG_DEBUG("depot_frame_t::depot_frame_t()","get_max_convoi_length()=%i",depot->g add_component(&div_tabbottom); add_component(&lb_veh_action); add_component(&lb_sort_by); + add_component(&lb_name_filter); add_component(&lb_vehicle_filter); - add_component(&lb_name_filter_input); + add_component(&div_action_bottom); veh_action = va_append; bt_veh_action.set_typ(button_t::roundbox); @@ -260,11 +261,8 @@ DBG_DEBUG("depot_frame_t::depot_frame_t()","get_max_convoi_length()=%i",depot->g build_vehicle_lists(); // text will be translated by ourselves (after update data)! - lb_convois.set_text_pointer(txt_convois); - - lb_convoi_count.set_text_pointer(txt_convoi_count); - lb_convoi_number.set_text_pointer(txt_convoi_number); - + lb_convois.set_text_pointer( txt_convois ); + lb_convoi_number.set_text_pointer( txt_convoi_number ); lb_convoi_count.set_text_pointer( txt_convoi_count ); lb_convoi_speed.set_text_pointer( txt_convoi_speed ); lb_convoi_cost.set_text_pointer( txt_convoi_cost ); @@ -587,34 +585,37 @@ void depot_frame_t::layout(scr_size *size) /* * [BOTTOM] */ + + //1st line bt_veh_action.set_pos(scr_coord(D_MARGIN_LEFT + (BUTTON_WIDTH_DEPOT+D_H_SPACE)*3, INFO_VSTART)); bt_veh_action.set_size(scr_size(BUTTON_WIDTH_DEPOT, D_BUTTON_HEIGHT)); - lb_veh_action.align_to(&bt_veh_action, ALIGN_RIGHT | ALIGN_EXTERIOR_H | ALIGN_CENTER_V, scr_coord(D_H_SPACE, 0)); - vehicle_filter.set_pos(scr_coord(D_MARGIN_LEFT + (BUTTON_WIDTH_DEPOT+D_H_SPACE)*3, INFO_VSTART + D_BUTTON_HEIGHT + D_V_SPACE)); + //2nd line + vehicle_filter.set_pos(scr_coord(D_MARGIN_LEFT + (BUTTON_WIDTH_DEPOT+D_H_SPACE)*2 - proportional_string_width(translator::translate("Search:")), INFO_VSTART + D_BUTTON_HEIGHT + D_V_SPACE)); vehicle_filter.set_size(scr_size(BUTTON_WIDTH_DEPOT, D_BUTTON_HEIGHT)); vehicle_filter.set_max_size(scr_size(D_BUTTON_WIDTH, LINESPACE*7)); + lb_vehicle_filter.align_to(&vehicle_filter, ALIGN_RIGHT | ALIGN_EXTERIOR_H | ALIGN_TOP, scr_coord(2,D_GET_CENTER_ALIGN_OFFSET(LINESPACE,D_BUTTON_HEIGHT))); - lb_vehicle_filter.align_to(&vehicle_filter, ALIGN_RIGHT | ALIGN_EXTERIOR_H | ALIGN_TOP, scr_coord(D_H_SPACE,D_GET_CENTER_ALIGN_OFFSET(LINESPACE,D_BUTTON_HEIGHT))); - - bt_show_all.set_pos(scr_coord(D_MARGIN_LEFT, INFO_VSTART + D_BUTTON_HEIGHT + D_V_SPACE)); - bt_show_all.align_to(&vehicle_filter, ALIGN_CENTER_V); - + name_filter_input.set_pos(scr_coord(D_MARGIN_LEFT + (BUTTON_WIDTH_DEPOT+D_H_SPACE)*3, INFO_VSTART + D_BUTTON_HEIGHT + D_V_SPACE)); name_filter_input.set_size( scr_size( BUTTON_WIDTH_DEPOT, D_EDIT_HEIGHT ) ); - name_filter_input.set_pos( vehicle_filter.get_pos()+scr_coord(0,D_V_SPACE+D_BUTTON_HEIGHT) ); - lb_name_filter_input.align_to(&name_filter_input, ALIGN_RIGHT | ALIGN_EXTERIOR_H | ALIGN_TOP, scr_coord(D_H_SPACE,D_GET_CENTER_ALIGN_OFFSET(LINESPACE,D_BUTTON_HEIGHT))); + lb_name_filter.align_to(&name_filter_input, ALIGN_RIGHT | ALIGN_EXTERIOR_H | ALIGN_TOP, scr_coord(D_H_SPACE,D_GET_CENTER_ALIGN_OFFSET(LINESPACE,D_BUTTON_HEIGHT))); bt_obsolete.set_pos(scr_coord(D_MARGIN_LEFT, INFO_VSTART + (D_BUTTON_HEIGHT + D_V_SPACE)*2)); bt_obsolete.align_to(&name_filter_input, ALIGN_CENTER_V); - int y = name_filter_input.get_pos().y + name_filter_input.get_size().h + D_V_SPACE; - - sort_by.set_pos(scr_coord(D_MARGIN_LEFT + (BUTTON_WIDTH_DEPOT+D_H_SPACE)*3, y)); + //3rd line + sort_by.set_pos(scr_coord(D_MARGIN_LEFT + (BUTTON_WIDTH_DEPOT+D_H_SPACE)*3, INFO_VSTART + (D_BUTTON_HEIGHT + D_V_SPACE)*2)); sort_by.set_size(scr_size(BUTTON_WIDTH_DEPOT, D_BUTTON_HEIGHT)); sort_by.set_max_size(scr_size(D_BUTTON_WIDTH, LINESPACE * 7)); lb_sort_by.align_to(&sort_by, ALIGN_RIGHT | ALIGN_EXTERIOR_H | ALIGN_TOP, scr_coord(D_H_SPACE,D_GET_CENTER_ALIGN_OFFSET(LINESPACE,D_BUTTON_HEIGHT))); + bt_show_all.set_pos(scr_coord(D_MARGIN_LEFT, INFO_VSTART + (D_BUTTON_HEIGHT + D_V_SPACE)*2)); + bt_show_all.align_to(&sort_by, ALIGN_CENTER_V); + + div_action_bottom.set_pos(scr_coord(0, INFO_VSTART + (D_BUTTON_HEIGHT + D_V_SPACE) * 3)); + div_action_bottom.set_width(win_size.w); + const scr_coord_val margin = 4; img_bolt.set_pos(scr_coord(get_windowsize().w - skinverwaltung_t::electricity->get_image(0)->get_pic()->w - margin, margin)); @@ -725,10 +726,7 @@ static int compare_engine(const vehicle_desc_t* a, const vehicle_desc_t* b) } static int compare_price(const vehicle_desc_t* a, const vehicle_desc_t* b) {return a->get_price() - b->get_price();} static int compare_cost(const vehicle_desc_t* a, const vehicle_desc_t* b) {return a->get_running_cost() - b->get_running_cost();} -static int compare_cost_per_unit(const vehicle_desc_t* a, const vehicle_desc_t* b) -{ - return a->get_running_cost()*b->get_capacity() - b->get_running_cost()*a->get_capacity(); -} +static int compare_cost_per_unit(const vehicle_desc_t* a, const vehicle_desc_t* b){return a->get_running_cost()*b->get_capacity() - b->get_running_cost()*a->get_capacity();} static int compare_topspeed(const vehicle_desc_t* a, const vehicle_desc_t* b) {return a->get_topspeed() - b->get_topspeed();} static int compare_power(const vehicle_desc_t* a, const vehicle_desc_t* b) {return (a->get_power() == 0 ? 0x7FFFFFF : a->get_power()) - (b->get_power() == 0 ? 0x7FFFFFF : b->get_power());} static int compare_weight(const vehicle_desc_t* a, const vehicle_desc_t* b) {return a->get_weight() - b->get_weight();} @@ -747,6 +745,9 @@ static bool compare_vehicles(const vehicle_desc_t* a, const vehicle_desc_t* b) case sb_price: cmp = compare_price(a, b); if (cmp != 0) return cmp < 0; + cmp = compare_cost(a, b); + if (cmp != 0) return cmp < 0; + break; case sb_cost: cmp = compare_cost(a, b); if (cmp != 0) return cmp < 0; @@ -772,6 +773,9 @@ static bool compare_vehicles(const vehicle_desc_t* a, const vehicle_desc_t* b) case sb_intro_date: cmp = compare_intro_year_month(a, b); if (cmp != 0) return cmp < 0; + cmp = compare_retire_year_month(a, b); + if (cmp != 0) return cmp < 0; + break; case sb_retire_date: cmp = compare_retire_year_month(a, b); if (cmp != 0) return cmp < 0; @@ -877,12 +881,12 @@ void depot_frame_t::build_vehicle_lists() } } } + DBG_DEBUG("depot_frame_t::build_vehicle_lists()","finally %i passenger vehicle, %i engines, %i good wagons",pas_vec.get_count(),loks_vec.get_count(),waggons_vec.get_count()); update_data(); update_tabs(); } - static void get_line_list(const depot_t* depot, vector_tpl* lines) { depot->get_owner()->simlinemgmt.get_lines(depot->get_line_type(), lines); @@ -1787,44 +1791,30 @@ void depot_frame_t::draw_vehicle_info_text(scr_coord pos) buf.append( "\n" ); } + buf.printf( "%s %3d km/h\n", translator::translate("Max. speed:"), veh_type->get_topspeed() ); + if( veh_type->get_power() > 0 ) { // LOCO - buf.printf( translator::translate("Power: %4d kW\n"), veh_type->get_power() ); - } - else { - buf.append( "\n" ); + if( veh_type->get_gear() != 64 ){ + buf.printf( "%s %4d kW (x%0.2f)\n", translator::translate("Power:"), veh_type->get_power(), veh_type->get_gear() / 64.0 ); + } + else { + buf.printf( translator::translate("Power: %4d kW\n"), veh_type->get_power() ); + } } - buf.printf( "%s %4.1ft\n", translator::translate("Weight:"), veh_type->get_weight() / 1000.0 ); - buf.printf( "%s %3d km/h", translator::translate("Max. speed:"), veh_type->get_topspeed() ); - - int yyy = pos.y + D_TITLEBAR_HEIGHT + sort_by.get_pos().y + sort_by.get_size().h - - LINESPACE; + int yyy = pos.y + D_TITLEBAR_HEIGHT + div_action_bottom.get_pos().y + div_action_bottom.get_size().h + 2; display_multiline_text_rgb( pos.x + D_MARGIN_LEFT, yyy, buf, SYSCOL_TEXT); // column 2 buf.clear(); - buf.printf( "%s %s %04d\n", - translator::translate("Intro. date:"), - translator::get_month_name( veh_type->get_intro_year_month() % 12 ), - veh_type->get_intro_year_month() / 12 - ); + buf.printf( "%s %4.1ft\n", translator::translate("Weight:"), veh_type->get_weight() / 1000.0 ); + buf.printf( "%s %s - ", translator::translate("Available:"), translator::get_short_date(veh_type->get_intro_year_month() / 12, veh_type->get_intro_year_month() % 12) ); if( veh_type->get_retire_year_month() != DEFAULT_RETIRE_DATE * 12 ) { - buf.printf( "%s %s %04d\n", - translator::translate("Retire. date:"), - translator::get_month_name( veh_type->get_retire_year_month() % 12 ), - veh_type->get_retire_year_month() / 12 - ); + buf.printf( "%s\n", translator::get_short_date(veh_type->get_retire_year_month() / 12, veh_type->get_retire_year_month() % 12) ); } else { - buf.append( "\n" ); - } - - if( veh_type->get_power() > 0 && veh_type->get_gear() != 64 ) { - buf.printf( "%s %0.2f : 1\n", translator::translate("Gear:"), veh_type->get_gear() / 64.0 ); - } - else { - buf.append( "\n" ); + buf.append( "*\n" ); } if( char const* const copyright = veh_type->get_copyright() ) { diff --git a/gui/depot_frame.h b/gui/depot_frame.h index 8160fafdf..522a1bc73 100644 --- a/gui/depot_frame.h +++ b/gui/depot_frame.h @@ -119,12 +119,13 @@ private: gui_label_t lb_sort_by; gui_combobox_t sort_by; - gui_label_t lb_name_filter_input; + gui_label_t lb_name_filter; static char name_filter_value[64]; gui_textinput_t name_filter_input; gui_tab_panel_t tabs; gui_divider_t div_tabbottom; + gui_divider_t div_action_bottom; gui_label_t lb_veh_action; button_t bt_veh_action; diff --git a/gui/depot_frame.h.gch b/gui/depot_frame.h.gch new file mode 100644 index 000000000..93dc2be95 Binary files /dev/null and b/gui/depot_frame.h.gch differ diff --git a/gui/server_frame.cc b/gui/server_frame.cc index eb047c8db..6b4cdffc1 100644 --- a/gui/server_frame.cc +++ b/gui/server_frame.cc @@ -262,22 +262,7 @@ void server_frame_t::update_info() #endif time.clear(); - char const* const month = translator::get_month_name(gi.get_current_month()); - switch (env_t::show_month) { - case env_t::DATE_FMT_GERMAN: - case env_t::DATE_FMT_MONTH: - case env_t::DATE_FMT_SEASON: - case env_t::DATE_FMT_GERMAN_NO_SEASON: - time.printf( "%s %d", month, gi.get_current_year() ); - break; - - case env_t::DATE_FMT_US: - case env_t::DATE_FMT_JAPANESE: - case env_t::DATE_FMT_JAPANESE_NO_SEASON: - case env_t::DATE_FMT_US_NO_SEASON: - time.printf( "%i/%s", gi.get_current_year(), month ); - break; - } + time.printf("%s", translator::get_date(gi.get_current_year(), gi.get_current_month())); date.set_text( time ); date.set_pos( scr_coord( get_windowsize().w - D_MARGIN_RIGHT - date.get_size().w, date.get_pos().y ) ); set_dirty(); diff --git a/simdepot.h.gch b/simdepot.h.gch new file mode 100644 index 000000000..8cd06cb3d Binary files /dev/null and b/simdepot.h.gch differ diff --git a/simintr.cc b/simintr.cc index 77b30657c..03abfb9ad 100644 --- a/simintr.cc +++ b/simintr.cc @@ -195,45 +195,20 @@ char const *tick_to_string( sint32 ticks, bool show_full ) // @author hsiegeln - updated to show month // @author prissi - also show date if desired // since seasons 0 is always summer for backward compatibility - char const* const season = translator::translate(seasons[welt_modell->get_season()]); - char const* const month_ = translator::get_month_name(month % 12); - switch(env_t::show_month) { - case env_t::DATE_FMT_GERMAN_NO_SEASON: - sprintf(time, "%d. %s %d %2d:%02dh", tage, month_, year, hours, minuten); - break; - + char const* const date = translator::get_date(year, month, tage, translator::translate(seasons[welt_modell->get_season()])); + switch (env_t::show_month) { + case env_t::DATE_FMT_US: case env_t::DATE_FMT_US_NO_SEASON: { uint32 hours_ = hours % 12; if (hours_ == 0) hours_ = 12; - sprintf(time, "%s %d %d %2d:%02d%s", month_, tage, year, hours_, minuten, hours < 12 ? "am" : "pm"); - break; - } - - case env_t::DATE_FMT_JAPANESE_NO_SEASON: - sprintf(time, "%d/%s/%d %2d:%02dh", year, month_, tage, hours, minuten); - break; - - case env_t::DATE_FMT_GERMAN: - sprintf(time, "%s, %d. %s %d %2d:%02dh", season, tage, month_, year, hours, minuten); - break; - - case env_t::DATE_FMT_US: { - uint32 hours_ = hours % 12; - if (hours_ == 0) hours_ = 12; - sprintf(time, "%s, %s %d %d %2d:%02d%s", season, month_, tage, year, hours_, minuten, hours < 12 ? "am" : "pm"); + sprintf(time, "%s %2d:%02d%s", date, hours_, minuten, hours < 12 ? "am" : "pm"); break; } - - case env_t::DATE_FMT_JAPANESE: - sprintf(time, "%s, %d/%s/%d %2d:%02dh", season, year, month_, tage, hours, minuten); - break; - - case env_t::DATE_FMT_MONTH: - sprintf(time, "%s, %s %d %2d:%02dh", month_, season, year, hours, minuten); - break; - case env_t::DATE_FMT_SEASON: - sprintf(time, "%s %d", season, year); + sprintf(time, "%s", date); + break; + default: + sprintf(time, "%s %2d:%02dh", date, hours, minuten); break; } }