summaryrefslogtreecommitdiff
authormark <mark>2002-05-05 12:39:27 (UTC)
committer mark <mark>2002-05-05 12:39:27 (UTC)
commit4941bb530e6bd0992136b95b4e24af7b7ddc8fdd (patch) (side-by-side diff)
treeaf604b49a54e1246858758be9d6dea33940810cb
parenta59ee560e5a170d124838c4e2ce7e6af0102aa2e (diff)
downloadopie-4941bb530e6bd0992136b95b4e24af7b7ddc8fdd.zip
opie-4941bb530e6bd0992136b95b4e24af7b7ddc8fdd.tar.gz
opie-4941bb530e6bd0992136b95b4e24af7b7ddc8fdd.tar.bz2
Nicer help information
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kbill/Strings.h42
-rw-r--r--noncore/games/kbill/kbill.cpp28
-rw-r--r--noncore/games/kbill/kbill.pro3
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 @@
#ifndef STRINGS_H
#define STRINGS_H
-#define storystr \
-" The Story:\n\
-\n\
-Yet again, the fate of the world rests\n\
-in your hands! An evil computer hacker,\n\
-known only by his handle 'Bill', has\n\
-created the ultimate computer virus. A\n\
-virus so powerful that it has the power\n\
-to transmute an ordinary computer into\n\
-a toaster oven. (oooh!) 'Bill' has\n\
-cloned himself into a billion-jillion\n\
-micro-Bills. Their sole purpose is to\n\
-deliver the nefarious virus, which has\n\
-been cleverly diguised as a popular\n\
-operating system.\n\
-\n\
-As System Administrator/Exterminator,\n\
-your job is to keep Bill from succeeding\n\
-at his task."
-
-#define rulesstr \
-" The Rules:\n\
-\n\
-kBill has been painstakingly designed and\n\
-researched in order to make it as easy to use\n\
-for the whole family as it is for little Sally.\n\
-Years - nay - days of beta testing and \n\
-consulting with the cheapest of human interface\n\
-designers have resulted in a game that is easy\n\
-to use, yet nothing at all like a Macintosh.\n\
-\n\
-I. Whack the Bills (click)\n\
-II. Restart the computer (click)\n\
-III. Pick up stolen OSes & return(drag)\n\
- them to their respective computers\n\
-IV. Drag the bucket to extinguish sparks\n\
-V. Scoring is based on total uptime,\n\
- with bonuses for killing Bills.\n\
-\n\
-As for the rest, you can probably figure\n\
-it out. We did, so it can't be too hard."
-
#define endgamestr \
"Module kBill has caused a\n\
segmentation fault at memory\n\
address 097E:F1A0. Core dumped.\n\
We apologize for the inconvenience."
#define warpstr "Warp to level?"
#define quitstr "Quit Game?"
#define newgamestr "New Game?"
#define pausestr "Game paused.\n Press OK to continue."
#define enternamestr "You earned a high score.\nEnter your name:"
#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,58 +1,62 @@
/***************************************************************************
kbill.cpp - description
-------------------
begin : Thu Dec 30 16:55:55 CET 1999
copyright : (C) 1999 by Jurrien Loonstra
email : j.h.loonstra@st.hanze.nl
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <qmessagebox.h>
+#include <qmultilinedit.h>
#include <qmenubar.h>
+#include <qtextbrowser.h>
+#include <qfont.h>
+#include <qwidget.h>
#include "kbill.h"
#include "inputbox.h"
-
+#include "helpdialog.h"
#include "objects.h"
#include "Strings.h"
KBill::KBill() : QMainWindow() {
setCaption("kBill");
file = new QPopupMenu();
file->insertItem(("New game"), this, SLOT(NewGame()));
pauseid = file->insertItem(("Pause game"), this, SLOT(Pause()));
//these are dissabled until I fix them
//file->insertItem(("Warp to level..."), this, SLOT(WarpTo()));
//file->insertItem(("View high scores"), this, SLOT(ViewHighScores()));
- file->insertItem(("Quit game"), this, SLOT(Quit()));
+
help = new QPopupMenu();
help->insertItem(("Story of kBill"), this, SLOT(Story()));
help->insertItem(("Rules"), this, SLOT(Rules()));
menu = new QMenuBar(this);
menu->insertItem(("&File"), file);
menu->insertSeparator();
menu->insertItem(("&Help"), help);
field = new Field(this);
//setView(field);
//setMainWidget(field);
//setMenu(menu);
}
KBill::~KBill() {
}
Field* KBill::getField() {
return field;
}
@@ -85,34 +89,44 @@ void KBill::Pause() {
field->startTimer();
}
void KBill::WarpTo() {
/* field->stopTimer();
InputBox b(this, 0, "Warp To Level", warpstr);
bool status = b.exec() == 1;
field->startTimer();
if (status) {
bool ok;
int level = b.getText().toUInt(&ok);
if (ok) {
field->startTimer();
game.warp_to_level(level);
return;
}
}*/
}
void KBill::ViewHighScores() {
//ui.popup_dialog(Game::HIGHSCORE);
}
void KBill::Story() {
- field->stopTimer();
- QMessageBox::message( ("Story"), (storystr), 0);
- field->startTimer();
+ field->stopTimer();
+ HelpDialog *stryDialog = new HelpDialog(this,"helpdialog",1);
+ 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.";
+ stryDialog->setCaption("The story of KBill");
+ stryDialog->TextBrowser1->setText(stryString);
+ stryDialog->resize(200,200);
+ stryDialog->show();
+ field->startTimer();
}
void KBill::Rules() {
field->stopTimer();
- QMessageBox::message(("Rules"), (rulesstr), 0);
- field->startTimer();
+ HelpDialog *rulesDialog = new HelpDialog(this,"helpdialog",1);
+ rulesDialog->setCaption("The rules of KBill");
+ 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";
+ rulesDialog->TextBrowser1->setText(rulesStr);
+ rulesDialog->resize(200,200);
+ rulesDialog->show();
+ field->startTimer();
}
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 @@
TEMPLATE = app
CONFIG = qt warn_on release
HEADERS = kbill.h field.h Bucket.h Cable.h Computer.h Game.h Horde.h \
Library.h MCursor.h Monster.h Network.h Picture.h Spark.h Strings.h \
UI.h objects.h inputbox.h
SOURCES = field.cpp Bucket.cc Cable.cc Computer.cc Game.cc Horde.cc \
Library.cc MCursor.cc Monster.cc Network.cc Picture.cc \
Spark.cc UI.cpp inputbox.cpp kbill.cpp
+INTERFACES = helpdialog.ui
TARGET = kbill
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
-DESTDIR = $(OPIEDIR)/bin \ No newline at end of file
+DESTDIR = $(OPIEDIR)/bin