Index: dataobj/umgebung.cc =================================================================== --- dataobj/umgebung.cc (リビジョン 3418) +++ dataobj/umgebung.cc (作業コピー) @@ -40,6 +40,8 @@ uint8 umgebung_t::hide_buildings; bool umgebung_t::use_transparency_station_coverage; uint8 umgebung_t::station_coverage_show; +bool umgebung_t::show_station_tile; +bool umgebung_t::show_hover_station_name; sint32 umgebung_t::show_names; sint32 umgebung_t::message_flags[4]; bool umgebung_t::no_tree; @@ -94,6 +96,8 @@ /* station stuff */ use_transparency_station_coverage = true; station_coverage_show = NOT_SHOWN_COVERAGE; + show_station_tile = false; + show_hover_station_name = false; show_names = 3; Index: dataobj/umgebung.h =================================================================== --- dataobj/umgebung.h (リビジョン 3418) +++ dataobj/umgebung.h (作業コピー) @@ -62,6 +62,8 @@ */ static bool use_transparency_station_coverage; static uint8 station_coverage_show; + static bool show_station_tile; + static bool show_hover_station_name; enum { NOT_SHOWN_COVERAGE=0, SHOW_MY_COVERAGE, SHOW_ALL_COVERAGE }; // use transparency to hide buildings and trees Index: gui/colors.cc =================================================================== --- gui/colors.cc (リビジョン 3418) +++ gui/colors.cc (作業コピー) @@ -41,8 +41,8 @@ #define SEPERATE2 (HIDE_CITY_HOUSES+13) #define USE_TRANSPARENCY_STATIONS (SEPERATE2+4) -#define SHOW_STATION_COVERAGE (USE_TRANSPARENCY_STATIONS+13) -#define SHOW_STATION_SIGNS (SHOW_STATION_COVERAGE+13) +#define SHOW_STATION_TILE (USE_TRANSPARENCY_STATIONS+13) +#define SHOW_STATION_SIGNS (SHOW_STATION_TILE+13) #define SHOW_STATION_GOODS (SHOW_STATION_SIGNS+13) #define SEPERATE3 (SHOW_STATION_GOODS+13) @@ -137,10 +137,6 @@ buttons[14].set_text("transparent station coverage"); buttons[14].pressed = umgebung_t::use_transparency_station_coverage; - buttons[15].set_pos( koord(10,SHOW_STATION_COVERAGE) ); - buttons[15].set_typ(button_t::square_state); - buttons[15].set_text("show station coverage"); - buttons[16].set_pos( koord(10,UNDERGROUND) ); buttons[16].set_typ(button_t::square_state); buttons[16].set_text("underground mode"); @@ -176,6 +172,11 @@ buttons[1].set_pos( koord(RIGHT_WIDTH-10-10,CONVOI_TOOLTIPS) ); buttons[1].set_typ(button_t::arrowright); + // left right for show station coverage + buttons[2].set_pos( koord(10,SHOW_STATION_TILE) ); + buttons[2].set_typ(button_t::arrowleft); + buttons[3].set_pos( koord(RIGHT_WIDTH-10-10,SHOW_STATION_TILE) ); + buttons[3].set_typ(button_t::arrowright); for(int i=0; iget_einstellungen()->get_show_pax(); buttons[8].pressed = welt->get_einstellungen()->get_random_pedestrians(); buttons[11].pressed = umgebung_t::hide_trees; - buttons[15].pressed = umgebung_t::station_coverage_show; buttons[16].pressed = grund_t::underground_mode == grund_t::ugm_all; buttons[17].pressed = grund_t::show_grid; buttons[18].pressed = umgebung_t::show_names&1; @@ -304,6 +310,9 @@ const char *hhc = translator::translate( umgebung_t::hide_buildings==0 ? "no buildings hidden" : (umgebung_t::hide_buildings==1 ? "hide city building" : "hide all building") ); display_proportional_clip(x+10+16, y+HIDE_CITY_HOUSES+1, hhc, ALIGN_LEFT, COL_BLACK, true); + const char *ssc = translator::translate( umgebung_t::station_coverage_show==0 ? "hide station coverage" : (umgebung_t::show_station_tile==1 ? "show only station tile" : "show station coverage") ); + display_proportional_clip(x+10+16, y+SHOW_STATION_TILE+1, ssc, ALIGN_LEFT, COL_BLACK, true); + const char *ctc = translator::translate( umgebung_t::show_vehicle_states==0 ? "convoi error tooltips" : (umgebung_t::show_vehicle_states==1 ? "convoi mouseover tooltips" : "all convoi tooltips") ); display_proportional_clip(x+10+16, y+CONVOI_TOOLTIPS+1, ctc, ALIGN_LEFT, COL_BLACK, true); Index: simplan.cc =================================================================== --- simplan.cc (リビジョン 3418) +++ simplan.cc (作業コピー) @@ -419,33 +419,41 @@ // display station owner boxes if(umgebung_t::station_coverage_show && halt_list_count>0) { + // only transparent outline + image_id img = gr->get_bild(); + if(img==IMG_LEER) { + // default image (since i.e. foundations do not have an image) + img = grund_besch_t::get_ground_tile( gr->get_disp_slope(), gr->get_disp_height() ); + } if(umgebung_t::use_transparency_station_coverage) { - - // only transparent outline - image_id img = gr->get_bild(); - if(img==IMG_LEER) { - // default image (since i.e. foundations do not have an image) - img = grund_besch_t::get_ground_tile( gr->get_disp_slope(), gr->get_disp_height() ); - } - - for(int halt_count = 0; halt_count < halt_list_count; halt_count++) { - const PLAYER_COLOR_VAL transparent = PLAYER_FLAG | OUTLINE_FLAG | (halt_list[halt_count]->get_besitzer()->get_player_color1() + 4); - display_img_blend( img, xpos, ypos, transparent | TRANSPARENT25_FLAG, 0, 0); - } + if(!umgebung_t::show_station_tile) { + for(int halt_count = 0; halt_count < halt_list_count; halt_count++) { + const PLAYER_COLOR_VAL transparent = PLAYER_FLAG | OUTLINE_FLAG | (halt_list[halt_count]->get_besitzer()->get_player_color1() + 4); + display_img_blend( img, xpos, ypos, transparent | TRANSPARENT25_FLAG, 0, 0); + } /* // unfourtunately, too expensive for display - // plot player outline colours - we always plot in order of players so that the order of the stations in halt_list - // doesn't affect the colour displayed [since blend(col1,blend(col2,screen)) != blend(col2,blend(col1,screen))] - for(int spieler_count = 0; spieler_countget_welt()->get_spieler(spieler_count); - const PLAYER_COLOR_VAL transparent = PLAYER_FLAG | OUTLINE_FLAG | (display_player->get_player_color1() * 4 + 4); - for(int halt_count = 0; halt_count < halt_list_count; halt_count++) { - if(halt_list[halt_count]->get_besitzer() == display_player) { - display_img_blend( img, xpos, ypos, transparent | TRANSPARENT25_FLAG, 0, 0); + // plot player outline colours - we always plot in order of players so that the order of the stations in halt_list + // doesn't affect the colour displayed [since blend(col1,blend(col2,screen)) != blend(col2,blend(col1,screen))] + for(int spieler_count = 0; spieler_countget_welt()->get_spieler(spieler_count); + const PLAYER_COLOR_VAL transparent = PLAYER_FLAG | OUTLINE_FLAG | (display_player->get_player_color1() * 4 + 4); + for(int halt_count = 0; halt_count < halt_list_count; halt_count++) { + if(halt_list[halt_count]->get_besitzer() == display_player) { + display_img_blend( img, xpos, ypos, transparent | TRANSPARENT25_FLAG, 0, 0); + } } } + */ } - */ + else { + // show halt tile too + halthandle_t halt = get_halt(); + if(halt.is_bound()) { + const PLAYER_COLOR_VAL transparent = PLAYER_FLAG | OUTLINE_FLAG | (halt->get_besitzer()->get_player_color1() + 4); + display_img_blend( img, xpos, ypos, transparent | TRANSPARENT50_FLAG, 0, 0); + } + } } else { const sint16 raster_tile_width = get_tile_raster_width(); @@ -455,10 +463,19 @@ const sint16 y=ypos+(raster_tile_width*3)/4-r - (gr->get_grund_hang()? tile_raster_scale_y(8,raster_tile_width): 0); const bool kartenboden_dirty = gr->get_flag(grund_t::dirty); const sint16 off = (raster_tile_width>>5); - // suitable start search - for(sint16 h=halt_list_count-1; h>=0; h-- ) { - display_fillbox_wh_clip(x - h * off, y + h * off, r, r, PLAYER_FLAG | (halt_list[h]->get_besitzer()->get_player_color1() + 4), kartenboden_dirty); + if(!umgebung_t::show_station_tile) { + // suitable start search + for(sint16 h=halt_list_count-1; h>=0; h-- ) { + display_fillbox_wh_clip(x - h * off, y + h * off, r, r, PLAYER_FLAG | (halt_list[h]->get_besitzer()->get_player_color1() + 4), kartenboden_dirty); + } } + else { + // show halt tile too + halthandle_t halt = get_halt(); + if(halt.is_bound()) { + display_fillbox_wh_clip(x, y, r, r, PLAYER_FLAG | (halt->get_besitzer()->get_player_color1() + 4), kartenboden_dirty); + } + } } } Index: simwerkz.cc =================================================================== --- simwerkz.cc (リビジョン 3418) +++ simwerkz.cc (作業コピー) @@ -2972,6 +2972,7 @@ bool wkz_station_t::init( karte_t *welt, spieler_t * ) { sint8 rotation = -1; + win_set_static_tooltip( NULL ); const haus_besch_t *hb = get_besch( rotation ); if( hb==NULL ) { return false; @@ -3122,7 +3123,23 @@ return msg; } +char wkz_station_t::toolstring[256]; +const char *wkz_station_t::move( karte_t *welt, spieler_t *sp, uint16, koord3d p ) +{ + win_set_static_tooltip( NULL ); + if(umgebung_t::show_hover_station_name) { + const planquadrat_t *pl = welt->lookup(p.get_2d()); + if(pl) { + halthandle_t halt = pl->get_halt(); + if( halt.is_bound() ) { + sprintf(toolstring, "%s (%s)", halt->get_name(), halt->get_besitzer()->get_name() ); + win_set_static_tooltip(toolstring); + } + } + } +} + // builds roadsings and signals const char *wkz_roadsign_t::get_tooltip(spieler_t *) { Index: simwerkz.h =================================================================== --- simwerkz.h (リビジョン 3418) +++ simwerkz.h (作業コピー) @@ -324,8 +324,10 @@ virtual image_id get_icon(spieler_t *) const; const char *get_tooltip(spieler_t *); bool init( karte_t *, spieler_t * ); + bool exit( karte_t *w, spieler_t *s ) { win_set_static_tooltip( NULL ); return true; } const char *check( karte_t *, spieler_t *, koord3d ); virtual const char *work( karte_t *, spieler_t *, koord3d ); + virtual const char *move( karte_t *, spieler_t *, uint16 /* buttonstate */, koord3d ); virtual bool is_init_network_save() const { return true; } }; @@ -621,10 +623,16 @@ class wkz_show_coverage_t : public werkzeug_t { public: wkz_show_coverage_t() : werkzeug_t() { id = WKZ_SHOW_COVERAGE | SIMPLE_TOOL; } - const char *get_tooltip(spieler_t *) { return translator::translate("show station coverage"); } + const char *get_tooltip(spieler_t *) { + return translator::translate( + umgebung_t::station_coverage_show == 0 ? "show station coverage" : + umgebung_t::show_station_tile ? "hide station coverage" : "show only station tile"); + } bool is_selected(karte_t *) const { return umgebung_t::station_coverage_show; } bool init( karte_t *welt, spieler_t * ) { - umgebung_t::station_coverage_show = !umgebung_t::station_coverage_show; + bool temp = umgebung_t::show_station_tile; + umgebung_t::show_station_tile = (!temp && umgebung_t::station_coverage_show==0) ? umgebung_t::show_station_tile : !umgebung_t::show_station_tile; + umgebung_t::station_coverage_show = (!temp && umgebung_t::station_coverage_show!=0) ? umgebung_t::station_coverage_show : !umgebung_t::station_coverage_show; welt->set_dirty(); return false; } Index: dataobj/einstellungen.cc =================================================================== --- dataobj/einstellungen.cc (リビジョン 3426) +++ dataobj/einstellungen.cc (作業コピー) @@ -619,6 +619,7 @@ // display stuff umgebung_t::show_names = contents.get_int("show_names", umgebung_t::show_names); + umgebung_t::show_hover_station_name = contents.get_int("show_hover_station_name", umgebung_t::show_hover_station_name); umgebung_t::show_month = contents.get_int("show_month", umgebung_t::show_month); umgebung_t::max_acceleration = contents.get_int("fast_forward", umgebung_t::max_acceleration);