QTfrontend/game.h
branchui-scaling
changeset 15288 c4fd2813b127
parent 15283 16f389fcd462
equal deleted inserted replaced
13395:0135e64c6c66 15288:c4fd2813b127
    62 bool checkForDir(const QString & dir);
    62 bool checkForDir(const QString & dir);
    63 
    63 
    64 // last game info
    64 // last game info
    65 extern QList<QVariant> lastGameStartArgs;
    65 extern QList<QVariant> lastGameStartArgs;
    66 extern GameType lastGameType;
    66 extern GameType lastGameType;
    67 extern QString lastTrainingSubFolder;
       
    68 extern GameCFGWidget * lastGameCfg;
    67 extern GameCFGWidget * lastGameCfg;
    69 extern QString lastGameAmmo;
    68 extern QString lastGameAmmo;
    70 extern TeamSelWidget * lastGameTeamSel;
    69 extern TeamSelWidget * lastGameTeamSel;
    71 
    70 
    72 class HWGame : public TCPBase
    71 class HWGame : public TCPBase
    75     public:
    74     public:
    76         HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, QString ammo, TeamSelWidget* pTeamSelWidget = 0);
    75         HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, QString ammo, TeamSelWidget* pTeamSelWidget = 0);
    77         virtual ~HWGame();
    76         virtual ~HWGame();
    78         void AddTeam(const QString & team);
    77         void AddTeam(const QString & team);
    79         void PlayDemo(const QString & demofilename, bool isSave);
    78         void PlayDemo(const QString & demofilename, bool isSave);
       
    79         void PlayOfficialServerDemo();
    80         void StartLocal();
    80         void StartLocal();
    81         void StartQuick();
    81         void StartQuick();
    82         void StartNet();
    82         void StartNet();
    83         void StartTraining(const QString & file, const QString & subFolder);
    83         void StartTraining(const QString & file, const QString & subFolder, const QString & trainTeam);
    84         void StartCampaign(const QString & camp, const QString & campScript, const QString & campTeam);
    84         void StartCampaign(const QString & camp, const QString & campScript, const QString & campTeam);
    85         void abort();
    85         void abort();
    86         GameState gameState;
    86         GameState gameState;
    87         bool netSuspend;
    87         bool netSuspend;
    88 
    88 
    94     signals:
    94     signals:
    95         void SendNet(const QByteArray & msg);
    95         void SendNet(const QByteArray & msg);
    96         void SendChat(const QString & msg);
    96         void SendChat(const QString & msg);
    97         void SendTeamMessage(const QString & msg);
    97         void SendTeamMessage(const QString & msg);
    98         void GameStateChanged(GameState gameState);
    98         void GameStateChanged(GameState gameState);
       
    99         void DemoPresenceChanged(bool hasDemo);
    99         void GameStats(char type, const QString & info);
   100         void GameStats(char type, const QString & info);
   100         void HaveRecord(RecordType type, const QByteArray & record);
   101         void HaveRecord(RecordType type, const QByteArray & record);
   101         void ErrorMessage(const QString &);
   102         void ErrorMessage(const QString &);
   102         void CampStateChanged(int);
   103         void CampStateChanged(int);
       
   104         void TrainingStateChanged(int);
   103         void SendConsoleCommand(const QString & command);
   105         void SendConsoleCommand(const QString & command);
   104 
   106 
   105     public slots:
   107     public slots:
   106         void FromNet(const QByteArray & msg);
   108         void FromNet(const QByteArray & msg);
   107         void FromNetChat(const QString & msg);
   109         void FromNetChat(const QString & msg);
       
   110         void FromNetWarning(const QString & msg);
       
   111         void FromNetError(const QString & msg);
   108 
   112 
   109     private:
   113     private:
   110         char msgbuf[MAXMSGCHARS];
   114         char msgbuf[MAXMSGCHARS];
   111         QString ammostr;
   115         QString ammostr;
   112         GameUIConfig * config;
   116         GameUIConfig * config;
   121         void SendNetConfig();
   125         void SendNetConfig();
   122         void SendTrainingConfig();
   126         void SendTrainingConfig();
   123         void SendCampaignConfig();
   127         void SendCampaignConfig();
   124         void ParseMessage(const QByteArray & msg);
   128         void ParseMessage(const QByteArray & msg);
   125         void SetGameState(GameState state);
   129         void SetGameState(GameState state);
       
   130         void SetDemoPresence(bool hasDemo);
   126         void sendCampaignVar(const QByteArray & varToSend);
   131         void sendCampaignVar(const QByteArray & varToSend);
   127         void writeCampaignVar(const QByteArray &varVal);
   132         void writeCampaignVar(const QByteArray &varVal);
       
   133         void sendMissionVar(const QByteArray & varToSend);
       
   134         void writeMissionVar(const QByteArray &varVal);
   128         void flushNetBuffer();
   135         void flushNetBuffer();
   129 };
   136 };
   130 
   137 
   131 #endif
   138 #endif