Subject: [PATCH] Underground view: toggle back off with "reselect closes tool"

With env_t::reselect_closes_tool set (the default), the underground view button
only works once: the first click enters underground view, the second one does
not leave it.

tool_selector_t::infowin_event() takes a different path for a tool that reports
is_selected():

    if( env_t::reselect_closes_tool && tool && tool->is_selected() ) {
        if( tool->exit( welt->get_active_player() ) ) { ...set query tool... }
    }
    else {
        welt->set_tool( tool, welt->get_active_player() );   // this one calls init()
    }

tool_show_underground_t overrides is_selected() to report the *global* underground
mode (grund_t::underground_mode == ugm_all) rather than "I am the selected tool",
so after the first click the reselect branch is taken, exit() is called instead of
init() - and the tool had no exit(), so the base tool_t::exit() ran, which does
nothing. The view therefore never toggled back.

Every other tool that overrides is_selected() to report a global state already
implements exit() to undo init(): all 38 of them in simtool-dialogs.h, plus
tool_toggle_control_t and every display toggle in simtool.h. The two nearest
neighbours spell it exactly like this patch does:

    class tool_show_grid_t : public tool_t {
        bool is_selected() const OVERRIDE { return grund_t::show_grid; }
        bool exit(player_t *s ) OVERRIDE { return init(s); }
    };
    class tool_day_night_toggle_t : public tool_t {
        bool exit(player_t* s) OVERRIDE { return init(s); }
    };

tool_show_underground_t was simply the one that never got it. This adds it.

This does NOT make switching to another tool leave the underground view.
karte_t::local_set_tool() only calls exit() on the outgoing *selected* tool, and
it only stores a tool as selected when init() returns true:

    bool init_result = tool_in->init(player);
    if (player && init_result && !tool_in->is_scripted()) {
        sp_tool->exit(player);
        selected_tool[player->get_player_nr()] = tool_in;
    }

tool_show_underground_t::init() returns needs_click, which is false for every
mode any pakset configures ('U', 'K', 'I', 'D' in both pak64 and pak128 - 'C' is
configured nowhere and never sets ugm_level anyway, since the tool has no work()).
So the tool never becomes the selected tool, and the only callers that can reach
its exit() are the toolbar's own left-click-reselect and right-click paths -
exactly the same exposure tool_show_grid_t already has.

Sliced mode ('K') is fixed by the same line: its is_selected() reports ugm_level
and its init() switches ugm_level back to ugm_none.

No change to the simulation, savegames, serialisation, network sync, translations
or rendering. is_init_keeps_game_state() is true, so the tool always runs through
local_set_tool() and is never queued to the network.

Note one behaviour change: right-clicking the button while underground view is on
now switches it off, where before it reset the active tool to the query tool. That
is what right-click already does to the dialog tools and to tool_toggle_control_t,
so it aligns this tool with its siblings.
---
diff --git a/src/simutrans/tool/simtool.h b/src/simutrans/tool/simtool.h
index b25427f..6a17b5a 100644
--- a/src/simutrans/tool/simtool.h
+++ b/src/simutrans/tool/simtool.h
@@ -993,6 +993,7 @@ public:
 	bool is_selected() const OVERRIDE;
 	void draw_after(scr_coord, bool dirty) const OVERRIDE;
 	bool init(player_t *) OVERRIDE;
+	bool exit(player_t *s) OVERRIDE { return init(s); }
 	bool is_init_keeps_game_state() const OVERRIDE { return true; }
 	bool is_work_keeps_game_state() const OVERRIDE { return true; }
 };
