author | mark <mark> | 2002-05-05 12:39:27 (UTC) |
---|---|---|
committer | mark <mark> | 2002-05-05 12:39:27 (UTC) |
commit | 4941bb530e6bd0992136b95b4e24af7b7ddc8fdd (patch) (unidiff) | |
tree | af604b49a54e1246858758be9d6dea33940810cb | |
parent | a59ee560e5a170d124838c4e2ce7e6af0102aa2e (diff) | |
download | opie-4941bb530e6bd0992136b95b4e24af7b7ddc8fdd.zip opie-4941bb530e6bd0992136b95b4e24af7b7ddc8fdd.tar.gz opie-4941bb530e6bd0992136b95b4e24af7b7ddc8fdd.tar.bz2 |
Nicer help information
-rw-r--r-- | noncore/games/kbill/Strings.h | 42 | ||||
-rw-r--r-- | noncore/games/kbill/kbill.cpp | 28 | ||||
-rw-r--r-- | noncore/games/kbill/kbill.pro | 3 |
3 files changed, 23 insertions, 50 deletions
diff --git a/noncore/games/kbill/Strings.h b/noncore/games/kbill/Strings.h index 45509d1..ffd830e 100644 --- a/noncore/games/kbill/Strings.h +++ b/noncore/games/kbill/Strings.h | |||
@@ -1,58 +1,16 @@ | |||
1 | #ifndef STRINGS_H | 1 | #ifndef STRINGS_H |
2 | #define STRINGS_H | 2 | #define STRINGS_H |
3 | 3 | ||
4 | #define storystr \ | ||
5 | " The Story:\n\ | ||
6 | \n\ | ||
7 | Yet again, the fate of the world rests\n\ | ||
8 | in your hands! An evil computer hacker,\n\ | ||
9 | known only by his handle 'Bill', has\n\ | ||
10 | created the ultimate computer virus. A\n\ | ||
11 | virus so powerful that it has the power\n\ | ||
12 | to transmute an ordinary computer into\n\ | ||
13 | a toaster oven. (oooh!) 'Bill' has\n\ | ||
14 | cloned himself into a billion-jillion\n\ | ||
15 | micro-Bills. Their sole purpose is to\n\ | ||
16 | deliver the nefarious virus, which has\n\ | ||
17 | been cleverly diguised as a popular\n\ | ||
18 | operating system.\n\ | ||
19 | \n\ | ||
20 | As System Administrator/Exterminator,\n\ | ||
21 | your job is to keep Bill from succeeding\n\ | ||
22 | at his task." | ||
23 | |||
24 | #define rulesstr \ | ||
25 | " The Rules:\n\ | ||
26 | \n\ | ||
27 | kBill has been painstakingly designed and\n\ | ||
28 | researched in order to make it as easy to use\n\ | ||
29 | for the whole family as it is for little Sally.\n\ | ||
30 | Years - nay - days of beta testing and \n\ | ||
31 | consulting with the cheapest of human interface\n\ | ||
32 | designers have resulted in a game that is easy\n\ | ||
33 | to use, yet nothing at all like a Macintosh.\n\ | ||
34 | \n\ | ||
35 | I. Whack the Bills (click)\n\ | ||
36 | II. Restart the computer (click)\n\ | ||
37 | III. Pick up stolen OSes & return(drag)\n\ | ||
38 | them to their respective computers\n\ | ||
39 | IV. Drag the bucket to extinguish sparks\n\ | ||
40 | V. Scoring is based on total uptime,\n\ | ||
41 | with bonuses for killing Bills.\n\ | ||
42 | \n\ | ||
43 | As for the rest, you can probably figure\n\ | ||
44 | it out. We did, so it can't be too hard." | ||
45 | |||
46 | #define endgamestr \ | 4 | #define endgamestr \ |
47 | "Module kBill has caused a\n\ | 5 | "Module kBill has caused a\n\ |
48 | segmentation fault at memory\n\ | 6 | segmentation fault at memory\n\ |
49 | address 097E:F1A0. Core dumped.\n\ | 7 | address 097E:F1A0. Core dumped.\n\ |
50 | We apologize for the inconvenience." | 8 | We apologize for the inconvenience." |
51 | 9 | ||
52 | #define warpstr "Warp to level?" | 10 | #define warpstr "Warp to level?" |
53 | #define quitstr "Quit Game?" | 11 | #define quitstr "Quit Game?" |
54 | #define newgamestr "New Game?" | 12 | #define newgamestr "New Game?" |
55 | #define pausestr "Game paused.\n Press OK to continue." | 13 | #define pausestr "Game paused.\n Press OK to continue." |
56 | #define enternamestr "You earned a high score.\nEnter your name:" | 14 | #define enternamestr "You earned a high score.\nEnter your name:" |
57 | 15 | ||
58 | #endif | 16 | #endif |
diff --git a/noncore/games/kbill/kbill.cpp b/noncore/games/kbill/kbill.cpp index 568df95..9fcfd5d 100644 --- a/noncore/games/kbill/kbill.cpp +++ b/noncore/games/kbill/kbill.cpp | |||
@@ -1,66 +1,70 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | kbill.cpp - description | 2 | kbill.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Thu Dec 30 16:55:55 CET 1999 | 4 | begin : Thu Dec 30 16:55:55 CET 1999 |
5 | copyright : (C) 1999 by Jurrien Loonstra | 5 | copyright : (C) 1999 by Jurrien Loonstra |
6 | email : j.h.loonstra@st.hanze.nl | 6 | email : j.h.loonstra@st.hanze.nl |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #include <qmessagebox.h> | 18 | #include <qmessagebox.h> |
19 | #include <qmultilinedit.h> | ||
19 | #include <qmenubar.h> | 20 | #include <qmenubar.h> |
21 | #include <qtextbrowser.h> | ||
22 | #include <qfont.h> | ||
23 | #include <qwidget.h> | ||
20 | #include "kbill.h" | 24 | #include "kbill.h" |
21 | #include "inputbox.h" | 25 | #include "inputbox.h" |
22 | 26 | #include "helpdialog.h" | |
23 | #include "objects.h" | 27 | #include "objects.h" |
24 | #include "Strings.h" | 28 | #include "Strings.h" |
25 | 29 | ||
26 | KBill::KBill() : QMainWindow() { | 30 | KBill::KBill() : QMainWindow() { |
27 | setCaption("kBill"); | 31 | setCaption("kBill"); |
28 | file = new QPopupMenu(); | 32 | file = new QPopupMenu(); |
29 | file->insertItem(("New game"), this, SLOT(NewGame())); | 33 | file->insertItem(("New game"), this, SLOT(NewGame())); |
30 | pauseid = file->insertItem(("Pause game"), this, SLOT(Pause())); | 34 | pauseid = file->insertItem(("Pause game"), this, SLOT(Pause())); |
31 | //these are dissabled until I fix them | 35 | //these are dissabled until I fix them |
32 | //file->insertItem(("Warp to level..."), this, SLOT(WarpTo())); | 36 | //file->insertItem(("Warp to level..."), this, SLOT(WarpTo())); |
33 | //file->insertItem(("View high scores"), this, SLOT(ViewHighScores())); | 37 | //file->insertItem(("View high scores"), this, SLOT(ViewHighScores())); |
34 | file->insertItem(("Quit game"), this, SLOT(Quit())); | 38 | |
35 | 39 | ||
36 | help = new QPopupMenu(); | 40 | help = new QPopupMenu(); |
37 | help->insertItem(("Story of kBill"), this, SLOT(Story())); | 41 | help->insertItem(("Story of kBill"), this, SLOT(Story())); |
38 | help->insertItem(("Rules"), this, SLOT(Rules())); | 42 | help->insertItem(("Rules"), this, SLOT(Rules())); |
39 | 43 | ||
40 | 44 | ||
41 | menu = new QMenuBar(this); | 45 | menu = new QMenuBar(this); |
42 | menu->insertItem(("&File"), file); | 46 | menu->insertItem(("&File"), file); |
43 | menu->insertSeparator(); | 47 | menu->insertSeparator(); |
44 | menu->insertItem(("&Help"), help); | 48 | menu->insertItem(("&Help"), help); |
45 | 49 | ||
46 | field = new Field(this); | 50 | field = new Field(this); |
47 | //setView(field); | 51 | //setView(field); |
48 | //setMainWidget(field); | 52 | //setMainWidget(field); |
49 | //setMenu(menu); | 53 | //setMenu(menu); |
50 | } | 54 | } |
51 | 55 | ||
52 | KBill::~KBill() { | 56 | KBill::~KBill() { |
53 | } | 57 | } |
54 | 58 | ||
55 | Field* KBill::getField() { | 59 | Field* KBill::getField() { |
56 | return field; | 60 | return field; |
57 | } | 61 | } |
58 | 62 | ||
59 | // ----------------------------------------------------------------------- | 63 | // ----------------------------------------------------------------------- |
60 | 64 | ||
61 | void KBill::Quit() { | 65 | void KBill::Quit() { |
62 | field->stopTimer(); | 66 | field->stopTimer(); |
63 | qApp->quit(); | 67 | qApp->quit(); |
64 | 68 | ||
65 | } | 69 | } |
66 | 70 | ||
@@ -77,42 +81,52 @@ void KBill::NewGame() { | |||
77 | game.start(1); | 81 | game.start(1); |
78 | // else | 82 | // else |
79 | field->startTimer(); | 83 | field->startTimer(); |
80 | } | 84 | } |
81 | 85 | ||
82 | void KBill::Pause() { | 86 | void KBill::Pause() { |
83 | field->stopTimer(); | 87 | field->stopTimer(); |
84 | QMessageBox::message(("Pause Game"), (pausestr), 0); | 88 | QMessageBox::message(("Pause Game"), (pausestr), 0); |
85 | field->startTimer(); | 89 | field->startTimer(); |
86 | } | 90 | } |
87 | 91 | ||
88 | void KBill::WarpTo() { | 92 | void KBill::WarpTo() { |
89 | /* field->stopTimer(); | 93 | /* field->stopTimer(); |
90 | InputBox b(this, 0, "Warp To Level", warpstr); | 94 | InputBox b(this, 0, "Warp To Level", warpstr); |
91 | bool status = b.exec() == 1; | 95 | bool status = b.exec() == 1; |
92 | field->startTimer(); | 96 | field->startTimer(); |
93 | if (status) { | 97 | if (status) { |
94 | bool ok; | 98 | bool ok; |
95 | int level = b.getText().toUInt(&ok); | 99 | int level = b.getText().toUInt(&ok); |
96 | if (ok) { | 100 | if (ok) { |
97 | field->startTimer(); | 101 | field->startTimer(); |
98 | game.warp_to_level(level); | 102 | game.warp_to_level(level); |
99 | return; | 103 | return; |
100 | } | 104 | } |
101 | }*/ | 105 | }*/ |
102 | } | 106 | } |
103 | 107 | ||
104 | void KBill::ViewHighScores() { | 108 | void KBill::ViewHighScores() { |
105 | //ui.popup_dialog(Game::HIGHSCORE); | 109 | //ui.popup_dialog(Game::HIGHSCORE); |
106 | } | 110 | } |
107 | 111 | ||
108 | void KBill::Story() { | 112 | void KBill::Story() { |
109 | field->stopTimer(); | 113 | field->stopTimer(); |
110 | QMessageBox::message( ("Story"), (storystr), 0); | 114 | HelpDialog *stryDialog = new HelpDialog(this,"helpdialog",1); |
111 | field->startTimer(); | 115 | QString stryString = "<b>The Story</b><p>Yet again, the fate of the world rests in your hands! An evil computer hacker, known only by his handle 'Bill', has created the ultimate computer virus. A virus so powerful that it has the power to transmute an ordinary computer into a toaster oven. (oooh!) 'Bill' has cloned himself into a billion-jillion micro-Bills. Their sole purpose is to deliver the nefarious virus, which has been cleverly diguised as a popular operating system. As System Administrator and Exterminator, your job is to keep Bill from succeeding at his task."; |
116 | stryDialog->setCaption("The story of KBill"); | ||
117 | stryDialog->TextBrowser1->setText(stryString); | ||
118 | stryDialog->resize(200,200); | ||
119 | stryDialog->show(); | ||
120 | field->startTimer(); | ||
112 | } | 121 | } |
113 | 122 | ||
114 | void KBill::Rules() { | 123 | void KBill::Rules() { |
115 | field->stopTimer(); | 124 | field->stopTimer(); |
116 | QMessageBox::message(("Rules"), (rulesstr), 0); | 125 | HelpDialog *rulesDialog = new HelpDialog(this,"helpdialog",1); |
117 | field->startTimer(); | 126 | rulesDialog->setCaption("The rules of KBill"); |
127 | QString rulesStr = "<b>The Rules</b><p>kBill has been painstakingly designed and researched in order to make it as easy to use for the whole family as it is for little Sally. Years - nay - days of beta testing and consulting with the cheapest of human interface designers have resulted in a game that is easy to use, yet nothing at all like a Macintosh.<p><UL><LI>Whack the Bills (click)</LI><LI>Restart the computer (click)</LI><LI>Pick up stolen OSes & return (drag) them to their respective computers</LI><LI>Drag the bucket to extinguish sparks</LI><LI>Scoring is based on total uptime, with bonuses for killing Bills.</LI></UL><P>As for the rest, you can probably work it out for yourself. We did, so it can't be too hard"; | ||
128 | rulesDialog->TextBrowser1->setText(rulesStr); | ||
129 | rulesDialog->resize(200,200); | ||
130 | rulesDialog->show(); | ||
131 | field->startTimer(); | ||
118 | } | 132 | } |
diff --git a/noncore/games/kbill/kbill.pro b/noncore/games/kbill/kbill.pro index a0eddf2..22aa98c 100644 --- a/noncore/games/kbill/kbill.pro +++ b/noncore/games/kbill/kbill.pro | |||
@@ -1,13 +1,14 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | HEADERS = kbill.h field.h Bucket.h Cable.h Computer.h Game.h Horde.h \ | 3 | HEADERS = kbill.h field.h Bucket.h Cable.h Computer.h Game.h Horde.h \ |
4 | Library.h MCursor.h Monster.h Network.h Picture.h Spark.h Strings.h \ | 4 | Library.h MCursor.h Monster.h Network.h Picture.h Spark.h Strings.h \ |
5 | UI.h objects.h inputbox.h | 5 | UI.h objects.h inputbox.h |
6 | SOURCES = field.cpp Bucket.cc Cable.cc Computer.cc Game.cc Horde.cc \ | 6 | SOURCES = field.cpp Bucket.cc Cable.cc Computer.cc Game.cc Horde.cc \ |
7 | Library.cc MCursor.cc Monster.cc Network.cc Picture.cc \ | 7 | Library.cc MCursor.cc Monster.cc Network.cc Picture.cc \ |
8 | Spark.cc UI.cpp inputbox.cpp kbill.cpp | 8 | Spark.cc UI.cpp inputbox.cpp kbill.cpp |
9 | INTERFACES = helpdialog.ui | ||
9 | TARGET = kbill | 10 | TARGET = kbill |
10 | INCLUDEPATH+= $(OPIEDIR)/include | 11 | INCLUDEPATH+= $(OPIEDIR)/include |
11 | DEPENDPATH+= $(OPIEDIR)/include | 12 | DEPENDPATH+= $(OPIEDIR)/include |
12 | LIBS += -lqpe | 13 | LIBS += -lqpe |
13 | DESTDIR = $(OPIEDIR)/bin \ No newline at end of file | 14 | DESTDIR = $(OPIEDIR)/bin |