PC Editor: Fix inability to edit spells

This commit is contained in:
2017-04-11 17:28:43 -04:00
parent 4f91f6a679
commit 3c6190c433
2 changed files with 12 additions and 5 deletions

View File

@@ -115,6 +115,16 @@ void display_pc(short pc_num,short mode, cDialog* parent) {
dynamic_cast<cPict&>(pcInfo["pic"]).setPict(14 + mode,PIC_DLOG);
pcInfo.run();
if(mode >= 10) {
mode %= 10;
for(short i = 0; i < 62; i++) {
std::string id = "spell" + boost::lexical_cast<std::string>(i + 1);
bool set = dynamic_cast<cLed&>(pcInfo[id]).getState() != led_off;
if(mode == 0) univ.party[pc_num].mage_spells[i] = set;
else if(mode == 1) univ.party[pc_num].priest_spells[i] = set;
}
}
}
static void display_traits_graphics(cDialog& me) {

View File

@@ -767,14 +767,11 @@ void display_party() {
default:
break;
}
dest_rect.top -= style.lineHeight;
win_draw_string(mainPtr,dest_rect,"Edit",eTextMode::CENTRE,style);
if(i < 2) {
dest_rect.top -= style.lineHeight;
win_draw_string(mainPtr,dest_rect,"Add",eTextMode::CENTRE,style);
dest_rect.top += style.lineHeight * 2;
win_draw_string(mainPtr,dest_rect,"Spells",eTextMode::CENTRE,style);
} else {
dest_rect.top -= style.lineHeight;
win_draw_string(mainPtr,dest_rect,"Edit",eTextMode::CENTRE,style);
}
}
style.colour = sf::Color::Black;