Console panel sets "card" variable to selected card

This commit is contained in:
Twan van Laarhoven
2020-04-18 21:44:02 +02:00
parent 332f7b9ed8
commit 1c9139a490
2 changed files with 13 additions and 6 deletions
+6 -2
View File
@@ -321,7 +321,11 @@ ConsolePanel::ConsolePanel(Window* parent, int id)
}
void ConsolePanel::onChangeSet() {
// TODO
card = CardP();
}
void ConsolePanel::selectCard(const CardP& card) {
this->card = card;
}
// ----------------------------------------------------------------------------- : UI
@@ -397,7 +401,7 @@ void ConsolePanel::exec(String const& command) {
}
// execute command
//WITH_DYNAMIC_ARG(export_info, &ei); // TODO: allow image export
Context& ctx = set->getContext();
Context& ctx = set->getContext(card);
ScriptValueP result = ctx.eval(*script,false);
get_pending_errors();
// show result