Index: simutrans/trunk/dataobj/fahrplan.cc =================================================================== --- simutrans/trunk/dataobj/fahrplan.cc (revision 2416) +++ simutrans/trunk/dataobj/fahrplan.cc (working copy) @@ -94,15 +94,17 @@ -bool schedule_t::insert(const grund_t* gr, uint8 ladegrad, uint8 waiting_time_shift ) +bool schedule_t::insert(const grund_t* gr, uint8 ladegrad, uint8 waiting_time_shift, uint8 waiting_station_time ) { #ifndef _MSC_VER - struct linieneintrag_t stop = { gr->get_pos(), ladegrad, waiting_time_shift }; + struct linieneintrag_t stop = { gr->get_pos(), ladegrad, waiting_time_shift, waiting_station_time }; #else struct linieneintrag_t stop; stop.pos = gr->get_pos(); stop.ladegrad = ladegrad; stop.waiting_time_shift = waiting_time_shift; + stop.waiting_station_time = waiting_station_time; + #endif // stored in minivec, so wie have to avoid adding too many if( eintrag.get_count()>=254 ) { @@ -124,15 +126,16 @@ -bool schedule_t::append(const grund_t* gr, uint8 ladegrad, uint8 waiting_time_shift) +bool schedule_t::append(const grund_t* gr, uint8 ladegrad, uint8 waiting_time_shift, uint8 waiting_station_time) { #ifndef _MSC_VER - struct linieneintrag_t stop = { gr->get_pos(), ladegrad, waiting_time_shift }; + struct linieneintrag_t stop = { gr->get_pos(), ladegrad, waiting_time_shift,waiting_station_time }; #else struct linieneintrag_t stop; stop.pos = gr->get_pos(); stop.ladegrad = ladegrad; stop.waiting_time_shift = waiting_time_shift; + stop.waiting_station_time = waiting_station_time; #endif // stored in minivec, so wie have to avoid adding too many @@ -258,6 +261,12 @@ if(file->get_version()>=99018) { file->rdwr_byte( eintrag[i].waiting_time_shift, "w" ); } + if(file->get_version()>=100003) { + file->rdwr_byte( eintrag[i].waiting_station_time, "w" ); + } + else { + eintrag[i] .waiting_station_time = 2; + } } } if(file->is_loading()) { Index: simutrans/trunk/dataobj/fahrplan.h =================================================================== --- simutrans/trunk/dataobj/fahrplan.h (revision 2416) +++ simutrans/trunk/dataobj/fahrplan.h (working copy) @@ -104,12 +104,12 @@ * fügt eine koordinate an stelle aktuell in den Fahrplan ein * alle folgenden Koordinaten verschieben sich dadurch */ - bool insert(const grund_t* gr, uint8 ladegrad = 0, uint8 waiting_time_shift = 0); + bool insert(const grund_t* gr, uint8 ladegrad = 0, uint8 waiting_time_shift = 0, uint8 waiting_station_time = 2); /** * hängt eine koordinate an den fahrplan an */ - bool append(const grund_t* gr, uint8 ladegrad = 0, uint8 waiting_time_shift = 0); + bool append(const grund_t* gr, uint8 ladegrad = 0, uint8 waiting_time_shift = 0, uint8 waiting_station_time = 2); // cleanup a schedule, removes double entries void cleanup(); @@ -252,4 +252,4 @@ }; -#endif +#endif \ No newline at end of file Index: simutrans/trunk/dataobj/linieneintrag.h =================================================================== --- simutrans/trunk/dataobj/linieneintrag.h (revision 2416) +++ simutrans/trunk/dataobj/linieneintrag.h (working copy) @@ -29,6 +29,12 @@ * @author prissi */ sint8 waiting_time_shift; + + /** + * waiting time in station in sec + * @author msp + */ + sint8 waiting_station_time; }; -#endif +#endif \ No newline at end of file Index: simutrans/trunk/gui/fahrplan_gui.cc =================================================================== --- simutrans/trunk/gui/fahrplan_gui.cc (revision 2416) +++ simutrans/trunk/gui/fahrplan_gui.cc (working copy) @@ -172,7 +172,9 @@ scrolly(&stats), fpl(fpl_), sp(sp_), - cnv(cnv_) + cnv(cnv_), + lb_stationwait("Station wait time"), + lb_stationwaitlevel(NULL, COL_WHITE, gui_label_t::right) { stats.set_fahrplan(fpl); if(!cnv.is_bound()) { @@ -213,6 +215,32 @@ ypos += BUTTON_HEIGHT+4; } + // msp + //lb_stationwait.set_pos( koord( 10, ypos+2 ) ); + //add_komponente(&lb_stationwait); + bt_stationwait_prev.set_pos (koord( BUTTON_WIDTH*2, ypos+1 )); + bt_stationwait_prev.set_typ(button_t::arrowleft); + bt_stationwait_prev.add_listener(this); + add_komponente(&bt_stationwait_prev); + + if(fpl->get_count()<=0 || fpl->get_aktuell() >= fpl->get_count() || fpl->eintrag[fpl->get_aktuell()].waiting_station_time < 2 ) { + strcpy( str_parts_station, translator::translate("2") ); + } + else { + sprintf( str_parts_station, "%d", fpl->eintrag[fpl->get_aktuell()].waiting_station_time ); + } + lb_stationwaitlevel.set_text_pointer( str_parts_station ); + lb_stationwaitlevel.set_pos ( koord( BUTTON_WIDTH*2+45, ypos+2 )); + add_komponente(&lb_stationwaitlevel); + + bt_stationwait_next.set_pos( koord( BUTTON_WIDTH*2+50, ypos+1 )); + bt_stationwait_next.set_typ(button_t::arrowright); + bt_stationwait_next.add_listener(this); + add_komponente(&bt_stationwait_next); + + + + // loading level and return tickets lb_load.set_pos( koord( 10, ypos+2 ) ); add_komponente(&lb_load); @@ -330,11 +358,19 @@ // update load lb_load.set_color( COL_GREY3 ); lb_wait.set_color( COL_GREY3 ); - if( fpl->get_count()>0 ) { + lb_stationwait.set_color( COL_GREY3 ); + + if( fpl->get_count() > 0 ) { fpl->set_aktuell( min(fpl->get_count()-1,fpl->get_aktuell()) ); const uint8 aktuell = fpl->get_aktuell(); if(haltestelle_t::get_halt(sp->get_welt(), fpl->eintrag[aktuell].pos).is_bound()) { lb_load.set_color( COL_BLACK ); + + // msp + lb_stationwait.set_color( COL_BLACK ); + sprintf( str_parts_station, "%d", fpl->eintrag[fpl->get_aktuell()].waiting_station_time ); + + numimp_load.set_value( fpl->eintrag[aktuell].ladegrad ); if( fpl->eintrag[aktuell].ladegrad>0 ) { lb_wait.set_color( COL_BLACK ); @@ -349,6 +385,7 @@ else { strcpy( str_ladegrad, "0%" ); strcpy( str_parts_month, translator::translate("off") ); + strcpy( str_parts_station, translator::translate("2") ); } } } @@ -470,7 +507,36 @@ } update_selection(); } - } else if (komp == &bt_return) { + } + + // station wait time + else if(komp == &bt_stationwait_prev) { + if(fpl->get_count() > 0) { + sint8& wait = fpl->eintrag[fpl->get_aktuell()].waiting_station_time; + if(wait<=2) { + wait = 2; + } + else { + wait--; + } + update_selection(); + } + } else if(komp == &bt_stationwait_next) { + if(fpl->get_count() > 0) { + sint8& wait = fpl->eintrag[fpl->get_aktuell()].waiting_station_time; + if(wait<2) { + wait = 2; + } + else if(wait<64) { + wait ++; + } + update_selection(); + } + } + + + + else if (komp == &bt_return) { fpl->add_return_way(); } else if (komp == &line_selector) { int selection = p.i; @@ -491,6 +557,7 @@ fpl->eingabe_beginnen(); init_line_selector(); } + // recheck lines if (cnv.is_bound()) { // unequal to line => remove from line ... Index: simutrans/trunk/gui/fahrplan_gui.h =================================================================== --- simutrans/trunk/gui/fahrplan_gui.h (revision 2416) +++ simutrans/trunk/gui/fahrplan_gui.h (working copy) @@ -97,11 +97,19 @@ button_t bt_wait_prev, bt_wait_next; // waiting in parts of month gui_label_t lb_wait, lb_waitlevel; + // msp + gui_label_t lb_stationwait, lb_stationwaitlevel; // msp buttons fuer minload + button_t bt_stationwait_prev,bt_stationwait_next; + char str_parts_station[32]; + + + gui_label_t lb_load; gui_numberinput_t numimp_load; char str_ladegrad[16]; char str_parts_month[32]; + fahrplan_gui_stats_t stats; gui_scrollpane_t scrolly; @@ -165,4 +173,4 @@ bool action_triggered( gui_action_creator_t *komp, value_t extra); }; -#endif +#endif \ No newline at end of file Index: simutrans/trunk/simconvoi.cc =================================================================== --- simutrans/trunk/simconvoi.cc (revision 2416) +++ simutrans/trunk/simconvoi.cc (working copy) @@ -2091,6 +2091,8 @@ if(state == FAHRPLANEINGABE) { return; } + + sint32 t_wait_lock = WTT_LOADING; halthandle_t halt = haltestelle_t::get_halt(welt, fpl->get_current_eintrag().pos); // eigene haltestelle ? @@ -2125,13 +2127,15 @@ for (unsigned i = 0; iget_fracht_max()-get_vehikel(i)->get_fracht_menge(), CONVOI_CAPACITY); } + + t_wait_lock = ( fpl->eintrag[fpl->get_aktuell()].waiting_station_time * 1000 ); // Advance schedule fpl->advance(); state = ROUTING_1; } // This is the minimum time it takes for loading - wait_lock = WTT_LOADING; + wait_lock = t_wait_lock; } Index: simutrans/trunk/simversion.h =================================================================== --- simutrans/trunk/simversion.h (revision 2416) +++ simutrans/trunk/simversion.h (working copy) @@ -3,17 +3,17 @@ #define MAKEOBJ_VERSION "50" -#define VERSION_NUMBER "102.1 Nightly" -#define WIDE_VERSION_NUMBER L"102.1 Nightly" +#define VERSION_NUMBER "103.1 Nightly" +#define WIDE_VERSION_NUMBER L"103.1 Nightly" #define VERSION_DATE __DATE__ #define SAVEGAME_PREFIX "Simutrans " #define XML_SAVEGAME_PREFIX "" -#define SAVEGAME_VER_NR "0.102.1" +#define SAVEGAME_VER_NR "0.103.1" #define SAVEGAME_VERSION (SAVEGAME_PREFIX SAVEGAME_VER_NR) -#define RES_VERSION_NUMBER 0, 102, 0, 0 +#define RES_VERSION_NUMBER 0, 103, 0, 0 -#endif +#endif \ No newline at end of file