show_map() now centers the known map along x or y. This prevents the player from getting "artificial" location clues by using the map to see how close to the end they are. They'll need to explore to get that. This function is still a mess, though. -- bwr
| 905 | // map to see how close to the end they are. They'll need to explore |
| 906 | // to get that. This function is still a mess, though. -- bwr |
| 907 | bool show_map(level_pos &lpos, bool travel_mode, bool allow_offlevel) |
| 908 | { |
| 909 | if (map_view) |
| 910 | { |
| 911 | ASSERT(map_view->is_alive()); |
| 912 | // handle reentry -- just attempt to set the position. Ignore both |
| 913 | // the travel_mode and the allow_offlevel params -- inherit from the |
| 914 | // running map. |
| 915 | map_view->set_lpos(lpos); |
| 916 | return false; |
| 917 | } |
| 918 | else |
| 919 | { |
| 920 | #ifdef USE_TILE_LOCAL |
| 921 | mouse_control mc(MOUSE_MODE_NORMAL); |
| 922 | tiles.do_map_display(); |
| 923 | #endif |
| 924 | |
| 925 | #ifdef USE_TILE |
| 926 | ui::cutoff_point ui_cutoff_point; |
| 927 | #endif |
| 928 | #ifdef USE_TILE_WEB |
| 929 | tiles_ui_control ui(UI_VIEW_MAP); |
| 930 | #endif |
| 931 | |
| 932 | if (!lpos.id.is_valid() || !allow_offlevel) |
| 933 | lpos.id = level_id::current(); |
| 934 | |
| 935 | levelview_excursion le(travel_mode); |
| 936 | map_view = make_shared<UIMapView>(lpos, le, travel_mode, allow_offlevel); |
| 937 | |
| 938 | #ifdef USE_TILE_LOCAL |
| 939 | unwind_bool inhibit_rendering(ui::should_render_current_regions, false); |
| 940 | #else |
| 941 | cursor_control cc(!Options.use_fake_cursor); |
| 942 | #endif |
| 943 | |
| 944 | ui::push_layout(map_view, KMC_LEVELMAP); |
| 945 | while (map_view->is_alive() && !crawl_state.seen_hups) |
| 946 | ui::pump_events(); |
| 947 | ui::pop_layout(); |
| 948 | |
| 949 | #ifdef USE_TILE_LOCAL |
| 950 | tiles.set_map_display(false); |
| 951 | #endif |
| 952 | #ifdef USE_TILE |
| 953 | tiles.place_cursor(CURSOR_MAP, NO_CURSOR); |
| 954 | #endif |
| 955 | |
| 956 | lpos = map_view->lpos(); |
| 957 | const bool result = map_view->chose(); |
| 958 | map_view = nullptr; |
| 959 | return result; |
| 960 | } |
| 961 | } |
| 962 | |
| 963 | level_pos map_follow_stairs(bool up, const coord_def &pos) |
| 964 | { |
no test coverage detected