-rw-r--r-- | noncore/games/sfcave/helpwindow.cpp | 77 | ||||
-rw-r--r-- | noncore/games/sfcave/helpwindow.h | 4 | ||||
-rw-r--r-- | noncore/games/sfcave/sfcave.cpp | 7 |
3 files changed, 42 insertions, 46 deletions
diff --git a/noncore/games/sfcave/helpwindow.cpp b/noncore/games/sfcave/helpwindow.cpp index 8a5d034..bd6035a 100644 --- a/noncore/games/sfcave/helpwindow.cpp +++ b/noncore/games/sfcave/helpwindow.cpp | |||
@@ -20,60 +20,57 @@ | |||
20 | 20 | ||
21 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | 22 | ||
23 | #include "helpwindow.h" | 23 | #include "helpwindow.h" |
24 | 24 | ||
25 | 25 | ||
26 | #define HELP_TEXT \ | 26 | static QString HELP_TEXT() { |
27 | "<qt><h1>SFCave Help</h1><p> " \ | 27 | return QObject::tr("<qt><h1>SFCave Help</h1><p> " |
28 | "SFCave is a flying game for the Zaurus.<br><br> " \ | 28 | "SFCave is a flying game for the Zaurus.<br><br> " |
29 | "The aim is to stay alive for as long as possible and get the highest score " \ | 29 | "The aim is to stay alive for as long as possible and get the highest score " |
30 | "you can.<br><br>" \ | 30 | "you can.<br><br>" |
31 | "There are three game types currently - SFCave, Gates, and Fly.<br>" \ | 31 | "There are three game types currently - SFCave, Gates, and Fly.<br>" |
32 | "<b>SFCave</b> is a remake of the classic SFCave game - fly through the " \ | 32 | "<b>SFCave</b> is a remake of the classic SFCave game - fly through the " |
33 | "cavern avoiding all the blocks that just happen to be hanging in " \ | 33 | "cavern avoiding all the blocks that just happen to be hanging in " |
34 | "midair<br><br>" \ | 34 | "midair<br><br>" |
35 | "<b>Gates</b> is similar to SFCave but instead you must fly through the " \ | 35 | "<b>Gates</b> is similar to SFCave but instead you must fly through the " |
36 | "without crashing.<br><br>" \ | 36 | "without crashing.<br><br>" |
37 | "<b>Fly</b> is somewhat different to SFCave and above. Instead, you have " \ | 37 | "<b>Fly</b> is somewhat different to SFCave and above. Instead, you have " |
38 | "are flying in the open air above a scrolling landscape, and the aim is to " \ | 38 | "are flying in the open air above a scrolling landscape, and the aim is to " |
39 | "hug the ground - the closer to the land you fly the more points " \ | 39 | "hug the ground - the closer to the land you fly the more points " |
40 | "scored.<br><br><br>" \ | 40 | "scored.<br><br><br>" |
41 | "Basic instruction - Press <b>Up</B> or <b>Down</b> on the circle pad to " \ | 41 | "Basic instruction - Press <b>Up</B> or <b>Down</b> on the circle pad to " |
42 | "start a new game, press the middle of the pad to apply thrust (makes you " \ | 42 | "start a new game, press the middle of the pad to apply thrust (makes you " |
43 | "go up), and release the pad to remove thrust and drop down.<br><br>" \ | 43 | "go up), and release the pad to remove thrust and drop down.<br><br>" |
44 | "Also, if playing the Fly game, you can press z to toggle the display " \ | 44 | "Also, if playing the Fly game, you can press z to toggle the display " |
45 | "of the scoring zones. This will display 4 red lines at varying heights " \ | 45 | "of the scoring zones. This will display 4 red lines at varying heights " |
46 | "above the landscape - if your ship falls into this zone, point are scored. " \ | 46 | "above the landscape - if your ship falls into this zone, point are scored. " |
47 | "The closer to the landscape you get the more points you get.<br><br>" \ | 47 | "The closer to the landscape you get the more points you get.<br><br>" |
48 | "In addition, SFCave has replays - save and load too so you can show off to all " \ | 48 | "In addition, SFCave has replays - save and load too so you can show off to all " |
49 | "your friends (or vice versa). Currently, this is in its infancy but will improve.<br>" \ | 49 | "your friends (or vice versa). Currently, this is in its infancy but will improve.<br>" |
50 | "To use, once you have crashed, press 'r' to replay the last game.<br>" \ | 50 | "To use, once you have crashed, press 'r' to replay the last game.<br>" |
51 | "To save the replay press 's'.<br>" \ | 51 | "To save the replay press 's'.<br>" |
52 | "To load a saved replay press 'l' (after you've crashed at least once).<br><br>" \ | 52 | "To load a saved replay press 'l' (after you've crashed at least once).<br><br>" |
53 | "Replays are currently saved to your home directory in a file called sfcave.replay." \ | 53 | "Replays are currently saved to your home directory in a file called sfcave.replay." |
54 | "This file can be copied and given to others as long as it it put in their home directory.<br><br>" \ | 54 | "This file can be copied and given to others as long as it it put in their home directory.<br><br>" |
55 | "Have lots of fun.<br>" \ | 55 | "Have lots of fun.<br>" |
56 | "Andy" \ | 56 | "Andy" |
57 | "</p></qt>" | 57 | "</p></qt>"); |
58 | } | ||
58 | 59 | ||
59 | 60 | ||
60 | HelpWindow::HelpWindow( QWidget *parent, const char *name, bool modal, WFlags flags ) | 61 | HelpWindow::HelpWindow( QWidget *parent, const char *name) |
61 | : QDialog( parent, name, modal, flags ) | 62 | : QWidget( parent, name, WDestructiveClose ) |
62 | { | 63 | { |
63 | // resize( 230, 280 ); | 64 | setCaption( tr("Help for SFCave") ); |
64 | |||
65 | setCaption( "Help for SFCave" ); | ||
66 | 65 | ||
67 | QVBoxLayout *layout = new QVBoxLayout( this ); | 66 | QVBoxLayout *layout = new QVBoxLayout( this ); |
68 | QString text = HELP_TEXT;; | 67 | QString text = HELP_TEXT();; |
69 | QTextView *view = new QTextView( text, 0, this, "view" ); | 68 | QTextView *view = new QTextView( text, 0, this, "view" ); |
70 | layout->insertSpacing( -1, 5 ); | 69 | layout->insertSpacing( -1, 5 ); |
71 | layout->insertWidget( -1, view ); | 70 | layout->insertWidget( -1, view ); |
72 | layout->insertSpacing( -1, 5 ); | 71 | layout->insertSpacing( -1, 5 ); |
73 | |||
74 | QPEApplication::showDialog( this ); | ||
75 | } | 72 | } |
76 | 73 | ||
77 | HelpWindow::~HelpWindow() | 74 | HelpWindow::~HelpWindow() |
78 | { | 75 | { |
79 | } | 76 | } |
diff --git a/noncore/games/sfcave/helpwindow.h b/noncore/games/sfcave/helpwindow.h index edc1b6e..0aaba7e 100644 --- a/noncore/games/sfcave/helpwindow.h +++ b/noncore/games/sfcave/helpwindow.h | |||
@@ -21,14 +21,14 @@ | |||
21 | #include <qdialog.h> | 21 | #include <qdialog.h> |
22 | 22 | ||
23 | /** | 23 | /** |
24 | *@author Andy Qua | 24 | *@author Andy Qua |
25 | */ | 25 | */ |
26 | 26 | ||
27 | class HelpWindow : public QDialog | 27 | class HelpWindow : public QWidget |
28 | { | 28 | { |
29 | public: | 29 | public: |
30 | HelpWindow( QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags flags = 0 ); | 30 | HelpWindow( QWidget *parent = 0, const char *name = 0); |
31 | ~HelpWindow(); | 31 | ~HelpWindow(); |
32 | }; | 32 | }; |
33 | 33 | ||
34 | #endif | 34 | #endif |
diff --git a/noncore/games/sfcave/sfcave.cpp b/noncore/games/sfcave/sfcave.cpp index d5aa38a..a6c92a0 100644 --- a/noncore/games/sfcave/sfcave.cpp +++ b/noncore/games/sfcave/sfcave.cpp | |||
@@ -1,16 +1,16 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <math.h> | 3 | #include <math.h> |
4 | #include <time.h> | 4 | #include <time.h> |
5 | 5 | ||
6 | #include <opie2/oapplicationfactory.h> | 6 | #include <opie2/oapplicationfactory.h> |
7 | #include <qpe/qpeapplication.h> | ||
7 | #include <qpe/config.h> | 8 | #include <qpe/config.h> |
8 | #include <qpe/global.h> | 9 | #include <qpe/global.h> |
9 | 10 | ||
10 | #include <qapplication.h> | ||
11 | #include <qdir.h> | 11 | #include <qdir.h> |
12 | 12 | ||
13 | #include "helpwindow.h" | 13 | #include "helpwindow.h" |
14 | #include "sfcave.h" | 14 | #include "sfcave.h" |
15 | 15 | ||
16 | #define CAPTION "SFCave 1.13 by AndyQ" | 16 | #define CAPTION "SFCave 1.13 by AndyQ" |
@@ -1136,15 +1136,14 @@ void SFCave :: dealWithMenuSelection() | |||
1136 | currentMenuOption[currentMenuNr] = 0; | 1136 | currentMenuOption[currentMenuNr] = 0; |
1137 | break; | 1137 | break; |
1138 | 1138 | ||
1139 | case MENU_HELP: | 1139 | case MENU_HELP: |
1140 | { | 1140 | { |
1141 | // Display Help Menu | 1141 | // Display Help Menu |
1142 | HelpWindow *dlg = new HelpWindow( this ); | 1142 | HelpWindow *win = new HelpWindow( ); |
1143 | dlg->exec(); | 1143 | QPEApplication::showWidget( win ); |
1144 | delete dlg; | ||
1145 | break; | 1144 | break; |
1146 | } | 1145 | } |
1147 | 1146 | ||
1148 | case MENU_QUIT: | 1147 | case MENU_QUIT: |
1149 | QApplication::exit(); | 1148 | QApplication::exit(); |
1150 | break; | 1149 | break; |