--- a/qmlfrontend/gameconfig.cpp Tue Dec 26 01:36:58 2017 +0100
+++ b/qmlfrontend/gameconfig.cpp Wed Dec 27 00:59:26 2017 +0100
@@ -1,11 +1,9 @@
#include "gameconfig.h"
GameConfig::GameConfig()
+ : m_isPreview(true)
{
- m_arguments
- << ""
- << "--internal"
- << "--landpreview";
+ setPreview(m_isPreview);
}
const char** GameConfig::argv() const
@@ -41,14 +39,54 @@
cfgAppend("eseed " + seed);
}
+void GameConfig::cmdTheme(const QByteArray& theme)
+{
+ cfgAppend("e$theme " + theme);
+}
+
void GameConfig::cmdMapgen(int mapgen)
{
cfgAppend("e$mapgen " + QByteArray::number(mapgen));
}
-bool GameConfig::isPreview()
+void GameConfig::cmdTeam(const Team& team)
+{
+ cfgAppend("eaddteam <hash> " + team.color + " " + team.name);
+
+ for (const Hedgehog& h : team.hedgehogs()) {
+ cfgAppend("eaddhh " + QByteArray::number(h.level) + " " + QByteArray::number(h.hp) + " " + h.name);
+ cfgAppend("ehat " + h.hat);
+ }
+ cfgAppend("eammloadt 9391929422199121032235111001200000000211100101011111000102");
+ cfgAppend("eammprob 0405040541600655546554464776576666666155510101115411111114");
+ cfgAppend("eammdelay 0000000000000205500000040007004000000000220000000600020000");
+ cfgAppend("eammreinf 1311110312111111123114111111111111111211111111111111111111");
+ cfgAppend("eammstore");
+}
+
+bool GameConfig::isPreview() const
{
- return true;
+ return m_isPreview;
+}
+
+void GameConfig::setPreview(bool isPreview)
+{
+ m_isPreview = isPreview;
+
+ m_arguments.clear();
+
+ if (m_isPreview) {
+ m_arguments
+ << ""
+ << "--internal"
+ << "--landpreview";
+
+ } else {
+ m_arguments
+ << ""
+ << "--internal"
+ << "--nomusic";
+ }
}
void GameConfig::cfgAppend(const QByteArray& cmd)