Diffstat (limited to 'noncore/games/kbill/kbill.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/kbill/kbill.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/noncore/games/kbill/kbill.cpp b/noncore/games/kbill/kbill.cpp index 9fcfd5d..afeaeb5 100644 --- a/noncore/games/kbill/kbill.cpp +++ b/noncore/games/kbill/kbill.cpp | |||
@@ -1,132 +1,132 @@ | |||
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 <qmultilinedit.h> |
20 | #include <qmenubar.h> | 20 | #include <qmenubar.h> |
21 | #include <qtextbrowser.h> | 21 | #include <qtextbrowser.h> |
22 | #include <qfont.h> | 22 | #include <qfont.h> |
23 | #include <qwidget.h> | 23 | #include <qwidget.h> |
24 | #include "kbill.h" | 24 | #include "kbill.h" |
25 | #include "inputbox.h" | 25 | #include "inputbox.h" |
26 | #include "helpdialog.h" | 26 | #include "helpdialog.h" |
27 | #include "objects.h" | 27 | #include "objects.h" |
28 | #include "Strings.h" | 28 | #include "Strings.h" |
29 | 29 | ||
30 | KBill::KBill() : QMainWindow() { | 30 | KBill::KBill() : QMainWindow() { |
31 | setCaption("kBill"); | 31 | setCaption(tr("kBill")); |
32 | file = new QPopupMenu(); | 32 | file = new QPopupMenu(); |
33 | file->insertItem(("New game"), this, SLOT(NewGame())); | 33 | file->insertItem(tr("New game"), this, SLOT(NewGame())); |
34 | pauseid = file->insertItem(("Pause game"), this, SLOT(Pause())); | 34 | pauseid = file->insertItem(tr("Pause game"), this, SLOT(Pause())); |
35 | //these are dissabled until I fix them | 35 | //these are dissabled until I fix them |
36 | //file->insertItem(("Warp to level..."), this, SLOT(WarpTo())); | 36 | //file->insertItem(tr("Warp to level..."), this, SLOT(WarpTo())); |
37 | //file->insertItem(("View high scores"), this, SLOT(ViewHighScores())); | 37 | //file->insertItem(tr("View high scores"), this, SLOT(ViewHighScores())); |
38 | 38 | ||
39 | 39 | ||
40 | help = new QPopupMenu(); | 40 | help = new QPopupMenu(); |
41 | help->insertItem(("Story of kBill"), this, SLOT(Story())); | 41 | help->insertItem(tr("Story of kBill"), this, SLOT(Story())); |
42 | help->insertItem(("Rules"), this, SLOT(Rules())); | 42 | help->insertItem(tr("Rules"), this, SLOT(Rules())); |
43 | 43 | ||
44 | 44 | ||
45 | menu = new QMenuBar(this); | 45 | menu = new QMenuBar(this); |
46 | menu->insertItem(("&File"), file); | 46 | menu->insertItem(tr("&File"), file); |
47 | menu->insertSeparator(); | 47 | menu->insertSeparator(); |
48 | menu->insertItem(("&Help"), help); | 48 | menu->insertItem(tr("&Help"), help); |
49 | 49 | ||
50 | field = new Field(this); | 50 | field = new Field(this); |
51 | //setView(field); | 51 | //setView(field); |
52 | //setMainWidget(field); | 52 | //setMainWidget(field); |
53 | //setMenu(menu); | 53 | //setMenu(menu); |
54 | } | 54 | } |
55 | 55 | ||
56 | KBill::~KBill() { | 56 | KBill::~KBill() { |
57 | } | 57 | } |
58 | 58 | ||
59 | Field* KBill::getField() { | 59 | Field* KBill::getField() { |
60 | return field; | 60 | return field; |
61 | } | 61 | } |
62 | 62 | ||
63 | // ----------------------------------------------------------------------- | 63 | // ----------------------------------------------------------------------- |
64 | 64 | ||
65 | void KBill::Quit() { | 65 | void KBill::Quit() { |
66 | field->stopTimer(); | 66 | field->stopTimer(); |
67 | qApp->quit(); | 67 | qApp->quit(); |
68 | 68 | ||
69 | } | 69 | } |
70 | 70 | ||
71 | void KBill::About(){ | 71 | void KBill::About(){ |
72 | // field->stopTimer(); | 72 | // field->stopTimer(); |
73 | // AboutBox about(this); | 73 | // AboutBox about(this); |
74 | // about.exec(); | 74 | // about.exec(); |
75 | // field->startTimer(); | 75 | // field->startTimer(); |
76 | } | 76 | } |
77 | 77 | ||
78 | void KBill::NewGame() { | 78 | void KBill::NewGame() { |
79 | field->stopTimer(); | 79 | field->stopTimer(); |
80 | // if (KMsgBox::yesNo(this, i18n("New Game"), i18n(newgamestr), KMsgBox::QUESTION) == 1) | 80 | // if (KMsgBox::yesNo(this, i18n("New Game"), i18n(newgamestr), KMsgBox::QUESTION) == 1) |
81 | game.start(1); | 81 | game.start(1); |
82 | // else | 82 | // else |
83 | field->startTimer(); | 83 | field->startTimer(); |
84 | } | 84 | } |
85 | 85 | ||
86 | void KBill::Pause() { | 86 | void KBill::Pause() { |
87 | field->stopTimer(); | 87 | field->stopTimer(); |
88 | QMessageBox::message(("Pause Game"), (pausestr), 0); | 88 | QMessageBox::message(tr("Pause Game"), tr(pausestr), 0); |
89 | field->startTimer(); | 89 | field->startTimer(); |
90 | } | 90 | } |
91 | 91 | ||
92 | void KBill::WarpTo() { | 92 | void KBill::WarpTo() { |
93 | /* field->stopTimer(); | 93 | /* field->stopTimer(); |
94 | InputBox b(this, 0, "Warp To Level", warpstr); | 94 | InputBox b(this, 0, "Warp To Level", tr(warpstr)); |
95 | bool status = b.exec() == 1; | 95 | bool status = b.exec() == 1; |
96 | field->startTimer(); | 96 | field->startTimer(); |
97 | if (status) { | 97 | if (status) { |
98 | bool ok; | 98 | bool ok; |
99 | int level = b.getText().toUInt(&ok); | 99 | int level = b.getText().toUInt(&ok); |
100 | if (ok) { | 100 | if (ok) { |
101 | field->startTimer(); | 101 | field->startTimer(); |
102 | game.warp_to_level(level); | 102 | game.warp_to_level(level); |
103 | return; | 103 | return; |
104 | } | 104 | } |
105 | }*/ | 105 | }*/ |
106 | } | 106 | } |
107 | 107 | ||
108 | void KBill::ViewHighScores() { | 108 | void KBill::ViewHighScores() { |
109 | //ui.popup_dialog(Game::HIGHSCORE); | 109 | //ui.popup_dialog(Game::HIGHSCORE); |
110 | } | 110 | } |
111 | 111 | ||
112 | void KBill::Story() { | 112 | void KBill::Story() { |
113 | field->stopTimer(); | 113 | field->stopTimer(); |
114 | HelpDialog *stryDialog = new HelpDialog(this,"helpdialog",1); | 114 | HelpDialog *stryDialog = new HelpDialog(this,"helpdialog",1); |
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."; | 115 | 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 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"); | 116 | stryDialog->setCaption(tr("The story of KBill")); |
117 | stryDialog->TextBrowser1->setText(stryString); | 117 | stryDialog->TextBrowser1->setText(stryString); |
118 | stryDialog->resize(200,200); | 118 | stryDialog->resize(200,200); |
119 | stryDialog->show(); | 119 | stryDialog->show(); |
120 | field->startTimer(); | 120 | field->startTimer(); |
121 | } | 121 | } |
122 | 122 | ||
123 | void KBill::Rules() { | 123 | void KBill::Rules() { |
124 | field->stopTimer(); | 124 | field->stopTimer(); |
125 | HelpDialog *rulesDialog = new HelpDialog(this,"helpdialog",1); | 125 | HelpDialog *rulesDialog = new HelpDialog(this,"helpdialog",1); |
126 | rulesDialog->setCaption("The rules of KBill"); | 126 | rulesDialog->setCaption(tr("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"; | 127 | 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"); |
128 | rulesDialog->TextBrowser1->setText(rulesStr); | 128 | rulesDialog->TextBrowser1->setText(rulesStr); |
129 | rulesDialog->resize(200,200); | 129 | rulesDialog->resize(200,200); |
130 | rulesDialog->show(); | 130 | rulesDialog->show(); |
131 | field->startTimer(); | 131 | field->startTimer(); |
132 | } | 132 | } |