Fix spellcasting and dynamic menus

- Spell targeting line and array draws nicely, though not the same as the original
- Fix targeting falsely complaining about being off the edge of town
- Monster info dialog works properly; attacks now display correctly
- Fix dialogs always showing the wrong terrain or monster graphic
- Spell menus, monster menus, and PC editor item menus all work
- Spellcasting dialog now chooses the correct spell
- Fix out-of-place LED in spellcasting dialog
This commit is contained in:
2014-04-22 02:06:31 -04:00
parent d90a006e43
commit a4430cdf5a
15 changed files with 71 additions and 100 deletions

View File

@@ -2255,7 +2255,7 @@ static bool pick_spell_event_filter(cDialog& me, std::string item_hit, eKeyMod m
static bool pick_spell_select_led(cDialog& me, std::string id, eKeyMod mods) {
static const char*const choose_target = " Now pick a target.";
static const char*const bad_spell = " Spell not available.";
short item_hit = id[id.length() - 1] - '1';
short item_hit = boost::lexical_cast<short>(id.substr(5)) - 1;
if(mod_contains(mods, mod_alt)) {
int i = (on_which_spell_page == 0) ? item_hit : spell_index[item_hit];
display_spells(store_situation,i,&me);
@@ -2265,8 +2265,8 @@ static bool pick_spell_select_led(cDialog& me, std::string id, eKeyMod mods) {
}
else {
if (store_situation == 0)
store_mage = (on_which_spell_page == 0) ? item_hit - 37 : spell_index[item_hit - 37];
else store_priest = (on_which_spell_page == 0) ? item_hit - 37 : spell_index[item_hit - 37];
store_mage = (on_which_spell_page == 0) ? item_hit : spell_index[item_hit];
else store_priest = (on_which_spell_page == 0) ? item_hit : spell_index[item_hit];
draw_spell_info(me);
put_spell_led_buttons(me);