Ticket #8238: helpDialog.4.diff
File helpDialog.4.diff, 9.5 KB (added by , 21 years ago) |
---|
-
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/dialogs.cpp
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v retrieving revision 1.50 diff -u -r1.50 dialogs.cpp
27 27 #include "player_v2.h" 28 28 #include "verbs.h" 29 29 30 #ifndef DISABLE_HELP 31 #include "help.h" 32 #endif 33 30 34 #include "gui/newgui.h" 31 35 #include "gui/ListWidget.h" 32 36 #include "common/config-file.h" … … 79 83 "Map", //24 80 84 "Choose an action to map", //25 81 85 "Press the key to associate", //26 82 "Please select an action" //27 86 "Please select an action", //27 87 "Help" //28 83 88 }; 84 89 85 90 #ifdef __PALM_OS__ … … 220 225 kLoadCmd = 'LOAD', 221 226 kPlayCmd = 'PLAY', 222 227 kOptionsCmd = 'OPTN', 228 kHelpCmd = 'HELP', 223 229 kQuitCmd = 'QUIT' 224 230 }; 225 231 … … 235 241 _loadButton = addPushButton(x, 40, queryResString(5), kLoadCmd, 'L'); 236 242 addButton(x, 60, queryResString(6), kPlayCmd, 'P'); // Play 237 243 addButton(x, 80, queryCustomString(17), kOptionsCmd, 'O'); // Options 244 #ifndef DISABLE_HELP 245 addButton(x, 100, queryCustomString(28), kHelpCmd, 'H'); // Help 246 addButton(x, 120, queryResString(8), kQuitCmd, 'Q'); // Quit 247 248 _helpDialog = new HelpDialog(gui, scumm); 249 #else 238 250 addButton(x, 100, queryResString(8), kQuitCmd, 'Q'); // Quit 251 #endif 239 252 240 253 // The save game list 241 254 _savegameList = new ListWidget(this, 8, 20, x - 14, 134); 242 255 } 243 256 257 SaveLoadDialog::~SaveLoadDialog() { 258 #ifndef DISABLE_HELP 259 delete _helpDialog; 260 #endif 261 } 262 244 263 void SaveLoadDialog::open() { 245 264 switchToLoadMode(); 246 265 … … 297 316 case kOptionsCmd: 298 317 _scumm->optionsDialog(); 299 318 break; 319 case kHelpCmd: 320 _helpDialog->runModal(); 321 break; 300 322 case kQuitCmd: 301 323 #ifdef __PALM_OS__ 302 324 close(); … … 558 580 new StaticTextWidget(this, 10, 64, 240, 16, "Except", kTextAlignCenter); 559 581 new StaticTextWidget(this, 10, 78, 240, 16, "Simon the Sorcerer (c) Adventuresoft", kTextAlignCenter); 560 582 } 583 584 #ifndef DISABLE_HELP 585 586 #pragma mark - 587 588 enum { 589 kNextCmd = 'NEXT', 590 kPrevCmd = 'PREV' 591 }; 592 593 HelpDialog::HelpDialog(NewGui *gui, Scumm *scumm) 594 : ScummDialog(gui, scumm, 15, 10, 290, 184) { 595 596 _page = 1; 597 _gameId = scumm->_gameId; 598 _numPages = ScummHelp::numPages(_gameId); 599 600 _prevButton = addPushButton(10, 160, "Previous", kPrevCmd, 'P'); 601 _nextButton = addPushButton(90, 160, "Next", kNextCmd, 'N'); 602 addButton(210, 160, "Close", kCloseCmd, 'C'); 603 _prevButton->clearFlags(WIDGET_ENABLED); 604 605 _title = new StaticTextWidget(this, 10, 5, 270, 16, "", kTextAlignCenter); 606 for (int i = 0; i < HELP_NUM_LINES; i++) { 607 _key[i] = new StaticTextWidget(this, 10, 20 + (10 * i), 80, 16, "", kTextAlignLeft); 608 _dsc[i] = new StaticTextWidget(this, 90, 20 + (10 * i), 190, 16, "", kTextAlignLeft); 609 } 610 611 displayKeyBindings(); 612 } 613 614 void HelpDialog::displayKeyBindings() { 615 String titleStr, *keyStr, *dscStr; 616 617 ScummHelp::updateStrings(_gameId, _page, titleStr, keyStr, dscStr); 618 619 _title->setLabel(titleStr); 620 for (int i = 0; i < HELP_NUM_LINES; i++) { 621 _key[i]->setLabel(keyStr[i]); 622 _dsc[i]->setLabel(dscStr[i]); 623 } 624 625 delete [] keyStr; 626 delete [] dscStr; 627 } 628 629 void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { 630 switch (cmd) { 631 case kNextCmd: 632 _page++; 633 if (_page >= _numPages) { 634 _nextButton->clearFlags(WIDGET_ENABLED); 635 } 636 if (_page >= 2) { 637 _prevButton->setFlags(WIDGET_ENABLED); 638 } 639 displayKeyBindings(); 640 draw(); 641 break; 642 case kPrevCmd: 643 _page--; 644 if (_page <= _numPages) { 645 _nextButton->setFlags(WIDGET_ENABLED); 646 } 647 if (_page <= 1) { 648 _prevButton->clearFlags(WIDGET_ENABLED); 649 } 650 displayKeyBindings(); 651 draw(); 652 break; 653 default: 654 ScummDialog::handleCommand(sender, cmd, data); 655 } 656 } 657 658 #endif 561 659 562 660 #pragma mark - 563 661 -
scumm/dialogs.h
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v retrieving revision 1.17 diff -u -r1.17 dialogs.h
24 24 #include "common/str.h" 25 25 #include "gui/dialog.h" 26 26 27 #ifndef DISABLE_HELP 28 #include "help.h" 29 #endif 30 27 31 class ListWidget; 28 32 class Scumm; 29 33 … … 50 54 class SaveLoadDialog : public ScummDialog { 51 55 public: 52 56 SaveLoadDialog(NewGui *gui, Scumm *scumm); 57 ~SaveLoadDialog(); 53 58 virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); 54 59 virtual void open(); 55 60 virtual void close(); 56 61 57 62 protected: 58 ListWidget 63 ListWidget *_savegameList; 59 64 60 65 PushButtonWidget *_saveButton; 61 66 PushButtonWidget *_loadButton; 62 67 68 Dialog *_helpDialog; 69 63 70 bool _saveMode; 64 71 65 72 void fillList(); … … 73 80 public: 74 81 AboutDialog(NewGui *gui, Scumm *scumm); 75 82 }; 83 84 #ifndef DISABLE_HELP 85 86 class HelpDialog : public ScummDialog { 87 public: 88 HelpDialog(NewGui *gui, Scumm *scumm); 89 virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); 90 91 protected: 92 typedef ScummVM::String String; 93 94 PushButtonWidget *_nextButton; 95 PushButtonWidget *_prevButton; 96 97 StaticTextWidget *_title; 98 StaticTextWidget *_key[HELP_NUM_LINES]; 99 StaticTextWidget *_dsc[HELP_NUM_LINES]; 100 101 int _page; 102 int _numPages; 103 104 byte _gameId; 105 106 void displayKeyBindings(); 107 }; 108 109 #endif 76 110 77 111 class OptionsDialog : public ScummDialog { 78 112 protected: -
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\ -
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