From 4426d6e72f87e5d2b4b84c6d2196db21f638659d Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 23 May 2009 17:53:49 +0000 Subject: Add an option that controls whether the tiles build displays tiles in menus or not. (Defaults to true.) Tiled menus may seem like a great feature (and I love them) but they can also be a bit confusing/distracting (though much less so now than they used to be), and I respect that. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9799 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/options_guide.txt | 28 +++++++++++++++++----------- crawl-ref/settings/tiles_options.txt | 3 +++ crawl-ref/source/externs.h | 1 + crawl-ref/source/initfile.cc | 2 ++ crawl-ref/source/invent.cc | 3 +++ crawl-ref/source/menu.cc | 6 ++++++ crawl-ref/source/tilereg.cc | 8 +++++--- 7 files changed, 37 insertions(+), 14 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt index 435bca6a57..982f01ff40 100644 --- a/crawl-ref/docs/options_guide.txt +++ b/crawl-ref/docs/options_guide.txt @@ -85,16 +85,16 @@ The contents of this text are: flush.failure, flush.command, flush.message, macro_meta_entry, additional_macro_file, bindkey 4-o Tiles Options. - tile_show_items, tile_title_screen, tile_player_col, - tile_monster_col, tile_neutral_col, tile_friendly_col, - tile_plant_col, tile_item_col, tile_unseen_col, - tile_floor_col, tile_wall_col, tile_mapped_wall_col, - tile_door_col, tile_downstairs_col, tile_upstairs_col, - tile_feature_col, tile_trap_col, tile_water_col, - tile_lava_col, tile_excluded_col, tile_excl_centre_col, - tile_key_repeat, tile_tooltip_ms, tile_window_width, - tile_window_height, tile_map_pixels, tile_full_screen, - tile_tag_pref + tile_show_items, tile_title_screen, tile_menu_icons, + tile_player_col, tile_monster_col, tile_neutral_col, + tile_friendly_col, tile_plant_col, tile_item_col, + tile_unseen_col, tile_floor_col, tile_wall_col, + tile_mapped_wall_col, tile_door_col, tile_downstairs_col, + tile_upstairs_col, tile_feature_col, tile_trap_col, + tile_water_col, tile_lava_col, tile_excluded_col, + tile_excl_centre_col, tile_key_repeat, tile_tooltip_ms, + tile_window_width, tile_window_height, tile_map_pixels, + tile_full_screen, tile_tag_pref 5- Character Dump. 5-a Items and Kills. kill_map, dump_kill_places, dump_item_origins, @@ -1570,10 +1570,16 @@ tile_show_items = inventory. By default, its value is "!?/%=([)x}+\". Items with glyphs not in the list will be shown last. -title_screen = true +tile_title_screen = true When this is set to true, the graphical title screen will be displayed. +tile_menu_icons = true + Causes inventory menus and a few other ones to include tiled icons + and the menus to be displayed in up to two columns to make up for + the reduction of space. + If you would rather have the plain menus set this option to false. + tile_player_col = white tile_monster_col = red tile_neutral_col = red diff --git a/crawl-ref/settings/tiles_options.txt b/crawl-ref/settings/tiles_options.txt index e2069446b0..8f195c088c 100644 --- a/crawl-ref/settings/tiles_options.txt +++ b/crawl-ref/settings/tiles_options.txt @@ -1,7 +1,10 @@ +# This file contains options useful only for the Tiles build of Stone Soup. +# See init.txt on how to change the optional values. # tile_show_items = !?/%=([)X}+\_. # tile_title_screen = false +# tile_menu_icons = false ### The following lines define the colours of various objects within the ### tiles minimap. See options_guide.txt for more details. diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index d85896d220..05c5120d2f 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -2193,6 +2193,7 @@ public: #ifdef USE_TILE char tile_show_items[20]; // show which item types in tile inventory bool tile_title_screen; // display title screen? + bool tile_menu_icons; // display icons in menus? // minimap colours char tile_player_col; char tile_monster_col; diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 08f7546915..30e77385b6 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -894,6 +894,7 @@ void game_options::reset_options() #ifdef USE_TILE 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; @@ -3024,6 +3025,7 @@ void game_options::read_option_line(const std::string &str, bool runscript) strncpy(tile_show_items, field.c_str(), 18); } else BOOL_OPTION(tile_title_screen); + else BOOL_OPTION(tile_menu_icons); else if (key == "tile_player_col") { tile_player_col = diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index f392c9d429..45b22896c0 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -483,6 +483,9 @@ void InvMenu::load_inv_items(int item_selector, int excluded_slot, #ifdef USE_TILE bool InvEntry::get_tiles(std::vector& tileset) const { + if (!Options.tile_menu_icons) + return (false); + if (quantity <= 0) return (false); diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 20c45769e7..3ae400beeb 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -721,6 +721,9 @@ bool MenuEntry::get_tiles(std::vector& tileset) const bool MonsterMenuEntry::get_tiles(std::vector& tileset) const { + if (!Options.tile_menu_icons) + return (false); + monsters *m = (monsters*)(data); if (!m) return (false); @@ -805,6 +808,9 @@ bool MonsterMenuEntry::get_tiles(std::vector& tileset) const bool FeatureMenuEntry::get_tiles(std::vector& tileset) const { + if (!Options.tile_menu_icons) + return (false); + if (!in_bounds(pos)) return (false); diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 04a3b08a82..4e5a2e06bb 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -2596,9 +2596,9 @@ void MenuRegion::place_entries() { m_dirty = false; - const int heading_indent = 10; - const int tile_indent = 20; - const int text_indent = 58; + const int heading_indent = 10; + const int tile_indent = 20; + const int text_indent = (Options.tile_menu_icons ? 58 : 20); const int max_tile_height = 32; const int entry_buffer = 1; const VColour selected_colour(50, 50, 10, 255); @@ -2610,6 +2610,8 @@ void MenuRegion::place_entries() m_tile_buf[t].clear(); int column = 0; + if (!Options.tile_menu_icons) + set_num_columns(1); const int max_columns = std::min(2, m_max_columns); const int column_width = mx / max_columns; -- cgit v1.2.3-54-g00ecf