Ticket #8238: helpDialog.2.diff
File helpDialog.2.diff, 9.5 KB (added by , 21 years ago) |
---|
-
scumm/dialogs.cpp
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v retrieving revision 1.49 diff -u -r1.49 dialogs.cpp
25 25 #include "scumm.h" 26 26 #include "imuse.h" 27 27 #include "verbs.h" 28 #include "help.h" 28 29 29 30 #include "gui/newgui.h" 30 31 #include "gui/ListWidget.h" … … 78 79 "Map", //24 79 80 "Choose an action to map", //25 80 81 "Press the key to associate", //26 81 "Please select an action" //27 82 "Please select an action", //27 83 "Help" //28 82 84 }; 83 85 84 86 #ifdef __PALM_OS__ … … 219 221 kLoadCmd = 'LOAD', 220 222 kPlayCmd = 'PLAY', 221 223 kOptionsCmd = 'OPTN', 222 kQuitCmd = 'QUIT' 224 kQuitCmd = 'QUIT', 225 kHelpCmd = 'HELP', 223 226 }; 224 227 225 228 SaveLoadDialog::SaveLoadDialog(NewGui *gui, Scumm *scumm) … … 234 237 _loadButton = addPushButton(x, 40, queryResString(5), kLoadCmd, 'L'); 235 238 addButton(x, 60, queryResString(6), kPlayCmd, 'P'); // Play 236 239 addButton(x, 80, queryCustomString(17), kOptionsCmd, 'O'); // Options 237 addButton(x, 100, queryResString(8), kQuitCmd, 'Q'); // Quit 240 addButton(x, 100, queryCustomString(28), kHelpCmd, 'H'); // Help 241 addButton(x, 120, queryResString(8), kQuitCmd, 'Q'); // Quit 238 242 239 243 // The save game list 240 244 _savegameList = new ListWidget(this, 8, 20, x - 14, 134); 245 246 _helpDialog = new HelpDialog(gui, scumm); 247 } 248 249 SaveLoadDialog::~SaveLoadDialog() { 250 delete _helpDialog; 241 251 } 242 252 243 253 void SaveLoadDialog::open() { … … 296 306 case kOptionsCmd: 297 307 _scumm->optionsDialog(); 298 308 break; 309 case kHelpCmd: 310 _helpDialog->runModal(); 311 break; 299 312 case kQuitCmd: 300 313 #ifdef __PALM_OS__ 301 314 close(); … … 553 566 new StaticTextWidget(this, 10, 50, 240, 16, "All games (c) LucasArts", kTextAlignCenter); 554 567 new StaticTextWidget(this, 10, 64, 240, 16, "Except", kTextAlignCenter); 555 568 new StaticTextWidget(this, 10, 78, 240, 16, "Simon the Sorcerer (c) Adventuresoft", kTextAlignCenter); 569 } 570 571 #pragma mark - 572 573 enum { 574 kNextCmd = 'NEXT', 575 kPrevCmd = 'PREV' 576 }; 577 578 HelpDialog::HelpDialog(NewGui *gui, Scumm *scumm) 579 : ScummDialog(gui, scumm, 20, 10, 280, 184) { 580 581 _page = 1; 582 _gameId = scumm->_gameId; 583 _numPages = ScummHelp::numPages(_gameId); 584 585 _prevButton = addPushButton(10, 160, "Previous", kPrevCmd, 'P'); 586 _nextButton = addPushButton(90, 160, "Next", kNextCmd, 'N'); 587 addButton(200, 160, "Close", kCloseCmd, 'C'); 588 _prevButton->clearFlags(WIDGET_ENABLED); 589 590 _title = new StaticTextWidget(this, 10, 5, 260, 16, "", kTextAlignCenter); 591 for (int i = 0; i < HELP_NUM_LINES; i++) { 592 _key[i] = new StaticTextWidget(this, 10, 20 + (10 * i), 70, 16, "", kTextAlignLeft); 593 _dsc[i] = new StaticTextWidget(this, 80, 20 + (10 * i), 190, 16, "", kTextAlignLeft); 594 } 595 596 displayKeyBindings(); 597 } 598 599 void HelpDialog::displayKeyBindings() { 600 String titleStr, *keyStr, *dscStr; 601 602 ScummHelp::updateStrings(_gameId, _page, titleStr, keyStr, dscStr); 603 604 _title->setLabel(titleStr); 605 for (int i = 0; i < HELP_NUM_LINES; i++) { 606 _key[i]->setLabel(keyStr[i]); 607 _dsc[i]->setLabel(dscStr[i]); 608 } 609 610 delete [] keyStr; 611 delete [] dscStr; 612 } 613 614 void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { 615 switch (cmd) { 616 case kNextCmd: 617 _page++; 618 if (_page >= _numPages) { 619 _nextButton->clearFlags(WIDGET_ENABLED); 620 } 621 if (_page >= 2) { 622 _prevButton->setFlags(WIDGET_ENABLED); 623 } 624 displayKeyBindings(); 625 draw(); 626 break; 627 case kPrevCmd: 628 _page--; 629 if (_page <= _numPages) { 630 _nextButton->setFlags(WIDGET_ENABLED); 631 } 632 if (_page <= 1) { 633 _prevButton->clearFlags(WIDGET_ENABLED); 634 } 635 displayKeyBindings(); 636 draw(); 637 break; 638 default: 639 ScummDialog::handleCommand(sender, cmd, data); 640 } 556 641 } 557 642 558 643 #pragma mark - -
scumm/dialogs.h
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v retrieving revision 1.17 diff -u -r1.17 dialogs.h
23 23 24 24 #include "common/str.h" 25 25 #include "gui/dialog.h" 26 #include "help.h" 26 27 27 28 class ListWidget; 28 29 class Scumm; … … 37 38 38 39 Scumm *_scumm; 39 40 41 Dialog *_helpDialog; 42 40 43 void addResText(int x, int y, int w, int h, int resID); 41 44 42 45 // Query a string from the resources … … 50 53 class SaveLoadDialog : public ScummDialog { 51 54 public: 52 55 SaveLoadDialog(NewGui *gui, Scumm *scumm); 56 ~SaveLoadDialog(); 53 57 virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); 54 58 virtual void open(); 55 59 virtual void close(); 56 60 57 61 protected: 58 ListWidget 62 ListWidget *_savegameList; 59 63 60 64 PushButtonWidget *_saveButton; 61 65 PushButtonWidget *_loadButton; … … 72 76 class AboutDialog : public ScummDialog { 73 77 public: 74 78 AboutDialog(NewGui *gui, Scumm *scumm); 79 }; 80 81 class HelpDialog : public ScummDialog { 82 public: 83 HelpDialog(NewGui *gui, Scumm *scumm); 84 virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); 85 86 protected: 87 typedef ScummVM::String String; 88 89 PushButtonWidget *_nextButton; 90 PushButtonWidget *_prevButton; 91 92 StaticTextWidget *_title; 93 StaticTextWidget *_key[HELP_NUM_LINES]; 94 StaticTextWidget *_dsc[HELP_NUM_LINES]; 95 96 int _page; 97 int _numPages; 98 99 byte _gameId; 100 101 void displayKeyBindings(); 75 102 }; 76 103 77 104 class OptionsDialog : public ScummDialog { -
scumm/module.mk
RCS file: /cvsroot/scummvm/scummvm/scumm/module.mk,v retrieving revision 1.18 diff -u -r1.18 module.mk
17 17 scumm/imuse_digi.o \ 18 18 scumm/imuse_player.o \ 19 19 scumm/instrument.o \ 20 scumm/help.o \ 20 21 scumm/nut_renderer.o \ 21 22 scumm/object.o \ 22 23 scumm/player_v2.o\ -
gui/newgui.cpp
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.cpp,v retrieving revision 1.46 diff -u -r1.46 newgui.cpp
55 55 // Built-in font 56 56 static byte guifont[] = { 57 57 0,0,99,1,226,8,4,8,6,8,6,0,0,0,0,0,0,0,0,0,0,0,8,2,1,8,0,0,0,0,0,0,0,0,0,0,0,0,4,3,7,8,7,7,8,4,5,5,8,7,4,7,3,8,7,7,7,7,8,7,7,7,7,7,3,4,7,5,7,7,8,7,7,7,7,7,7,7,7,5,7,7, 58 7,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,8,5,8,8,7,7,7,6,7,7,7,7,7,5,6,7,5,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,3,5, 0,8,7,7,7,7,7,7,0,6,7,7,7,5,5,5,7,0,6,8,8,7,7,7,7,7,0,7,7,0,0,58 7,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,8,5,8,8,7,7,7,6,7,7,7,7,7,5,6,7,5,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,3,5,7,8,7,7,7,7,7,7,0,6,7,7,7,5,5,5,7,0,6,8,8,7,7,7,7,7,0,7,7,0,0, 59 59 0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,1,3,6,12, 60 60 24,62,3,0,128,192,96,48,24,124,192,0,0,3,62,24,12,6,3,1,0,192,124,24,48,96,192,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 61 61 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,237,74,72,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,60,66,153,161,161,153,66,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0, … … 69 69 96,192,0,120,24,24,24,24,24,120,0,0,0,0,0,0,219,219,0,0,0,0,0,0,0,0,255,102,102,102,0,0,0,0,0,0,0,60,6,62,102,62,0,0,96,96,124,102,102,124,0,0,0,60,96,96,96,60,0,0,6,6,62,102,102,62,0,0,0,60,102,126,96,60,0,0,14,24,62,24,24, 70 70 24,0,0,0,62,102,102,62,6,124,0,96,96,124,102,102,102,0,0,48,0,112,48,48,120,0,0,12,0,12,12,12,12,120,0,96,96,108,120,108,102,0,0,112,48,48,48,48,120,0,0,0,102,127,127,107,99,0,0,0,124,102,102,102,102,0,0,0,60,102,102,102,60,0,0,0,124,102,102,124,96, 71 71 96,0,0,62,102,102,62,6,6,0,0,124,102,96,96,96,0,0,0,62,96,60,6,124,0,0,24,126,24,24,24,14,0,0,0,102,102,102,102,62,0,0,0,102,102,102,60,24,0,0,0,99,107,127,62,54,0,0,0,102,60,24,60,102,0,0,0,102,102,102,62,12,120,0,0,126,12,24,48,126,0, 72 24,48,48,96,48,48,24,0,96,96,96,0,96,96,96,0,96,48,48,24,48,48,96,0,0,0, 0,0,0,0,0,0,8,12,14,255,255,14,12,8,60,102,96,96,102,60,24,56,102,0,102,102,102,102,62,0,12,24,60,102,126,96,60,0,24,36,60,6,62,102,62,0,102,0,60,6,62,102,62,0,48,72 24,48,48,96,48,48,24,0,96,96,96,0,96,96,96,0,96,48,48,24,48,48,96,0,0,0,97,153,134,0,0,0,8,12,14,255,255,14,12,8,60,102,96,96,102,60,24,56,102,0,102,102,102,102,62,0,12,24,60,102,126,96,60,0,24,36,60,6,62,102,62,0,102,0,60,6,62,102,62,0,48, 73 73 24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,60,96,96,96,60,24,56,24,36,60,102,126,96,60,0,102,0,60,102,126,96,60,0,48,24,60,102,126,96,60,0,0,216,0,112,48,48,120,0,48,72,0,112,48,48,120,0,96,48,0,112,48,48,120,0,102,24,60,102,126,102,102,0,0,0, 74 74 0,0,0,0,0,0,24,48,124,96,120,96,124,0,0,0,108,26,126,216,110,0,30,40,40,126,72,136,142,0,24,36,60,102,102,102,60,0,102,0,60,102,102,102,60,0,48,24,60,102,102,102,60,0,24,36,0,102,102,102,62,0,48,24,102,102,102,102,62,0,0,0,0,0,0,0,0,0,102,60,102, 75 75 102,102,102,60,0,102,0,102,102,102,102,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -
scumm.dsp
RCS file: /cvsroot/scummvm/scummvm/scumm.dsp,v retrieving revision 1.41 diff -u -r1.41 scumm.dsp
299 299 # End Source File 300 300 # Begin Source File 301 301 302 SOURCE=.\scumm\help.cpp 303 # End Source File 304 # Begin Source File 305 306 SOURCE=.\scumm\help.h 307 # End Source File 308 # Begin Source File 309 302 310 SOURCE=.\scumm\imuse.cpp 303 311 # End Source File 304 312 # Begin Source File