QTfrontend/hwform.h
changeset 2948 3f21a9dc93d0
parent 2874 3c7c2bf1ba38
child 3159 e5eff81d7635
equal deleted inserted replaced
2947:803b277e4894 2948:3f21a9dc93d0
    46 extern bool frontendEffects;
    46 extern bool frontendEffects;
    47 extern QString playerHash;
    47 extern QString playerHash;
    48 
    48 
    49 class HWForm : public QMainWindow
    49 class HWForm : public QMainWindow
    50 {
    50 {
    51 	Q_OBJECT
    51     Q_OBJECT
    52 
    52 
    53 public:
    53 public:
    54 	HWForm(QWidget *parent = 0);
    54     HWForm(QWidget *parent = 0);
    55 	Ui_HWForm ui;
    55     Ui_HWForm ui;
    56 	SDLInteraction sdli;
    56     SDLInteraction sdli;
    57 	GameUIConfig * config;
    57     GameUIConfig * config;
    58     QSettings * gameSettings; // Same file GameUIConfig points to but without the baggage.  Needs sync() calls if you want to get GameUIConfig changes though
    58     QSettings * gameSettings; // Same file GameUIConfig points to but without the baggage.  Needs sync() calls if you want to get GameUIConfig changes though
    59 	void updateXfire();
    59     void updateXfire();
    60 
    60 
    61 private slots:
    61 private slots:
    62 	void GoToMain();
    62     void GoToMain();
    63 	void GoToSinglePlayer();
    63     void GoToSinglePlayer();
    64 	void GoToSetup();
    64     void GoToSetup();
    65 	void GoToMultiplayer();
    65     void GoToMultiplayer();
    66 	void GoToSaves();
    66     void GoToSaves();
    67 	void GoToDemos();
    67     void GoToDemos();
    68 	void GoToNet();
    68     void GoToNet();
    69 	void GoToNetType();
    69     void GoToNetType();
    70 	void GoToInfo();
    70     void GoToInfo();
    71 	void GoToTraining();
    71     void GoToTraining();
    72 	void GoToSelectWeapon();
    72     void GoToSelectWeapon();
    73 	void GoToSelectWeaponSet(const QString & name);
    73     void GoToSelectWeaponSet(const QString & name);
    74 	void GoToSelectNewWeapon();
    74     void GoToSelectNewWeapon();
    75 	void GoToNetServer();
    75     void GoToNetServer();
    76 	void GoToSchemes();
    76     void GoToSchemes();
    77 	void GoToAdmin();
    77     void GoToAdmin();
    78 	void GoToPage(quint8 id);
    78     void GoToPage(quint8 id);
    79 	void GoBack();
    79     void GoBack();
    80 	void btnExitPressed();
    80     void btnExitPressed();
    81 	void btnExitClicked();
    81     void btnExitClicked();
    82 	void IntermediateSetup();
    82     void IntermediateSetup();
    83 	void NewTeam();
    83     void NewTeam();
    84 	void EditTeam();
    84     void EditTeam();
    85 	void RandomNames();
    85     void RandomNames();
    86 	void RandomName(const int &i);
    86     void RandomName(const int &i);
    87 	void TeamSave();
    87     void TeamSave();
    88 	void TeamDiscard();
    88     void TeamDiscard();
    89 	void SimpleGame();
    89     void SimpleGame();
    90 	void PlayDemo();
    90     void PlayDemo();
    91 	void StartTraining();
    91     void StartTraining();
    92 	void NetConnect();
    92     void NetConnect();
    93 	void NetConnectServer(const QString & host, quint16 port);
    93     void NetConnectServer(const QString & host, quint16 port);
    94 	void NetConnectOfficialServer();
    94     void NetConnectOfficialServer();
    95 	void NetStartServer();
    95     void NetStartServer();
    96 	void NetDisconnect();
    96     void NetDisconnect();
    97 	void NetConnected();
    97     void NetConnected();
    98 	void NetGameEnter();
    98     void NetGameEnter();
    99 	void AddNetTeam(const HWTeam& team);
    99     void AddNetTeam(const HWTeam& team);
   100 	void StartMPGame();
   100     void StartMPGame();
   101 	void GameStateChanged(GameState gameState);
   101     void GameStateChanged(GameState gameState);
   102 	void ForcedDisconnect();
   102     void ForcedDisconnect();
   103 	void ShowErrorMessage(const QString &);
   103     void ShowErrorMessage(const QString &);
   104 	void GetRecord(bool isDemo, const QByteArray & record);
   104     void GetRecord(bool isDemo, const QByteArray & record);
   105 	void CreateNetGame();
   105     void CreateNetGame();
   106 	void UpdateWeapons();
   106     void UpdateWeapons();
   107 	void onFrontendFullscreen(bool value);
   107     void onFrontendFullscreen(bool value);
   108 	void Music(bool checked);
   108     void Music(bool checked);
   109 
   109 
   110 	void NetGameChangeStatus(bool isMaster);
   110     void NetGameChangeStatus(bool isMaster);
   111 	void NetGameMaster();
   111     void NetGameMaster();
   112 	void NetGameSlave();
   112     void NetGameSlave();
   113 
   113 
   114 	void AsyncNetServerStart();
   114     void AsyncNetServerStart();
   115 	void NetLeftRoom();
   115     void NetLeftRoom();
   116 	void selectFirstNetScheme();
   116     void selectFirstNetScheme();
   117 
   117 
   118 private:
   118 private:
   119 	void _NetConnect(const QString & hostName, quint16 port, const QString & nick);
   119     void _NetConnect(const QString & hostName, quint16 port, const QString & nick);
   120 	void UpdateTeamsLists(const QStringList* editable_teams=0);
   120     void UpdateTeamsLists(const QStringList* editable_teams=0);
   121 	void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo);
   121     void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo);
   122 	void closeEvent(QCloseEvent *event);
   122     void closeEvent(QCloseEvent *event);
   123 	void CustomizePalettes();
   123     void CustomizePalettes();
   124 	void resizeEvent(QResizeEvent * event);
   124     void resizeEvent(QResizeEvent * event);
   125 
   125 
   126 	enum PageIDs {
   126     enum PageIDs {
   127 		ID_PAGE_SETUP_TEAM      =  0,
   127         ID_PAGE_SETUP_TEAM      =  0,
   128 		ID_PAGE_SETUP           =  1,
   128         ID_PAGE_SETUP           =  1,
   129 		ID_PAGE_MULTIPLAYER     =  2,
   129         ID_PAGE_MULTIPLAYER     =  2,
   130 		ID_PAGE_DEMOS           =  3,
   130         ID_PAGE_DEMOS           =  3,
   131 		ID_PAGE_NET             =  4,
   131         ID_PAGE_NET             =  4,
   132 		ID_PAGE_NETGAME         =  5,
   132         ID_PAGE_NETGAME         =  5,
   133 		ID_PAGE_INFO            =  6,
   133         ID_PAGE_INFO            =  6,
   134 		ID_PAGE_MAIN            =  7,
   134         ID_PAGE_MAIN            =  7,
   135 		ID_PAGE_GAMESTATS       =  8,
   135         ID_PAGE_GAMESTATS       =  8,
   136 		ID_PAGE_SINGLEPLAYER    =  9,
   136         ID_PAGE_SINGLEPLAYER    =  9,
   137 		ID_PAGE_TRAINING        = 10,
   137         ID_PAGE_TRAINING        = 10,
   138 		ID_PAGE_SELECTWEAPON    = 11,
   138         ID_PAGE_SELECTWEAPON    = 11,
   139 		ID_PAGE_NETSERVER       = 12,
   139         ID_PAGE_NETSERVER       = 12,
   140 		ID_PAGE_INGAME          = 13,
   140         ID_PAGE_INGAME          = 13,
   141 		ID_PAGE_ROOMSLIST       = 14,
   141         ID_PAGE_ROOMSLIST       = 14,
   142 		ID_PAGE_CONNECTING      = 15,
   142         ID_PAGE_CONNECTING      = 15,
   143 		ID_PAGE_SCHEME          = 16,
   143         ID_PAGE_SCHEME          = 16,
   144 		ID_PAGE_ADMIN           = 17,
   144         ID_PAGE_ADMIN           = 17,
   145 		ID_PAGE_NETTYPE         = 18
   145         ID_PAGE_NETTYPE         = 18
   146 		};
   146         };
   147 	HWGame * game;
   147     HWGame * game;
   148 	HWNetServer* pnetserver;
   148     HWNetServer* pnetserver;
   149 	HWNetRegisterServer* pRegisterServer;
   149     HWNetRegisterServer* pRegisterServer;
   150 	HWTeam * editedTeam;
   150     HWTeam * editedTeam;
   151 	HWNewNet * hwnet;
   151     HWNewNet * hwnet;
   152 	HWNamegen * namegen;
   152     HWNamegen * namegen;
   153 	AmmoSchemeModel * ammoSchemeModel;
   153     AmmoSchemeModel * ammoSchemeModel;
   154 	QStack<quint8> PagesStack;
   154     QStack<quint8> PagesStack;
   155 	QTime eggTimer;
   155     QTime eggTimer;
   156 	BGWidget * wBackground;
   156     BGWidget * wBackground;
   157         
   157         
   158 #ifdef __APPLE__
   158 #ifdef __APPLE__
   159         InstallController * panel;
   159         InstallController * panel;
   160 #endif
   160 #endif
   161         
   161         
   162 	void OnPageShown(quint8 id, quint8 lastid=0);
   162     void OnPageShown(quint8 id, quint8 lastid=0);
   163 };
   163 };
   164 
   164 
   165 #endif
   165 #endif