author | unc0rr |
Fri, 20 Nov 2015 23:56:13 +0300 | |
branch | qmlfrontend |
changeset 11423 | 091149424aa4 |
parent 11421 | 78d6b99ddcb0 |
child 11424 | 8a5cc31483c6 |
permissions | -rw-r--r-- |
10402 | 1 |
#ifndef HWENGINE_H |
2 |
#define HWENGINE_H |
|
3 |
||
4 |
#include <QObject> |
|
10416 | 5 |
#include <QByteArray> |
6 |
#include <QVector> |
|
10420 | 7 |
#include <QPixmap> |
10416 | 8 |
|
9 |
#include "flib.h" |
|
10402 | 10 |
|
10420 | 11 |
class QQmlEngine; |
12 |
||
10402 | 13 |
class HWEngine : public QObject |
14 |
{ |
|
15 |
Q_OBJECT |
|
16 |
public: |
|
10420 | 17 |
explicit HWEngine(QQmlEngine * engine, QObject *parent = 0); |
10402 | 18 |
~HWEngine(); |
19 |
||
20 |
static void exposeToQML(); |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
21 |
Q_INVOKABLE void getPreview(); |
10432 | 22 |
Q_INVOKABLE void runQuickGame(); |
10448 | 23 |
Q_INVOKABLE void runLocalGame(); |
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
24 |
Q_INVOKABLE QString currentSeed(); |
10442 | 25 |
Q_INVOKABLE void getTeamsList(); |
10450 | 26 |
Q_INVOKABLE void resetGameConfig(); |
10612 | 27 |
|
10456 | 28 |
Q_INVOKABLE void setTheme(const QString & theme); |
10612 | 29 |
Q_INVOKABLE void setScript(const QString & script); |
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
30 |
Q_INVOKABLE void setScheme(const QString & scheme); |
10888 | 31 |
Q_INVOKABLE void setAmmo(const QString & ammo); |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
32 |
|
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
33 |
Q_INVOKABLE void tryAddTeam(const QString & teamName); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
34 |
Q_INVOKABLE void tryRemoveTeam(const QString & teamName); |
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
35 |
Q_INVOKABLE void changeTeamColor(const QString & teamName, int dir); |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
36 |
|
10896
5a74923120d5
Start network support: only setting up a connection for now
unc0rr
parents:
10888
diff
changeset
|
37 |
Q_INVOKABLE void connect(const QString & host, quint16 port); |
5a74923120d5
Start network support: only setting up a connection for now
unc0rr
parents:
10888
diff
changeset
|
38 |
|
11421 | 39 |
Q_INVOKABLE void sendChatMessage(const QString & msg); |
40 |
||
10402 | 41 |
signals: |
10420 | 42 |
void previewImageChanged(); |
10442 | 43 |
void localTeamAdded(const QString & teamName, int aiLevel); |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
44 |
void localTeamRemoved(const QString & teamName); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
45 |
|
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
46 |
void playingTeamAdded(const QString & teamName, int aiLevel, bool isLocal); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
47 |
void playingTeamRemoved(const QString & teamName); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
48 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
49 |
void teamColorChanged(const QString & teamName, const QString & colorValue); |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
50 |
|
11420 | 51 |
void netConnected(); |
52 |
void netDisconnected(const QString & message); |
|
53 |
||
54 |
void lobbyClientAdded(const QString & clientName); |
|
55 |
void lobbyClientRemoved(const QString & clientName); |
|
56 |
void lobbyChatLine(const QString & nickname, const QString & line); |
|
57 |
||
11423 | 58 |
void roomAdded(quint32 flags |
59 |
, const QString & name |
|
60 |
, int players |
|
61 |
, int teams |
|
62 |
, const QString & host |
|
63 |
, const QString & map |
|
64 |
, const QString & script |
|
65 |
, const QString & scheme |
|
66 |
, const QString & weapons); |
|
67 |
||
10402 | 68 |
public slots: |
10416 | 69 |
|
70 |
private: |
|
10420 | 71 |
QQmlEngine * m_engine; |
10416 | 72 |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
73 |
static void guiMessagesCallback(void * context, MessageType mt, const char * msg, uint32_t len); |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
74 |
void fillModels(); |
10420 | 75 |
|
76 |
private slots: |
|
10430 | 77 |
void engineMessageHandler(MessageType mt, const QByteArray &msg); |
10402 | 78 |
}; |
79 |
||
80 |
#endif // HWENGINE_H |
|
81 |