author | unc0rr |
Sun, 08 Feb 2015 00:10:05 +0300 | |
branch | qmlfrontend |
changeset 10819 | 57e21f7621b0 |
parent 10616 | 20a2d5e6930a |
child 10888 | a04e04aaf599 |
permissions | -rw-r--r-- |
10402 | 1 |
#include <QLibrary> |
2 |
#include <QtQml> |
|
10404
1baaab44a0b2
- Fix arguments parsing in engine assuming paramcount > 0
unc0rr
parents:
10402
diff
changeset
|
3 |
#include <QDebug> |
10420 | 4 |
#include <QPainter> |
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
5 |
#include <QUuid> |
10402 | 6 |
|
7 |
#include "hwengine.h" |
|
10420 | 8 |
#include "previewimageprovider.h" |
10436 | 9 |
#include "themeiconprovider.h" |
10402 | 10 |
|
11 |
extern "C" { |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
12 |
RunEngine_t *flibRunEngine; |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
13 |
registerGUIMessagesCallback_t *flibRegisterGUIMessagesCallback; |
10430 | 14 |
setSeed_t *flibSetSeed; |
15 |
getSeed_t *flibGetSeed; |
|
10456 | 16 |
setTheme_t *flibSetTheme; |
10612 | 17 |
setScript_t *flibSetScript; |
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10616
diff
changeset
|
18 |
setScheme_t *flibSetScheme; |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
19 |
getPreview_t *flibGetPreview; |
10432 | 20 |
runQuickGame_t *flibRunQuickGame; |
10448 | 21 |
runLocalGame_t *flibRunLocalGame; |
10416 | 22 |
flibInit_t *flibInit; |
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
23 |
flibFree_t *flibFree; |
10450 | 24 |
resetGameConfig_t * flibResetGameConfig; |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
25 |
getThemesList_t *flibGetThemesList; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
26 |
freeThemesList_t *flibFreeThemesList; |
10436 | 27 |
getThemeIcon_t *flibGetThemeIcon; |
10517 | 28 |
getScriptsList_t *flibGetScriptsList; |
10616 | 29 |
getSchemesList_t *flibGetSchemesList; |
10442 | 30 |
getTeamsList_t *flibGetTeamsList; |
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
|
31 |
tryAddTeam_t * flibTryAddTeam; |
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 |
tryRemoveTeam_t * flibTryRemoveTeam; |
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
33 |
changeTeamColor_t * flibChangeTeamColor; |
10402 | 34 |
} |
10420 | 35 |
|
10430 | 36 |
Q_DECLARE_METATYPE(MessageType); |
37 |
||
10420 | 38 |
HWEngine::HWEngine(QQmlEngine *engine, QObject *parent) : |
39 |
QObject(parent), |
|
40 |
m_engine(engine) |
|
10402 | 41 |
{ |
10430 | 42 |
qRegisterMetaType<MessageType>("MessageType"); |
43 |
||
10404
1baaab44a0b2
- Fix arguments parsing in engine assuming paramcount > 0
unc0rr
parents:
10402
diff
changeset
|
44 |
QLibrary hwlib("./libhwengine.so"); |
10402 | 45 |
|
46 |
if(!hwlib.load()) |
|
10404
1baaab44a0b2
- Fix arguments parsing in engine assuming paramcount > 0
unc0rr
parents:
10402
diff
changeset
|
47 |
qWarning() << "Engine library not found" << hwlib.errorString(); |
10402 | 48 |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
49 |
flibRunEngine = (RunEngine_t*) hwlib.resolve("RunEngine"); |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
50 |
flibRegisterGUIMessagesCallback = (registerGUIMessagesCallback_t*) hwlib.resolve("registerGUIMessagesCallback"); |
10430 | 51 |
flibGetSeed = (getSeed_t*) hwlib.resolve("getSeed"); |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
52 |
flibGetPreview = (getPreview_t*) hwlib.resolve("getPreview"); |
10432 | 53 |
flibRunQuickGame = (runQuickGame_t*) hwlib.resolve("runQuickGame"); |
10448 | 54 |
flibRunLocalGame = (runLocalGame_t*) hwlib.resolve("runLocalGame"); |
10416 | 55 |
flibInit = (flibInit_t*) hwlib.resolve("flibInit"); |
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
56 |
flibFree = (flibFree_t*) hwlib.resolve("flibFree"); |
10416 | 57 |
|
10612 | 58 |
flibSetSeed = (setSeed_t*) hwlib.resolve("setSeed"); |
59 |
flibSetTheme = (setTheme_t*) hwlib.resolve("setTheme"); |
|
60 |
flibSetScript = (setScript_t*) hwlib.resolve("setScript"); |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10616
diff
changeset
|
61 |
flibSetScheme = (setScheme_t*) hwlib.resolve("setScheme"); |
10612 | 62 |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
63 |
flibGetThemesList = (getThemesList_t*) hwlib.resolve("getThemesList"); |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
64 |
flibFreeThemesList = (freeThemesList_t*) hwlib.resolve("freeThemesList"); |
10436 | 65 |
flibGetThemeIcon = (getThemeIcon_t*) hwlib.resolve("getThemeIcon"); |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
66 |
|
10517 | 67 |
flibGetScriptsList = (getScriptsList_t*) hwlib.resolve("getScriptsList"); |
10616 | 68 |
flibGetSchemesList = (getSchemesList_t*) hwlib.resolve("getSchemesList"); |
10517 | 69 |
|
10450 | 70 |
flibResetGameConfig = (resetGameConfig_t*) hwlib.resolve("resetGameConfig"); |
10442 | 71 |
flibGetTeamsList = (getTeamsList_t*) hwlib.resolve("getTeamsList"); |
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
|
72 |
flibTryAddTeam = (tryAddTeam_t*) hwlib.resolve("tryAddTeam"); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
73 |
flibTryRemoveTeam = (tryRemoveTeam_t*) hwlib.resolve("tryRemoveTeam"); |
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
74 |
flibChangeTeamColor = (changeTeamColor_t*) hwlib.resolve("changeTeamColor"); |
10442 | 75 |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
76 |
flibInit("/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-GC/share/hedgewars/Data", "/usr/home/unC0Rr/.hedgewars"); |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
77 |
flibRegisterGUIMessagesCallback(this, &guiMessagesCallback); |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
78 |
|
10436 | 79 |
ThemeIconProvider * themeIcon = (ThemeIconProvider *)m_engine->imageProvider(QLatin1String("theme")); |
80 |
themeIcon->setFileContentsFunction(flibGetThemeIcon); |
|
81 |
||
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
82 |
fillModels(); |
10402 | 83 |
} |
84 |
||
85 |
HWEngine::~HWEngine() |
|
86 |
{ |
|
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
87 |
flibFree(); |
10402 | 88 |
} |
89 |
||
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
90 |
void HWEngine::getPreview() |
10402 | 91 |
{ |
10430 | 92 |
flibSetSeed(QUuid::createUuid().toString().toLatin1()); |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
93 |
flibGetPreview(); |
10402 | 94 |
} |
95 |
||
10432 | 96 |
void HWEngine::runQuickGame() |
97 |
{ |
|
98 |
flibSetSeed(QUuid::createUuid().toString().toLatin1()); |
|
99 |
flibRunQuickGame(); |
|
100 |
} |
|
101 |
||
10448 | 102 |
void HWEngine::runLocalGame() |
103 |
{ |
|
104 |
flibRunLocalGame(); |
|
105 |
} |
|
106 |
||
107 |
||
10402 | 108 |
static QObject *hwengine_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) |
109 |
{ |
|
110 |
Q_UNUSED(scriptEngine) |
|
111 |
||
10420 | 112 |
HWEngine *hwengine = new HWEngine(engine); |
10402 | 113 |
return hwengine; |
114 |
} |
|
115 |
||
116 |
void HWEngine::exposeToQML() |
|
117 |
{ |
|
118 |
qDebug("HWEngine::exposeToQML"); |
|
119 |
qmlRegisterSingletonType<HWEngine>("Hedgewars.Engine", 1, 0, "HWEngine", hwengine_singletontype_provider); |
|
120 |
} |
|
10416 | 121 |
|
122 |
||
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
123 |
void HWEngine::guiMessagesCallback(void *context, MessageType mt, const char * msg, uint32_t len) |
10420 | 124 |
{ |
125 |
HWEngine * obj = (HWEngine *)context; |
|
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
|
126 |
QByteArray b = QByteArray(msg, len); |
10420 | 127 |
|
128 |
qDebug() << "FLIPC in" << b.size() << b; |
|
129 |
||
10430 | 130 |
QMetaObject::invokeMethod(obj, "engineMessageHandler", Qt::QueuedConnection, Q_ARG(MessageType, mt), Q_ARG(QByteArray, b)); |
10416 | 131 |
} |
132 |
||
10430 | 133 |
void HWEngine::engineMessageHandler(MessageType mt, const QByteArray &msg) |
10416 | 134 |
{ |
10430 | 135 |
switch(mt) |
10426 | 136 |
{ |
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
|
137 |
case MSG_PREVIEW: { |
10426 | 138 |
PreviewImageProvider * preview = (PreviewImageProvider *)m_engine->imageProvider(QLatin1String("preview")); |
139 |
preview->setPixmap(msg); |
|
140 |
emit previewImageChanged(); |
|
10430 | 141 |
break; |
10426 | 142 |
} |
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
|
143 |
case MSG_ADDPLAYINGTEAM: { |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
144 |
QStringList l = QString::fromUtf8(msg).split('\n'); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
145 |
emit playingTeamAdded(l[1], l[0].toInt(), true); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
146 |
break; |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
147 |
} |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
148 |
case MSG_REMOVEPLAYINGTEAM: { |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
149 |
emit playingTeamRemoved(msg); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
150 |
break; |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
151 |
} |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
152 |
case MSG_ADDTEAM: { |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
153 |
emit localTeamAdded(msg, 0); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
154 |
break; |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
155 |
} |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
156 |
case MSG_REMOVETEAM: { |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
157 |
emit localTeamRemoved(msg); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
158 |
break; |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
159 |
} |
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
160 |
case MSG_TEAMCOLOR: { |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
161 |
QStringList l = QString::fromUtf8(msg).split('\n'); |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
162 |
emit teamColorChanged(l[0], QColor::fromRgba(l[1].toInt()).name()); |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
163 |
break; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
164 |
} |
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
|
165 |
} |
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
166 |
} |
10416 | 167 |
|
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
168 |
QString HWEngine::currentSeed() |
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10420
diff
changeset
|
169 |
{ |
10430 | 170 |
return QString::fromLatin1(flibGetSeed()); |
10416 | 171 |
} |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
172 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
173 |
void HWEngine::fillModels() |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
174 |
{ |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
175 |
QStringList resultModel; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
176 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
177 |
char ** themes = flibGetThemesList(); |
10616 | 178 |
for (char **i = themes; *i != NULL; i++) |
179 |
resultModel << QString::fromUtf8(*i); |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
180 |
flibFreeThemesList(themes); |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
181 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
182 |
m_engine->rootContext()->setContextProperty("themesModel", QVariant::fromValue(resultModel)); |
10612 | 183 |
|
10616 | 184 |
// scripts model |
10612 | 185 |
resultModel.clear(); |
10616 | 186 |
for (char **i = flibGetScriptsList(); *i != NULL; i++) |
187 |
resultModel << QString::fromUtf8(*i); |
|
10612 | 188 |
|
189 |
m_engine->rootContext()->setContextProperty("scriptsModel", QVariant::fromValue(resultModel)); |
|
10616 | 190 |
|
191 |
// schemes model |
|
192 |
resultModel.clear(); |
|
193 |
for (char **i = flibGetSchemesList(); *i != NULL; i++) |
|
194 |
resultModel << QString::fromUtf8(*i); |
|
195 |
||
196 |
m_engine->rootContext()->setContextProperty("schemesModel", QVariant::fromValue(resultModel)); |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
197 |
} |
10442 | 198 |
|
199 |
void HWEngine::getTeamsList() |
|
200 |
{ |
|
201 |
char ** teams = flibGetTeamsList(); |
|
202 |
for (char **i = teams; *i != NULL; i++) { |
|
203 |
QString team = QString::fromUtf8(*i); |
|
204 |
||
205 |
emit localTeamAdded(team, 0); |
|
206 |
} |
|
207 |
} |
|
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
|
208 |
|
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
209 |
void HWEngine::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
|
210 |
{ |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
211 |
flibTryAddTeam(teamName.toUtf8().constData()); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
212 |
} |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
213 |
|
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
214 |
void HWEngine::tryRemoveTeam(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
|
215 |
{ |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
216 |
flibTryRemoveTeam(teamName.toUtf8().constData()); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10442
diff
changeset
|
217 |
} |
10450 | 218 |
|
219 |
void HWEngine::resetGameConfig() |
|
220 |
{ |
|
221 |
flibResetGameConfig(); |
|
222 |
} |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
223 |
|
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
224 |
void HWEngine::changeTeamColor(const QString &teamName, int dir) |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
225 |
{ |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
226 |
flibChangeTeamColor(teamName.toUtf8().constData(), dir); |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
227 |
} |
10456 | 228 |
|
229 |
void HWEngine::setTheme(const QString &theme) |
|
230 |
{ |
|
231 |
flibSetTheme(theme.toUtf8().constData()); |
|
232 |
} |
|
10612 | 233 |
|
234 |
void HWEngine::setScript(const QString &script) |
|
235 |
{ |
|
236 |
flibSetScript(script.toUtf8().constData()); |
|
237 |
} |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10616
diff
changeset
|
238 |
|
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10616
diff
changeset
|
239 |
void HWEngine::setScheme(const QString &scheme) |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10616
diff
changeset
|
240 |
{ |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10616
diff
changeset
|
241 |
flibSetScheme(scheme.toUtf8().constData()); |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10616
diff
changeset
|
242 |
} |