@@ -81,9 +81,9 @@ short File_gump_object::btn_cols[3] = {94, 163, 232};
8181short File_gump_object::textx = 237, File_gump_object::texty = 14,
8282 File_gump_object::texth = 13;
8383
84- short Yesno_gump_object::yesx = 10; //++++++Guessing.
84+ short Yesno_gump_object::yesx = 63;
8585short Yesno_gump_object::yesnoy = 44;
86- short Yesno_gump_object::nox = 30; //++++++Guessing.
86+ short Yesno_gump_object::nox = 84;
8787
8888
8989/*
@@ -566,7 +566,7 @@ void Gump_object::initialize
566566 checkx = 8; checky = 70;
567567 break;
568568 case YESNOBOX:
569- object_area = Rectangle(4, 4, 40, 40); //++++++Guessing.
569+ object_area = Rectangle(8, 8, 112, 24);
570570 // No checkmark.
571571 break;
572572 default:
@@ -1574,6 +1574,7 @@ void File_gump_object::load
15741574 return;
15751575 Game_window *gwin = Game_window::get_game_window();
15761576 gwin->restore_gamedat(num); // Aborts if unsuccessful.
1577+ gwin->read(); // And read the files in.
15771578 done = 1;
15781579 restored = 1;
15791580 }
@@ -1597,7 +1598,8 @@ void File_gump_object::save
15971598 if (!Yesno_gump_object::ask(
15981599 "Okay to overwrite existing saved game?"))
15991600 return;
1600- if (gwin->save_gamedat(num, focus->get_text()))
1601+ if (gwin->write() && // First flush to 'gamedat'.
1602+ gwin->save_gamedat(num, focus->get_text()))
16011603 cout << "Saved game #" << num << " successfully.\n";
16021604 }
16031605
@@ -1766,12 +1768,12 @@ void File_gump_object::key_down
17661768 focus->set_cursor(focus->get_length());
17671769 return;
17681770 }
1771+ if (chr < ' ')
1772+ return; // Ignore other special chars.
17691773 if (isascii(chr))
17701774 {
17711775 int old_length = focus->get_length();
17721776 focus->insert(chr);
1773- delete buttons[0]; // Can't load now.
1774- buttons[0] = 0;
17751777 // Added first character? Need
17761778 // 'Save' button.
17771779 if (!old_length && focus->get_length() && !buttons[1])
@@ -1781,6 +1783,12 @@ void File_gump_object::key_down
17811783 paint_button(Game_window::get_game_window(),
17821784 buttons[1]);
17831785 }
1786+ if (buttons[0]) // Can't load now.
1787+ {
1788+ delete buttons[0];
1789+ buttons[0] = 0;
1790+ paint(Game_window::get_game_window());
1791+ }
17841792 }
17851793 }
17861794
@@ -1824,6 +1832,9 @@ void Yesno_gump_object::paint
18241832 // Paint buttons.
18251833 paint_button(gwin, yes_button);
18261834 paint_button(gwin, no_button);
1835+ // Paint text.
1836+ gwin->paint_text_box(2, text, x + object_area.x, y + object_area.y,
1837+ object_area.w, object_area.h, 2);
18271838 }
18281839
18291840/*
0 commit comments