Fix Show PC Spells dialog and the Alchemy button in PC Info
This commit is contained in:
@@ -21,7 +21,6 @@ extern bool diff_depth_ok;
|
||||
|
||||
short which_pc_displayed,store_pc_trait_mode,store_which_to_edit;
|
||||
extern short current_active_pc;
|
||||
char empty_string[256] = " ";
|
||||
extern rectangle pc_area_buttons[6][4] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
|
||||
extern rectangle item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
|
||||
extern rectangle pc_info_rect;
|
||||
@@ -55,10 +54,10 @@ bool handle_action(sf::Event event) {
|
||||
do_button_action(0,i + 10);
|
||||
switch(i) {
|
||||
case 0:
|
||||
display_pc(current_active_pc,0,NULL);
|
||||
display_pc(current_active_pc,10,NULL);
|
||||
break;
|
||||
case 1:
|
||||
display_pc(current_active_pc,1,NULL);
|
||||
display_pc(current_active_pc,11,NULL);
|
||||
break;
|
||||
case 2:
|
||||
pick_race_abil(&univ.party[current_active_pc],0);
|
||||
|
@@ -6,7 +6,7 @@ bool handle_action(sf::Event event);
|
||||
void flash_rect(rectangle to_flash);
|
||||
void edit_gold_or_food(short which_to_edit);
|
||||
void display_pc(short pc_num,short mode,cDialog* parent);
|
||||
void display_alchemy(bool allowEdit);
|
||||
void display_alchemy(bool allowEdit,cDialog* parent);
|
||||
bool spend_xp(short pc_num, short mode, cDialog* parent);
|
||||
void edit_day();
|
||||
void edit_xp(cPlayer *pc);
|
||||
|
@@ -22,7 +22,7 @@
|
||||
* boe.infodlg.h and boe.party.h.
|
||||
*/
|
||||
void display_pc(short pc_num,short mode,cDialog* parent);
|
||||
void display_alchemy(bool allowEdit);
|
||||
void display_alchemy(bool allowEdit,cDialog* parent);
|
||||
bool spend_xp(short pc_num, short mode, cDialog* parent);
|
||||
// TODO: There's probably a more logical way of arranging this
|
||||
|
||||
@@ -57,8 +57,9 @@ const char* skill_ids[19] = {
|
||||
"trap","lock","assassin","poison","luck"
|
||||
};
|
||||
|
||||
static void put_pc_spells(cDialog& me, const short store_trait_mode) {
|
||||
static void put_pc_spells(cDialog& me, short store_trait_mode) {
|
||||
short i;
|
||||
store_trait_mode %= 10;
|
||||
|
||||
for(i = 0; i < 62; i++) {
|
||||
std::string id = "spell" + boost::lexical_cast<std::string>(i + 1);
|
||||
@@ -113,8 +114,10 @@ void display_pc(short pc_num,short mode, cDialog* parent) {
|
||||
|
||||
for(i = 0; i < 62; i++) {
|
||||
std::string id = "spell" + boost::lexical_cast<std::string>(i + 1);
|
||||
label_str = get_str("magic-names", i + (mode == 0 ? 1 : 101));
|
||||
label_str = get_str("magic-names", i + (mode % 10 == 0 ? 1 : 101));
|
||||
pcInfo[id].setText(label_str);
|
||||
if(mode < 10)
|
||||
pcInfo[id].attachClickHandler(&cLed::noAction);
|
||||
}
|
||||
put_pc_spells(pcInfo, mode);
|
||||
|
||||
@@ -226,12 +229,12 @@ extern const eItemAbil alch_ingred2[20] = {
|
||||
eItemAbil::ASPTONGUE,eItemAbil::EMBERF,eItemAbil::EMBERF,eItemAbil::ASPTONGUE,eItemAbil::EMBERF,
|
||||
};
|
||||
|
||||
void display_alchemy(bool allowEdit) {
|
||||
void display_alchemy(bool allowEdit,cDialog* parent) {
|
||||
short i;
|
||||
|
||||
make_cursor_sword();
|
||||
|
||||
cChoiceDlog showAlch("pc-alchemy-info", {"done"});
|
||||
cChoiceDlog showAlch("pc-alchemy-info", {"done"}, parent);
|
||||
|
||||
for(i = 0; i < 20; i++) {
|
||||
std::string id = "potion" + boost::lexical_cast<std::string>(i + 1);
|
||||
|
@@ -292,10 +292,10 @@ void handle_menu_choice(eMenu item_hit) {
|
||||
univ.town_maps[i][j][k] = 255;
|
||||
break;
|
||||
case eMenu::EDIT_MAGE:
|
||||
display_pc(current_active_pc,0,0);
|
||||
display_pc(current_active_pc,10,0);
|
||||
break;
|
||||
case eMenu::EDIT_PRIEST:
|
||||
display_pc(current_active_pc,1,0);
|
||||
display_pc(current_active_pc,11,0);
|
||||
break;
|
||||
case eMenu::EDIT_TRAITS:
|
||||
pick_race_abil(&univ.party[current_active_pc],0);
|
||||
|
Reference in New Issue
Block a user