Ticket #8107: stump.patch
File stump.patch, 3.2 KB (added by , 22 years ago) |
---|
-
dialogs.cpp
diff -Naur scumm/dialogs.cpp scumm/new/dialogs.cpp
old new 642 642 643 643 #pragma mark - 644 644 645 InfoDialog::InfoDialog(NewGui *gui, Scumm *scumm, int res, 646 int x, int y, int w, int h) 647 : ScummDialog(gui, scumm, x, y, w, h) 648 { 649 setInfoText (queryResString (res)); 650 } 651 652 InfoDialog::InfoDialog(NewGui *gui, Scumm *scumm, const String& message, 653 int x, int y, int w, int h) 654 : ScummDialog(gui, scumm, x, y, w, h) 655 { 656 setInfoText (message); 657 } 658 659 void InfoDialog::setInfoText(const String& message) 660 { 661 new StaticTextWidget(this, 4, 4, _w-8, _h, message, kTextAlignCenter); 662 } 663 664 #pragma mark - 665 645 666 PauseDialog::PauseDialog(NewGui *gui, Scumm *scumm) 646 : ScummDialog(gui, scumm, 35, 80, 250, 16) 667 : InfoDialog(gui, scumm, 10, 35, 80, 250, 16) 668 //: InfoDialog(gui, scumm, queryResString (10), 35, 80, 250, 16) 647 669 { 648 addResText(4, 4, 250-8, 16, 10); 670 // cannot call queryResString from the initializer list, since _scumm 671 // is not initialized yet.. 649 672 } 650 673 651 674 #ifdef _WIN32_WCE -
dialogs.h
diff -Naur scumm/dialogs.h scumm/new/dialogs.h
old new 109 109 CheckboxWidget *amigaPalCheckbox; 110 110 }; 111 111 112 class PauseDialog : public ScummDialog {112 class InfoDialog : public ScummDialog { 113 113 public: 114 PauseDialog(NewGui *gui, Scumm *scumm); 114 // arbitrary message 115 InfoDialog(NewGui *gui, Scumm *scumm, const String& message, int x, int y, 116 int w, int h); 117 // from resources 118 InfoDialog(NewGui *gui, Scumm *scumm, int res, int x, int y, int w, int h); 115 119 116 120 virtual void handleMouseDown(int x, int y, int button, int clickCount) 117 121 { close(); } … … 122 126 else 123 127 ScummDialog::handleKeyDown(key, modifiers); 124 128 } 129 protected: 130 void setInfoText (const String& message); 131 }; 132 133 class PauseDialog : public InfoDialog { 134 public: 135 PauseDialog(NewGui *gui, Scumm *scumm); 125 136 }; 126 137 127 138 #ifdef _WIN32_WCE -
string.cpp
diff -Naur scumm/string.cpp scumm/new/string.cpp
old new 23 23 #include "stdafx.h" 24 24 #include "scumm.h" 25 25 #include "actor.h" 26 #include "dialogs.h" 26 27 #include "scumm/sound.h" 27 28 28 29 int CharsetRenderer::getStringWidth(int arg, byte *text, int pos) … … 170 171 if (_string[3].color == 0) 171 172 _string[3].color = 4; 172 173 173 // TODO - it appears the this function should display the given message graphically 174 // to the user in a "dialog" looking like the pause dialog, i.e. a single line. 175 warning("unkMessage2(\"%s\")", buf); 174 // Unfortunately, calculating string width will require including newgui.h 175 // OUCH 176 // Will used fixed width for now... 177 178 //int width = _newgui -> getStringWidth ((char*) buf); 179 //InfoDialog* dialog = new InfoDialog (_newgui, this, (char*) buf, 180 // (_realWidth - (width + 10)) >> 1, 80, width + 10, 16); 181 182 InfoDialog* dialog = new InfoDialog (_newgui, this, (char*) buf, 183 10, 80, 300, 16); 184 runDialog (dialog); 185 delete dialog; 186 176 187 _messagePtr = tmp; 177 188 } 178 189