00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <qmessagebox.h>
00019 #include <qmenubar.h>
00020 #include <qtextbrowser.h>
00021 #include "kbill.h"
00022 #include "helpdialog.h"
00023 #include "objects.h"
00024 #include "Strings.h"
00025
00026 KBill::KBill() : QMainWindow() {
00027 setCaption(tr("kBill"));
00028 file = new QPopupMenu();
00029 file->insertItem(tr("New game"), this, SLOT(NewGame()));
00030 pauseid = file->insertItem(tr("Pause game"), this, SLOT(Pause()));
00031
00032
00033
00034
00035
00036 help = new QPopupMenu();
00037 help->insertItem(tr("Story of kBill"), this, SLOT(Story()));
00038 help->insertItem(tr("Rules"), this, SLOT(Rules()));
00039
00040
00041 menu = new QMenuBar(this);
00042 menu->insertItem(tr("&File"), file);
00043 menu->insertSeparator();
00044 menu->insertItem(tr("&Help"), help);
00045
00046 field = new Field(this);
00047
00048
00049
00050 }
00051
00052 KBill::~KBill() {
00053 }
00054
00055 Field* KBill::getField() {
00056 return field;
00057 }
00058
00059
00060
00061 void KBill::Quit() {
00062 field->stopTimer();
00063 qApp->quit();
00064
00065 }
00066
00067 void KBill::About(){
00068
00069
00070
00071
00072 }
00073
00074 void KBill::NewGame() {
00075 field->stopTimer();
00076
00077 game.start(1);
00078
00079 field->startTimer();
00080 }
00081
00082 void KBill::Pause() {
00083 field->stopTimer();
00084 QMessageBox::message(tr("Pause Game"), tr(pausestr), 0);
00085 field->startTimer();
00086 }
00087
00088 void KBill::WarpTo() {
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102 }
00103
00104 void KBill::ViewHighScores() {
00105
00106 }
00107
00108 void KBill::Story() {
00109 field->stopTimer();
00110 HelpDialog *stryDialog = new HelpDialog(this,"helpdialog",1);
00111 QString stryString = tr("<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 disguised as a popular operating system. As System Administrator and Exterminator, your job is to keep Bill from succeeding at his task.");
00112 stryDialog->setCaption(tr("The story of KBill"));
00113 stryDialog->TextBrowser1->setText(stryString);
00114 stryDialog->resize(200,200);
00115 stryDialog->show();
00116 field->startTimer();
00117 }
00118
00119 void KBill::Rules() {
00120 field->stopTimer();
00121 HelpDialog *rulesDialog = new HelpDialog(this,"helpdialog",1);
00122 rulesDialog->setCaption(tr("The rules of KBill"));
00123 QString rulesStr = tr("<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");
00124 rulesDialog->TextBrowser1->setText(rulesStr);
00125 rulesDialog->resize(200,200);
00126 rulesDialog->show();
00127 field->startTimer();
00128 }