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

@@ -98,8 +98,6 @@ extern fs::path progDir;
short specials_res_id;
char start_name[256];
//#include "pc.itemdata.h"
cItemRec item_list[400];
cScenario scenario;
//
@@ -462,6 +460,7 @@ void handle_edit_menu(int item_hit)
// return i;
//}
// TODO: Let this take the item directly instead of the index
void handle_item_menu(int item_hit)
{
short choice;
@@ -471,7 +470,7 @@ void handle_item_menu(int item_hit)
display_strings(5,7);
return;
}
store_i = item_list[item_hit];
store_i = scenario.scen_items[item_hit];
store_i.ident = true;
give_to_pc(current_active_pc,store_i,false);
}

View File

@@ -89,7 +89,7 @@ void menu_activate() {
}
void update_item_menu() {
id targ = [[apple_menu itemAtIndex: 1] target];
id targ = [[file_menu itemAtIndex: 0] target];
cItemRec(& item_list)[400] = scenario.scen_items;
for(int j = 0; j < 4; j++){
[items_menu[j] removeAllItems];
@@ -123,6 +123,11 @@ void update_item_menu() {
-(void) itemMenu:(id) sender {
ItemWrapper* item = [sender representedObject];
cItemRec& theItem = [item item];
for(int i = 0; i < 4; i++) {
int whichItem = [items_menu[i] indexOfItem: sender];
if(whichItem >= 0)
handle_item_menu(whichItem + 100 * i);
}
}
-(void) helpMenu:(id) sender {