Atrinik Client 2.5
include/settings.h
Go to the documentation of this file.
00001 /************************************************************************
00002 *            Atrinik, a Multiplayer Online Role Playing Game            *
00003 *                                                                       *
00004 *    Copyright (C) 2009-2011 Alex Tokar and Atrinik Development Team    *
00005 *                                                                       *
00006 * Fork from Daimonin (Massive Multiplayer Online Role Playing Game)     *
00007 * and Crossfire (Multiplayer game for X-windows).                       *
00008 *                                                                       *
00009 * This program is free software; you can redistribute it and/or modify  *
00010 * it under the terms of the GNU General Public License as published by  *
00011 * the Free Software Foundation; either version 2 of the License, or     *
00012 * (at your option) any later version.                                   *
00013 *                                                                       *
00014 * This program is distributed in the hope that it will be useful,       *
00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00017 * GNU General Public License for more details.                          *
00018 *                                                                       *
00019 * You should have received a copy of the GNU General Public License     *
00020 * along with this program; if not, write to the Free Software           *
00021 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             *
00022 *                                                                       *
00023 * The author can be reached at admin@atrinik.org                        *
00024 ************************************************************************/
00025 
00030 #ifndef SETTINGS_H
00031 #define SETTINGS_H
00032 
00036 enum
00037 {
00039     OPT_CAT_GENERAL,
00041     OPT_CAT_CLIENT,
00043     OPT_CAT_MAP,
00045     OPT_CAT_SOUND,
00047     OPT_CAT_DEVEL
00048 };
00049 
00057 enum
00058 {
00059     OPT_PLAYERDOLL,
00060     OPT_TARGET_SELF,
00061     OPT_COLLECT_MODE,
00062     OPT_EXP_DISPLAY,
00063     OPT_CHAT_TIMESTAMPS,
00064     OPT_MAX_CHAT_LINES,
00065     OPT_SNAP_RADIUS
00066 };
00067 
00070 enum
00071 {
00073     OPT_RESOLUTION,
00075     OPT_FULLSCREEN,
00077     OPT_ZOOM_SMOOTH,
00079     OPT_KEY_REPEAT_SPEED,
00081     OPT_SLEEP_TIME,
00083     OPT_DISABLE_FILE_UPDATES,
00085     OPT_MINIMIZE_LATENCY,
00087     OPT_OFFSCREEN_WIDGETS,
00088 
00090     OPT_RESOLUTION_X,
00092     OPT_RESOLUTION_Y
00093 };
00094 
00097 enum
00098 {
00100     OPT_PLAYER_NAMES,
00102     OPT_MAP_ZOOM,
00104     OPT_HEALTH_WARNING,
00106     OPT_FOOD_WARNING,
00108     OPT_MAP_WIDTH,
00110     OPT_MAP_HEIGHT
00111 };
00112 
00115 enum
00116 {
00118     OPT_VOLUME_MUSIC,
00120     OPT_VOLUME_SOUND
00121 };
00122 
00125 enum
00126 {
00128     OPT_SHOW_FPS,
00130     OPT_RELOAD_GFX,
00132     OPT_DISABLE_RM_CACHE,
00134     OPT_QUICKPORT
00135 };
00136 
00142 enum
00143 {
00145     OPT_TYPE_BOOL,
00147     OPT_TYPE_INPUT_NUM,
00149     OPT_TYPE_INPUT_TEXT,
00151     OPT_TYPE_RANGE,
00153     OPT_TYPE_SELECT,
00155     OPT_TYPE_INT,
00156 
00158     OPT_TYPE_NUM
00159 };
00160 
00164 enum
00165 {
00167     SETTING_TYPE_NONE,
00169     SETTING_TYPE_SETTINGS,
00171     SETTING_TYPE_KEYBINDINGS,
00173     SETTING_TYPE_PASSWORD
00174 };
00175 
00177 typedef struct setting_range
00178 {
00180     sint64 min;
00181 
00183     sint64 max;
00184 
00186     sint64 advance;
00187 } setting_range;
00188 
00192 typedef struct setting_select
00193 {
00195     char **options;
00196 
00198     size_t options_len;
00199 } setting_select;
00200 
00203 typedef struct setting_struct
00204 {
00206     char *name;
00207 
00209     char *desc;
00210 
00212     uint8 type;
00213 
00215     uint8 internal;
00216 
00218     void *custom_attrset;
00219 
00221     union
00222     {
00224         char *str;
00225 
00227         sint64 i;
00228     } val;
00229 } setting_struct;
00230 
00233 typedef struct setting_category
00234 {
00236     char *name;
00237 
00239     setting_struct **settings;
00240 
00242     size_t settings_num;
00243 } setting_category;
00244 
00246 #define SETTING_SELECT(_setting) ((setting_select *) (_setting)->custom_attrset)
00247 
00248 #define SETTING_RANGE(_setting) ((setting_range *) (_setting)->custom_attrset)
00249 
00252 enum
00253 {
00255     KEYBIND_STEP_COMMAND,
00257     KEYBIND_STEP_KEY,
00259     KEYBIND_STEP_DONE
00260 };
00261 
00262 setting_category **setting_categories;
00263 size_t setting_categories_num;
00264 
00265 #endif