00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef GAME_CONFIG_H_INCLUDED
00015 #define GAME_CONFIG_H_INCLUDED
00016
00017 class config;
00018
00019 #include "color_range.hpp"
00020 #include "tstring.hpp"
00021
00022 #include <string>
00023 #include <vector>
00024 #include <map>
00025
00026
00027 namespace game_config
00028 {
00029 extern int base_income;
00030 extern int village_income;
00031 extern int poison_amount;
00032 extern int rest_heal_amount;
00033 extern int recall_cost;
00034 extern int kill_experience;
00035 extern unsigned lobby_refresh;
00036 extern const std::string version;
00037 extern const std::string revision;
00038
00039
00040 extern const int gold_carryover_percentage;
00041
00042
00043
00044
00045 extern const bool gold_carryover_add;
00046
00047 extern bool debug, editor, ignore_replay_errors, mp_debug, exit_at_end, no_delay, disable_autosave;
00048
00049 extern std::string path;
00050
00051 struct server_info {
00052 server_info() : name(""), address("") { }
00053 std::string name;
00054 std::string address;
00055 };
00056 extern std::vector<server_info> server_list;
00057
00058 extern std::string game_icon, game_title, game_logo, title_music, lobby_music,
00059 moved_ball_image, unmoved_ball_image, partmoved_ball_image,
00060 enemy_ball_image, ally_ball_image, energy_image,
00061 flag_image, flag_icon_image, cross_image,
00062 terrain_mask_image, grid_image, unreachable_image, linger_image,
00063 observer_image, tod_bright_image,
00064 checked_menu_image, unchecked_menu_image, wml_menu_image, level_image,
00065 ellipsis_image;
00066
00067 extern double hp_bar_scaling, xp_bar_scaling;
00068
00069 extern std::string flag_rgb;
00070 extern std::vector<Uint32> defense_color_scale;
00071
00072 extern std::vector<std::string> foot_speed_prefix;
00073 extern std::string foot_teleport_enter, foot_teleport_exit;
00074
00075 extern int title_logo_x, title_logo_y, title_buttons_x, title_buttons_y, title_buttons_padding, title_tip_x, title_tip_width, title_tip_padding;
00076
00077 extern std::map<std::string, color_range> team_rgb_range;
00078 extern std::map<std::string, t_string> team_rgb_name;
00079 extern std::map<std::string, std::vector<Uint32> > team_rgb_colors;
00080
00081
00082 extern const std::string observer_team_name;
00083
00084
00085
00086 extern const size_t max_loop;
00087
00088 namespace sounds {
00089 extern const std::string turn_bell, timer_bell, receive_message,
00090 receive_message_highlight, receive_message_friend,
00091 receive_message_server, user_arrive, user_leave,
00092 game_user_arrive, game_user_leave;
00093 extern const std::string button_press, checkbox_release, slider_adjust,
00094 menu_expand, menu_contract, menu_select;
00095 }
00096
00097 void load_config(const config* cfg);
00098
00099 void add_color_info(const config& v);
00100 const std::vector<Uint32>& tc_info(const std::string& name);
00101 const color_range& color_info(const std::string& name);
00102
00103 struct game_version {
00104 game_version(std::string str);
00105
00106
00107
00108 unsigned int major_nr;
00109 unsigned int minor_nr;
00110 unsigned int patch;
00111 std::string extra;
00112
00113 std::string full;
00114 };
00115
00116
00117
00118 bool operator<(const struct game_version& a, const struct game_version& b);
00119 bool operator<=(const struct game_version& a, const struct game_version& b);
00120 bool operator>(const struct game_version& a, const struct game_version& b);
00121 bool operator>=(const struct game_version& a, const struct game_version& b);
00122 bool operator==(const struct game_version& a, const struct game_version& b);
00123 bool operator!=(const struct game_version& a, const struct game_version& b);
00124
00125 extern const struct game_version wesnoth_version;
00126 extern const struct game_version min_savegame_version;
00127 extern const struct game_version test_version;
00128
00129 }
00130
00131 #endif