kgoldrunner
kgoldrunner.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _KGOLDRUNNER_H_
00021 #define _KGOLDRUNNER_H_
00022
00023
00024 const int ID_LIVES = 0;
00025 const int ID_SCORE = 1;
00026 const int ID_LEVEL = 2;
00027 const int ID_HINTAVL = 3;
00028 const int ID_MSG = 4;
00029
00030 const int L_LIVES = 15;
00031 const int L_SCORE = 17;
00032 const int L_LEVEL = 15;
00033
00034 #include <kxmlguiwindow.h>
00035 #include <kstandarddirs.h>
00036 #include "kgrconsts.h"
00037
00038 class QAction;
00039 class KAction;
00040 class KToggleAction;
00041 class KToggleFullScreenAction;
00042
00043 class KGrGame;
00044 class KGrCanvas;
00045 class KGrHero;
00046
00055 class KGoldrunner : public KXmlGuiWindow
00056 {
00057 Q_OBJECT
00058 public:
00062 KGoldrunner();
00063
00067 virtual ~KGoldrunner();
00068
00069 bool startedOK() {return (startupOK);}
00070
00071 protected:
00076 void saveProperties(KConfigGroup &);
00077
00083 void readProperties(const KConfigGroup &);
00084
00085 bool queryClose ();
00086
00087 private slots:
00088
00089 void stopStart();
00090
00091
00092 void changeTheme (const QString & themeFilepath);
00093
00094
00095 void createGame();
00096 void editGameInfo();
00097
00098
00099 void setMouseMode();
00100 void setKeyBoardMode();
00101
00102
00103 void normalSpeed();
00104 void beginSpeed();
00105 void champSpeed();
00106 void incSpeed();
00107 void decSpeed();
00108
00109
00110 void setTradRules();
00111 void setKGrRules();
00112
00113
00114 void goUp();
00115 void goR();
00116 void goDown();
00117 void goL();
00118 void stop();
00119 void digR();
00120 void digL();
00121
00122 void setKey (KBAction movement);
00123
00124
00125 void showEnemy0();
00126 void showEnemy1();
00127 void showEnemy2();
00128 void showEnemy3();
00129 void showEnemy4();
00130 void showEnemy5();
00131 void showEnemy6();
00132
00133
00134
00135 void optionsConfigureKeys();
00136
00137
00138
00139
00140 void changeStatusbar(const QString& text);
00141 void changeCaption(const QString& text);
00142
00143 void showLevel (int);
00144 void showLives (long);
00145 void showScore (long);
00146 void gameFreeze (bool);
00147
00148 void adjustHintAction (bool);
00149 void markRuleType (char ruleType);
00150 void setEditMenu (bool on_off);
00151 void setEditIcon (const QString & actionName, const char iconType);
00152 void viewFullScreen(bool activation);
00153
00154 QSize sizeHint() const;
00155
00156 private:
00157 void setupActions();
00158 void initStatusBar();
00159 void setupEditToolbarActions();
00160 void setupThemes();
00161
00162 private:
00163 bool startupOK;
00164
00165 KGrCanvas * view;
00166 KGrGame * game;
00167
00168 bool getDirectories();
00169 QString systemHTMLDir;
00170 QString systemDataDir;
00171 QString userDataDir;
00172
00173 QAction * saveGame;
00174
00175
00176 KAction * myPause;
00177 QString pauseKeys;
00178
00179 QAction * hintAction;
00180 QAction * killHero;
00181 QAction * highScore;
00182
00183 QAction * saveEdits;
00184
00185 KToggleFullScreenAction *fullScreen;
00186 KToggleAction * setMouse;
00187 KToggleAction * setKeyboard;
00188
00189 KToggleAction * tradRules;
00190 KToggleAction * kgrRules;
00191
00192 KGrHero * hero;
00193
00194
00195
00196
00197 KToolBar * editToolbar;
00198 KToggleAction * m_defaultEditAct;
00199 private slots:
00200 void freeSlot();
00201 void edheroSlot();
00202 void edenemySlot();
00203 void brickSlot();
00204 void betonSlot();
00205 void fbrickSlot();
00206 void ladderSlot();
00207 void hladderSlot();
00208 void poleSlot();
00209 void nuggetSlot();
00210 void defaultEditObj();
00211 };
00212
00213 #endif // _KGOLDRUNNER_H_