diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-14 11:02:13 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-14 11:02:13 +0000 |
commit | 676dc0d1108ddbf60d3f7988be0be93e808d0f9a (patch) | |
tree | 5345783873578a5a43dbdcba994b877b9b9369f9 | |
parent | b5e038ca7cc358785ad7ca0a9160bffd8a1c2df7 (diff) | |
download | crawl-ref-676dc0d1108ddbf60d3f7988be0be93e808d0f9a.tar.gz crawl-ref-676dc0d1108ddbf60d3f7988be0be93e808d0f9a.zip |
* Make the key press delay in tiles optional (and shorter, by default).
* Fix font name options being lowercased and thus not found.
* Add missing tile options to options_guide.txt.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@9976 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/docs/options_guide.txt | 63 | ||||
-rw-r--r-- | crawl-ref/settings/tiles_options.txt | 27 | ||||
-rw-r--r-- | crawl-ref/source/externs.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/initfile.cc | 43 | ||||
-rw-r--r-- | crawl-ref/source/tilepick.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/tilereg.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 26 |
7 files changed, 95 insertions, 71 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt index bb358d9e54..f65f6f6bbd 100644 --- a/crawl-ref/docs/options_guide.txt +++ b/crawl-ref/docs/options_guide.txt @@ -1640,35 +1640,58 @@ the dungeon level. tile_floor_col and tile_item_col, only) tile_window_col - colour of the rectangular view window -tile_key_repeat = true - Whether or not to repeat key presses when they are held down. - By default, keys will repeat. +tile_key_repeat_delay = 200 + If you hold down a key, there's a delay until the presses key will + take action. This option controls this delay, in milliseconds. If it + is set to 0 key presses will never repeat. tile_tooltip_ms = 500 - The number of milliseconds before a tooltip appears when hovering the - mouse over part of the screen. Setting this option to 0 will - deactivate the tooltips entirely. + The number of milliseconds before a tooltip appears when hovering the + mouse over part of the screen. Setting this option to 0 will + deactivate the tooltips entirely. + +tile_tag_pref = (none| named | enemy | tutorial ) + This option defaults to "enemy" normally and "tutorial" in tutorial + modes. This setting determines which monsters receive text tag + none - turns off all tags. + named - shows names of all named monsters, ally or enemy + enemy - shows names of named enemy monsters + tutorial - shows names of all monsters not yet killed this game + and of named enemy monsters + Examples for named monsters are uniques and ghosts. tile_window_width = 0 tile_window_height = 0 - The width and height of the window, in pixels. If set to zero, it - will auto-size the window. + The width and height of the window, in pixels. If set to zero, it + will auto-size the window. tile_map_pixels = 4 - The number of pixels each minimap square should take up. + The number of pixels each minimap square should take up. tile_full_screen = false - Setting this option to true will start Crawl in full screen mode. - -tile_tag_pref = (none | tutorial | named | enemy) - This option defaults to "enemy" normally and "tutorial" in tutorial - modes. This settings determines which monsters receive text tag - labels above them, describing what kind of monster they are. - The "none" option turns off all tags. The "tutorial" option - shows the name of all monsters that the player has only killed - a few times. The "named" options shows the names for all monsters - with names, friendly and enemy. The "enemy" option only shows the - name of enemy monsters with names (such as uniques and ghosts.) + Setting this option to true will start Crawl in full screen mode. + +tile_font_crt_file = VeraMono.ttf +tile_font_stat_file = VeraMono.ttf +tile_font_msg_file = VeraMono.ttf +tile_font_tip_file = VeraMono.ttf +tile_font_lbl_file = Vera.ttf + Fonts used in various sections of the screen. If you want to use + another font, you'll have to place the corresponding *.ttf file into + the dat/tiles/ folder. + Screen regions are as follows: + crt - non-map screens (menus, message history, etc.) + stat - stat area (hit points, AC, etc.) + msg - message area + tip - tooltips (mouseover information) + lbl - item/monster names in inventory/main map + +tile_font_crt_size = 15 +tile_font_stat_size = 16 +tile_font_msg_size = 14 +tile_font_tip_size = 15 +tile_font_lbl_size = 14 + Font size for the screen regions listed above. 5- Character Dump. =================== diff --git a/crawl-ref/settings/tiles_options.txt b/crawl-ref/settings/tiles_options.txt index 8f195c088c..65d58fdbe3 100644 --- a/crawl-ref/settings/tiles_options.txt +++ b/crawl-ref/settings/tiles_options.txt @@ -30,26 +30,25 @@ # tile_excl_centre = darkblue # tile_window_col = yellow -# tile_key_repeat = false - -# tile_tooltip_ms = 500 +# tile_key_repeat_delay = 200 +# tile_tooltip_ms = 500 # tile_tag_pref = enemy ### Note: setting window, map, or font sizes to '0' implies auto-sizing. -# tile_window_width = 1024 +# tile_window_width = 1024 # tile_window_height = 768 -# tile_map_pixels = 4 -# tile_full_screen = true +# tile_map_pixels = 4 +# tile_full_screen = true -# tile_font_crt_file = VeraMono.ttf -# tile_font_crt_size = 15 +# tile_font_crt_file = VeraMono.ttf +# tile_font_crt_size = 15 # tile_font_stat_file = VeraMono.ttf # tile_font_stat_size = 16 -# tile_font_msg_file = VeraMono.ttf -# tile_font_msg_size = 14 -# tile_font_tip_file = VeraMono.ttf -# tile_font_tip_size = 15 -# tile_font_lbl_file = Vera.ttf -# tile_font_lbl_size = 14 +# tile_font_msg_file = VeraMono.ttf +# tile_font_msg_size = 14 +# tile_font_tip_file = VeraMono.ttf +# tile_font_tip_size = 15 +# tile_font_lbl_file = Vera.ttf +# tile_font_lbl_size = 14 diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index d2d3280581..cd496c8417 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -2226,7 +2226,7 @@ public: int tile_font_lbl_size; std::string tile_font_tip_file; int tile_font_tip_size; - bool tile_key_repeat; + int tile_key_repeat_delay; screen_mode tile_full_screen; int tile_window_width; int tile_window_height; diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index d11c2e974c..beac5fd849 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -895,6 +895,7 @@ void game_options::reset_options() strcpy(tile_show_items, "!?/%=([)x}+\\_."); tile_title_screen = true; tile_menu_icons = true; + // minimap colours tile_player_col = MAP_WHITE; tile_monster_col = MAP_RED; @@ -930,13 +931,15 @@ void game_options::reset_options() tile_font_lbl_size = 0; // window layout - tile_key_repeat = true; - tile_full_screen = SCREENMODE_AUTO; - tile_window_width = 0; - tile_window_height = 0; - tile_map_pixels = 0; - tile_tooltip_ms = 500; - tile_tag_pref = crawl_state.arena ? TAGPREF_NAMED : TAGPREF_ENEMY; + tile_full_screen = SCREENMODE_AUTO; + tile_window_width = 0; + tile_window_height = 0; + tile_map_pixels = 0; + tile_tag_pref = crawl_state.arena ? TAGPREF_NAMED : TAGPREF_ENEMY; + + // delays + tile_key_repeat_delay = 200; + tile_tooltip_ms = 500; #endif // map each colour to itself as default @@ -1591,18 +1594,17 @@ void game_options::fixup_options() static int _str_to_killcategory(const std::string &s) { - static const char *kc[] = { - "you", - "friend", - "other", - }; + static const char *kc[] = { + "you", + "friend", + "other", + }; + + for (unsigned i = 0; i < sizeof(kc) / sizeof(*kc); ++i) + if (s == kc[i]) + return i; - for (unsigned i = 0; i < sizeof(kc) / sizeof(*kc); ++i) - { - if (s == kc[i]) - return i; - } - return -1; + return -1; } void game_options::do_kill_map(const std::string &from, const std::string &to) @@ -2010,7 +2012,8 @@ void game_options::read_option_line(const std::string &str, bool runscript) && key != "menu_colour" && key != "menu_color" && key != "message_colour" && key != "message_color" && key != "levels" && key != "level" && key != "entries" - && key != "include" && key != "bindkey") + && key != "include" && key != "bindkey" + && key.find("font") == std::string::npos) { lowercase( field ); } @@ -3153,7 +3156,7 @@ void game_options::read_option_line(const std::string &str, bool runscript) tile_font_lbl_file = field; } else INT_OPTION(tile_font_lbl_size, 1, INT_MAX); - else BOOL_OPTION(tile_key_repeat); + else INT_OPTION(tile_key_repeat_delay, 0, INT_MAX); else if (key == "tile_full_screen") tile_full_screen = (screen_mode)_read_bool(field, tile_full_screen); else INT_OPTION(tile_window_width, 1, INT_MAX); diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index b222351f2a..1a79526ac8 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -4419,7 +4419,7 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground, bool detected) else if (pref == TAGPREF_TUTORIAL) { const long kills = you.kills->num_kills(mon); - const int limit = 0; + const int limit = 0; if (!mon->is_named() && kills > limit) return; diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 0188f20de0..a3879ab2a1 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -1230,7 +1230,8 @@ bool InventoryTile::empty() const return (idx == -1); } -InventoryRegion::InventoryRegion(ImageManager* im, FTFont *tag_font, int tile_x, int tile_y) : +InventoryRegion::InventoryRegion(ImageManager* im, FTFont *tag_font, + int tile_x, int tile_y) : TileRegion(im, tag_font, tile_x, tile_y), m_flavour(NULL), m_buf_dngn(&im->m_textures[TEX_DUNGEON]), diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 18bad8b8f8..e112c7cc34 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -150,13 +150,13 @@ void TilesFramework::shutdown() delete m_region_menu; delete m_region_title; - m_region_tile = NULL; - m_region_stat = NULL; - m_region_msg = NULL; - m_region_map = NULL; - m_region_inv = NULL; - m_region_crt = NULL; - m_region_menu = NULL; + m_region_tile = NULL; + m_region_stat = NULL; + m_region_msg = NULL; + m_region_map = NULL; + m_region_inv = NULL; + m_region_crt = NULL; + m_region_menu = NULL; m_region_title = NULL; for (unsigned int i = 0; i < LAYER_MAX; i++) @@ -252,9 +252,9 @@ bool TilesFramework::initialise() SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); - if (Options.tile_key_repeat) + if (Options.tile_key_repeat_delay > 0) { - int delay = SDL_DEFAULT_REPEAT_DELAY; + int delay = Options.tile_key_repeat_delay; int interval = SDL_DEFAULT_REPEAT_INTERVAL; if (SDL_EnableKeyRepeat(delay, interval) != 0) printf("Failed to set key repeat mode: %s\n", SDL_GetError()); @@ -1098,12 +1098,10 @@ bool TilesFramework::layout_statcol(bool message_overlay, bool show_gold_turns) inv_col = m_region_stat->sx; m_region_inv->place(inv_col, m_region_map->ey, 0); - m_region_inv->resize_to_fit(m_windowsz.x - - m_region_inv->sx, - m_windowsz.y - - m_region_inv->sy); + m_region_inv->resize_to_fit(m_windowsz.x - m_region_inv->sx, + m_windowsz.y - m_region_inv->sy); m_region_inv->resize(std::min(13, (int)m_region_inv->mx), - std::min(6, (int)m_region_inv->my)); + std::min( 6, (int)m_region_inv->my)); int self_inv_y = m_windowsz.y - m_region_inv->wy - margin; m_region_inv->place(inv_col, self_inv_y, 0); |