Some tweaks/fixes

- Show monster name in description of summoning item abilities (in-game and in the scenario editor)
- Don't call drop special nodes when storing an item in a container
- Don't use exceptions to determine whether a slot in the get window has an item in it
- Fix placed items defaulting to 0 charges instead of -1 (fortunately, this didn't actually cause a bug)
- Fix ability description in item dialog not updating after you edit the abilities
- Fix off-by-one issues in several cases of the pick monster dialog
- Show charges field in placed item dialog if the item is given the Shoot Flames enchantment
- Fix enchantment field not being filled with the current value when opening the edit placed item dialog
- Fix placed item dialog not updating after you set a new enchantment by editing the field (rather than using the Choose button)
- (Dialog engine) Fix initial focus handler call passing wrong control ID
This commit is contained in:
2015-06-11 12:22:04 -04:00
parent c871980b8f
commit 21291e168c
7 changed files with 38 additions and 30 deletions

View File

@@ -204,9 +204,10 @@ void drop_item(short pc_num,short item_num,location where_drop) {
take_given_item = false;
item_store.charges = how_many;
}
if(place_item(item_store,loc,true))
if(place_item(item_store,loc,true)) {
add_string_to_buf("Drop: Item put away");
else add_string_to_buf("Drop: OK");
spec = -1; // Don't call drop specials if it was put away
} else add_string_to_buf("Drop: OK");
univ.party[pc_num].items[item_num].charges -= how_many;
if(take_given_item)
univ.party[pc_num].take_item(item_num);
@@ -465,9 +466,7 @@ static void put_item_graphics(cDialog& me, size_t& first_item_shown, short& curr
key_stash[0] = 'a' + i;
// TODO: Rework this so that no exceptions are required
try {
if(item_array.at(i + first_item_shown)->variety == eItemType::NO_ITEM)
throw std::out_of_range("");
if(i + first_item_shown < item_array.size() && item_array[i + first_item_shown]->variety != eItemType::NO_ITEM) {
// display an item in window
me[pict].show();
item = *item_array[i + first_item_shown];
@@ -480,7 +479,7 @@ static void put_item_graphics(cDialog& me, size_t& first_item_shown, short& curr
me[detail].setText(get_item_interesting_string(item));
me[weight].setText("Weight: " + std::to_string(item.item_weight()));
me[key].setText(key_stash);
} catch(std::out_of_range) { // erase the spot
} else { // erase the spot
me[pict].hide();
me[name].setText("");
me[detail].setText("");