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
00072 bool startedOK() {return (startupOK);}
00073
00074 protected:
00079 void saveProperties (KConfigGroup &);
00080
00086 void readProperties (const KConfigGroup &);
00087
00089 bool queryClose();
00090
00091 private slots:
00092
00093 void KGoldrunner_2();
00094
00095
00096 void stopStart();
00097
00098
00099 void changeTheme (const QString & themeFilepath);
00100
00101
00102 void createGame();
00103 void editGameInfo();
00104
00105
00106 void setMouseMode();
00107 void setKeyBoardMode();
00108
00109
00110 void normalSpeed();
00111 void beginSpeed();
00112 void champSpeed();
00113 void incSpeed();
00114 void decSpeed();
00115
00116
00117 void setTradRules();
00118 void setKGrRules();
00119
00120
00121 void goUp();
00122 void goR();
00123 void goDown();
00124 void goL();
00125 void stop();
00126 void digR();
00127 void digL();
00128
00129 void setKey (KBAction movement);
00130
00131
00132 void showEnemy0();
00133 void showEnemy1();
00134 void showEnemy2();
00135 void showEnemy3();
00136 void showEnemy4();
00137 void showEnemy5();
00138 void showEnemy6();
00139
00140
00141
00142 void optionsConfigureKeys();
00143
00144
00145
00146
00147 void changeStatusbar (const QString& text);
00148 void changeCaption (const QString& text);
00149
00150 void showLevel (int);
00151 void showLives (long);
00152 void showScore (long);
00153 void gameFreeze (bool);
00154
00155 void adjustHintAction (bool);
00156 void markRuleType (char ruleType);
00157 void setEditMenu (bool on_off);
00158 void setEditIcon (const QString & actionName, const char iconType);
00159 void viewFullScreen (bool activation);
00160
00161 QSize sizeHint() const;
00162
00163 private:
00164 void setupActions();
00165 void initStatusBar();
00166 void setupEditToolbarActions();
00167 void setupThemes();
00168
00169 private:
00170 bool startupOK;
00171
00172 KGrCanvas * view;
00173 KGrGame * game;
00174
00175 bool getDirectories();
00176 QString systemHTMLDir;
00177 QString systemDataDir;
00178 QString userDataDir;
00179
00180 QAction * saveGame;
00181
00182
00183 KAction * myPause;
00184 QString pauseKeys;
00185
00186 QAction * hintAction;
00187 QAction * killHero;
00188 QAction * highScore;
00189
00190 QAction * saveEdits;
00191
00192 KToggleFullScreenAction *fullScreen;
00193 KToggleAction * setMouse;
00194 KToggleAction * setKeyboard;
00195
00196 KToggleAction * tradRules;
00197 KToggleAction * kgrRules;
00198
00199 KToggleAction * setSounds;
00200
00201 KGrHero * hero;
00202
00203
00204
00205
00206 KToolBar * editToolbar;
00207 KToggleAction * m_defaultEditAct;
00208 private slots:
00209 void freeSlot();
00210 void edheroSlot();
00211 void edenemySlot();
00212 void brickSlot();
00213 void betonSlot();
00214 void fbrickSlot();
00215 void ladderSlot();
00216 void hladderSlot();
00217 void poleSlot();
00218 void nuggetSlot();
00219 void defaultEditObj();
00220 };
00221
00222 #endif // _KGOLDRUNNER_H_