00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef HELP_HPP_INCLUDED
00015 #define HELP_HPP_INCLUDED
00016
00017 #include <string>
00018 #include <vector>
00019
00020 class config;
00021 class display;
00022 class gamemap;
00023
00024 #include "hotkeys.hpp"
00025 #include "construct_dialog.hpp"
00026
00027 namespace help {
00028
00029 struct help_manager {
00030 help_manager(const config *game_config, gamemap *map);
00031 ~help_manager();
00032 };
00033
00034 struct section;
00035
00036
00037
00038 void show_help(display &disp, const section &toplevel, const std::string& show_topic="",
00039 int xloc=-1, int yloc=-1);
00040
00041
00042
00043
00044 void show_help(display &disp, const std::string& show_topic="", int xloc=-1, int yloc=-1);
00045
00046
00047 void show_unit_help(display &disp, const std::string& unit_id, bool hidden = false,
00048 int xloc=-1, int yloc=-1);
00049
00050 class help_button : public gui::dialog_button, public hotkey::command_executor {
00051 public:
00052 help_button(display& disp, const std::string &help_topic);
00053 int action(gui::dialog_process_info &info);
00054 const std::string topic() const { return topic_; }
00055 void join();
00056 void leave();
00057 private:
00058 void show_help();
00059 bool can_execute_command(hotkey::HOTKEY_COMMAND cmd, int =-1) const;
00060
00061 display &disp_;
00062 const std::string topic_;
00063 hotkey::basic_handler *help_hand_;
00064 };
00065
00066
00067 }
00068
00069 #endif