aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/right_panel/LiveEngineDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/right_panel/LiveEngineDialog.cpp')
-rw-r--r--src/game_tab/right_panel/LiveEngineDialog.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/game_tab/right_panel/LiveEngineDialog.cpp b/src/game_tab/right_panel/LiveEngineDialog.cpp
index 64d75e3..d0b1896 100644
--- a/src/game_tab/right_panel/LiveEngineDialog.cpp
+++ b/src/game_tab/right_panel/LiveEngineDialog.cpp
@@ -1,12 +1,19 @@
#include "LiveEngineDialog.hpp"
-LiveEngineDialog::LiveEngineDialog(wxWindow *parent, std::string engine_name)
- : DialogLiveEngine(parent), engine_name(engine_name), interval(1000),
+LiveEngineDialog::LiveEngineDialog(wxWindow *parent, std::uint32_t engine_id)
+ : DialogLiveEngine(parent), interval(1000),
engine(nullptr) {
lines_list->InsertColumn(0, "#", wxLIST_FORMAT_LEFT, 50);
lines_list->InsertColumn(1, "CP", wxLIST_FORMAT_LEFT, 70);
lines_list->InsertColumn(2, "Line", wxLIST_FORMAT_LEFT, 300);
+
+ // Load engine name
+ confGroup="engines/"+std::to_string(engine_id);
+ CONFIG_OPEN(conf);
+ engine_name=conf->Read(confGroup+"/name");
+ CONFIG_CLOSE(conf);
current_engine->SetLabel(engine_name);
+
InitEngine();
Bind(wxEVT_BUTTON, &LiveEngineDialog::TogglePauseEngine, this,
LIVE_ENGINE_PAUSE_BUTTON);
@@ -25,11 +32,11 @@ void LiveEngineDialog::InitEngine() {
wxLogDebug("Start engine: %s", engine_name);
CONFIG_OPEN(conf);
engine = new uciadapter::UCI(
- conf->Read("engines/" + engine_name + "/path").ToStdString());
+ conf->Read(confGroup + "/path").ToStdString());
engine->ucinewgame();
long index;
- std::string optsPath = "engines/" + engine_name + "/options";
+ std::string optsPath = confGroup + "/options";
conf->SetPath(optsPath);
wxString opt_name;
if (conf->GetFirstGroup(opt_name, index)) {