Split script/functions.cpp into multiple files in new script/functions/ directory.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@217 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-03-18 22:13:27 +00:00
parent 2cc6aa5524
commit f2ce80d88a
26 changed files with 952 additions and 686 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ void export_image(const SetP& set, const CardP& card, const String& filename);
Bitmap export_bitmap(const SetP& set, const CardP& card);
/// Export a set to Magic Workstation format
void export_mws(const SetP& set);
void export_mws(Window* parent, const SetP& set);
// ----------------------------------------------------------------------------- : EOF
#endif
+2 -2
View File
@@ -52,7 +52,7 @@ String card_rarity_code(const String& rarity) {
// ----------------------------------------------------------------------------- : export_mws
void export_mws(const SetP& set) {
void export_mws(Window* parent, const SetP& set) {
if (!set->game->isMagic()) {
throw Error(_("Can only export Magic sets to Magic Workstation"));
}
@@ -60,7 +60,7 @@ void export_mws(const SetP& set) {
// Select filename
String name = wxFileSelector(_("Export to file"),_(""),_(""),_(""),
_("Text files (*.txt)|*.txt|All Files|*.*"),
wxSAVE | wxOVERWRITE_PROMPT);
wxSAVE | wxOVERWRITE_PROMPT, parent);
if (name.empty()) return;
wxBusyCursor busy;
// Open file
+6 -6
View File
@@ -389,17 +389,17 @@ String KeywordDatabase::expand(const String& text,
part = part + param; // keep tags
} else if (kw->parameters[j/2-1]->script) {
// apply parameter script
ctx.setVariable(_("input"), toScript(part));
ctx.setVariable(_("input"), to_script(part));
part = kw->parameters[j/2-1]->script.invoke(ctx)->toString();
ctx.setVariable(_("input"), toScript(part));
ctx.setVariable(_("input"), to_script(part));
param = kw->parameters[j/2-1]->script.invoke(ctx)->toString();
}
ctx.setVariable(String(_("param")) << (int)(j/2), toScript(param));
ctx.setVariable(String(_("param")) << (int)(j/2), to_script(param));
}
total += part;
start = part_end;
}
ctx.setVariable(_("mode"), toScript(kw->mode));
ctx.setVariable(_("mode"), to_script(kw->mode));
// Show reminder text?
bool expand = expand_type == _('1');
@@ -412,8 +412,8 @@ String KeywordDatabase::expand(const String& text,
// Combine keyword & reminder with result
if (expand) {
String reminder = kw->reminder.invoke(ctx)->toString();
ctx.setVariable(_("keyword"), toScript(total));
ctx.setVariable(_("reminder"), toScript(reminder));
ctx.setVariable(_("keyword"), to_script(total));
ctx.setVariable(_("reminder"), to_script(reminder));
result += _("<kw-"); result += expand_type; result += _(">");
result += combine_script->eval(ctx)->toString();
result += _("</kw-"); result += expand_type; result += _(">");
+1 -1
View File
@@ -33,7 +33,7 @@ ColumnSettings::ColumnSettings()
{}
// dummy for ColumnSettings reflection
ScriptValueP toScript(const ColumnSettings&) { return script_nil; }
ScriptValueP to_script(const ColumnSettings&) { return script_nil; }
IMPLEMENT_REFLECTION(ColumnSettings) {
REFLECT(width);