From 305618f279ee424e35c254b0d63d151f91fd3e69 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 16 Mar 2009 20:49:42 +0000 Subject: * Fix 2687930: Shorten the spell menu more, and don't call update_title() at '?' as apparently all it does is hide the first spell line. * Uncomment the autoinscription of weapons of distortion in init.txt. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9511 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/settings/init.txt | 6 ++-- crawl-ref/source/directn.cc | 2 +- crawl-ref/source/invent.cc | 72 +++++++++++++++++++++++++++++++++----------- crawl-ref/source/menu.cc | 9 +++--- crawl-ref/source/misc.cc | 7 +++++ crawl-ref/source/ouch.cc | 2 +- crawl-ref/source/spl-cast.cc | 6 ++-- crawl-ref/source/stash.cc | 5 ++- crawl-ref/source/tilereg.cc | 14 ++++----- crawl-ref/source/tilesdl.cc | 3 +- 10 files changed, 84 insertions(+), 42 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt index ce8052f6c0..b31e0a30aa 100644 --- a/crawl-ref/settings/init.txt +++ b/crawl-ref/settings/init.txt @@ -165,7 +165,7 @@ trap_item_brand = reverse # explore_stop = items,greedy_items,stairs,shops,altars,gates # explore_improved = true auto_exclude = oklob plant,silver statue,orange crystal statue,ice statue -auto_exclude = curse skull,Roxanne +auto_exclude = curse skull,roxanne # tc_reachable = blue # tc_dangerous = cyan @@ -325,9 +325,9 @@ menu_colour = notes:white:Reached XP level ##### 4-m Inscriptions ########################## # -# autoinscribe = royal jell:=g -# autoinscribe = distortion:!w +autoinscribe = distortion:!w # autoinscribe = potion.*mutation:!q +# autoinscribe = royal jell:=g # autoinscribe_randarts = false ##### 4-n Macro related Options ################# diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 71c8ec454d..9f31f50935 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -560,7 +560,6 @@ void full_describe_view() if (monster_descriptor(list_mons[i]->type, MDSC_NOMSG_WOUNDS)) damage_level = MDAM_OKAY; - std::vector fss; std::string str = get_monster_equipment_desc(list_mons[i], true, DESC_CAP_A, true); @@ -572,6 +571,7 @@ void full_describe_view() // Wraparound if the description is longer than allowed. linebreak_string2(str, get_number_of_cols() - 8); + std::vector fss; formatted_string::parse_string_to_multiple(str, fss); MenuEntry *me; for (unsigned int j = 0; j < fss.size(); j++) diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 55b4cf3747..00b70258e5 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -225,56 +225,72 @@ std::string InvEntry::get_text() const return tstr.str(); } -void InvEntry::add_class_hotkeys(const item_def &i) +static void _get_class_hotkeys(const int type, std::vector &glyphs) { - switch (i.base_type) + switch (type) { case OBJ_GOLD: - add_hotkey('$'); + glyphs.push_back('$'); break; case OBJ_MISSILES: - add_hotkey('('); + glyphs.push_back('('); break; case OBJ_WEAPONS: - add_hotkey(')'); + glyphs.push_back(')'); break; case OBJ_ARMOUR: - add_hotkey('['); + glyphs.push_back('['); break; case OBJ_WANDS: - add_hotkey('/'); + glyphs.push_back('/'); break; case OBJ_FOOD: - add_hotkey('%'); + glyphs.push_back('%'); break; case OBJ_BOOKS: - add_hotkey('+'); - add_hotkey(':'); + glyphs.push_back('+'); + glyphs.push_back(':'); break; case OBJ_SCROLLS: - add_hotkey('?'); + glyphs.push_back('?'); break; case OBJ_JEWELLERY: - add_hotkey(i.sub_type >= AMU_RAGE ? '"' : '='); + glyphs.push_back('"'); + glyphs.push_back('='); break; case OBJ_POTIONS: - add_hotkey('!'); + glyphs.push_back('!'); break; case OBJ_STAVES: - add_hotkey('\\'); - add_hotkey('|'); + glyphs.push_back('\\'); + glyphs.push_back('|'); break; case OBJ_MISCELLANY: - add_hotkey('}'); + glyphs.push_back('}'); break; case OBJ_CORPSES: - add_hotkey('&'); + glyphs.push_back('&'); break; default: break; } } +void InvEntry::add_class_hotkeys(const item_def &i) +{ + const int type = i.base_type; + if (type == OBJ_JEWELLERY) + { + add_hotkey(i.sub_type >= AMU_RAGE ? '"' : '='); + return; + } + + std::vector glyphs; + _get_class_hotkeys(type, glyphs); + for (unsigned int k = 0; k < glyphs.size(); ++k) + add_hotkey(glyphs[k]); +} + bool InvEntry::show_prices = false; void InvEntry::set_show_prices(bool doshow) { @@ -714,7 +730,27 @@ void InvMenu::load_items(const std::vector &mitems, if (!inv_class[i]) continue; - add_entry( new MenuEntry( item_class_name(i), MEL_SUBTITLE ) ); + std::string subtitle = item_class_name(i); +#ifdef USE_TILE + // For Tiles, mention the class selection shortcuts. + if (is_set(MF_MULTISELECT) && inv_class[i] > 1) + { + std::vector glyphs; + _get_class_hotkeys(i, glyphs); + if (!glyphs.empty()) + { + const std::string misc = "Miscellaneous"; + subtitle += std::string(misc.length() + - subtitle.length() + 1, ' '); + subtitle += "(select all with "; + for (unsigned int k = 0; k < glyphs.size(); ++k) + subtitle += glyphs[k]; + subtitle += ")"; + } + } +#endif + + add_entry( new MenuEntry( subtitle, MEL_SUBTITLE ) ); items_in_class.clear(); for (int j = 0, count = mitems.size(); j < count; ++j) diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 277f6f0bac..8f2e2e822b 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -334,7 +334,7 @@ bool Menu::process_key( int keyin ) { sel.clear(); menu_action = (action)((menu_action+1) % ACT_NUM); - update_title(); +// update_title(); return (true); } @@ -1093,10 +1093,11 @@ void slider_menu::adjust_pagesizes(int recurse_depth) pagesize--; if (selected != -1 - && (selected < first_entry || selected >= first_entry + pagesize) - && recurse_depth > 0) + && (selected < first_entry || selected >= first_entry + pagesize) + && recurse_depth > 0) + { fix_entry(recurse_depth - 1); - + } calc_y_offset(); } diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 982e0b2ad9..300dee4bd2 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2409,6 +2409,13 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, viewwindow(true, true); + if (Options.stash_tracking && !crawl_state.arena) + { + StashTrack.update_visible_stashes( + Options.stash_tracking == STM_ALL ? StashTracker::ST_AGGRESSIVE + : StashTracker::ST_PASSIVE); + } + if (collect_travel_data) { // Update stair information for the stairs we just descended, and the diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 748c4c4443..b5957ffe9b 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -981,7 +981,7 @@ void ouch(int dam, int death_source, kill_method_type death_type, mprf(MSGCH_DIAGNOSTICS, "Damage: %d; Hit points: %d", dam, you.hp); #endif - if (!yesno("Die?", false, 'n')) + if (!yesno("Die?", true, 'n')) { take_note(Note( NOTE_DEATH, you.hp, you.hp_max, death_desc.c_str()), true); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 88ffe247ae..565e21ab31 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -216,14 +216,14 @@ int list_spells(bool toggle_with_I, bool viewing) spell_menu.add_toggle_key('I'); more_str += "or 'I' "; } - more_str += "to toggle spell view."; + more_str += "to toggle spell view"; if (!viewing) { spell_menu.allow_toggle = true; spell_menu.menu_action = Menu::ACT_EXECUTE; - more_str += " Press '?' to toggle between spell selection" - " and description."; + more_str += ", or '?' to read the descriptions"; } + more_str += "."; spell_menu.set_more(formatted_string(more_str)); for (int i = 0; i < 52; ++i) diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index ad98884048..a2f47ffc7a 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -1778,7 +1778,6 @@ public: StashSearchMenu(const char* sort_style_) : Menu(), can_travel(true), request_toggle_sort_method(false), -// allow_toggle(true), menu_action(ACT_EXECUTE), sort_style(sort_style_) { } @@ -1836,9 +1835,9 @@ bool StashTracker::display_search_results( StashSearchMenu stashmenu(sort_style); stashmenu.set_tag("stash"); - stashmenu.can_travel = travelable; + stashmenu.can_travel = travelable; stashmenu.allow_toggle = true; - stashmenu.menu_action = Menu::ACT_EXECUTE; + stashmenu.menu_action = Menu::ACT_EXECUTE; std::string title = "match"; MenuEntry *mtitle = new MenuEntry(title, MEL_TITLE); diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 79387e594a..e4173944f1 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -90,11 +90,11 @@ const int dir_dx[9] = {-1, 0, 1, -1, 0, 1, -1, 0, 1}; const int dir_dy[9] = {1, 1, 1, 0, 0, 0, -1, -1, -1}; const int cmd_normal[9] = {'b', 'j', 'n', 'h', '.', 'l', 'y', 'k', 'u'}; -const int cmd_shift[9] = {'B', 'J', 'N', 'H', '5', 'L', 'Y', 'K', 'U'}; -const int cmd_ctrl[9] = {CONTROL('B'), CONTROL('J'), CONTROL('N'), - CONTROL('H'), 'X', CONTROL('L'), - CONTROL('Y'), CONTROL('K'), CONTROL('U')}; -const int cmd_dir[9] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'}; +const int cmd_shift[9] = {'B', 'J', 'N', 'H', '5', 'L', 'Y', 'K', 'U'}; +const int cmd_ctrl[9] = {CONTROL('B'), CONTROL('J'), CONTROL('N'), + CONTROL('H'), 'X', CONTROL('L'), + CONTROL('Y'), CONTROL('K'), CONTROL('U')}; +const int cmd_dir[9] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'}; Region::Region() : ox(0), @@ -1254,10 +1254,8 @@ void InventoryRegion::on_resize() return; m_flavour = new unsigned char[mx * my]; - for (int i = 0; i < mx * my; i++) - { + for (int i = 0; i < mx * my; ++i) m_flavour[i] = random2((unsigned char)~0); - } } void InventoryRegion::update(int num, InventoryTile *items) diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 35fd927957..f253f91f66 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -183,7 +183,8 @@ void TilesFramework::calculate_default_options() { break; } - } while (++auto_size < num_screen_sizes - 1); + } + while (++auto_size < num_screen_sizes - 1); // Auto pick map and font sizes if option is zero. #define AUTO(x,y) (x = (x) ? (x) : _screen_sizes[auto_size][(y)]) -- cgit v1.2.3-54-g00ecf