mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Console panel sets "card" variable to selected card
This commit is contained in:
@@ -321,7 +321,11 @@ ConsolePanel::ConsolePanel(Window* parent, int id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConsolePanel::onChangeSet() {
|
void ConsolePanel::onChangeSet() {
|
||||||
// TODO
|
card = CardP();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConsolePanel::selectCard(const CardP& card) {
|
||||||
|
this->card = card;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : UI
|
// ----------------------------------------------------------------------------- : UI
|
||||||
@@ -397,7 +401,7 @@ void ConsolePanel::exec(String const& command) {
|
|||||||
}
|
}
|
||||||
// execute command
|
// execute command
|
||||||
//WITH_DYNAMIC_ARG(export_info, &ei); // TODO: allow image export
|
//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);
|
ScriptValueP result = ctx.eval(*script,false);
|
||||||
get_pending_errors();
|
get_pending_errors();
|
||||||
// show result
|
// show result
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class TextCtrl;
|
|||||||
// ----------------------------------------------------------------------------- : ConsolePanel
|
// ----------------------------------------------------------------------------- : ConsolePanel
|
||||||
|
|
||||||
class ConsolePanel : public SetWindowPanel {
|
class ConsolePanel : public SetWindowPanel {
|
||||||
public:
|
public:
|
||||||
ConsolePanel(Window* parent, int id);
|
ConsolePanel(Window* parent, int id);
|
||||||
|
|
||||||
// --------------------------------------------------- : UI
|
// --------------------------------------------------- : UI
|
||||||
@@ -37,12 +37,15 @@ class ConsolePanel : public SetWindowPanel {
|
|||||||
virtual bool canCopy() const;
|
virtual bool canCopy() const;
|
||||||
virtual void doCopy();
|
virtual void doCopy();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void onChangeSet();
|
void onChangeSet() override;
|
||||||
|
void selectCard(const CardP& card) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE();
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
|
CardP card;
|
||||||
|
|
||||||
wxSplitterWindow* splitter;
|
wxSplitterWindow* splitter;
|
||||||
MessageCtrl* messages;
|
MessageCtrl* messages;
|
||||||
wxPanel* entry_panel;
|
wxPanel* entry_panel;
|
||||||
|
|||||||
Reference in New Issue
Block a user