mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
add setting to export card notes in meta data
This commit is contained in:
@@ -747,6 +747,9 @@ button:
|
|||||||
rotation export:
|
rotation export:
|
||||||
Use Viewer rotation
|
Use Viewer rotation
|
||||||
setting when e&xporting
|
setting when e&xporting
|
||||||
|
notes export:
|
||||||
|
Export card notes inside
|
||||||
|
image meta data
|
||||||
spellcheck enabled: Show &spelling errors on cards
|
spellcheck enabled: Show &spelling errors on cards
|
||||||
check now: Check &Now
|
check now: Check &Now
|
||||||
always: Always
|
always: Always
|
||||||
@@ -933,6 +936,7 @@ error:
|
|||||||
The package '%s' uses files from the package '%s', but it does not list a dependency.
|
The package '%s' uses files from the package '%s', but it does not list a dependency.
|
||||||
To resolve this, add:
|
To resolve this, add:
|
||||||
depends on: %s %s
|
depends on: %s %s
|
||||||
|
icon too large: Icon image file for package '%s' is too large. It should be 105x105 pixels max.
|
||||||
|
|
||||||
# image import
|
# image import
|
||||||
import not found: File not found: '%s'
|
import not found: File not found: '%s'
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ Image export_image(const SetP& set, const CardP& card, const double zoom, const
|
|||||||
IndexMap<FieldP, ValueP>& card_data = card->data;
|
IndexMap<FieldP, ValueP>& card_data = card->data;
|
||||||
boost::json::object& cardv = mse_to_json(card, set.get());
|
boost::json::object& cardv = mse_to_json(card, set.get());
|
||||||
boost::json::object& cardv_data = cardv["data"].as_object();
|
boost::json::object& cardv_data = cardv["data"].as_object();
|
||||||
|
if (!settings.stylesheetSettingsFor(set->stylesheetFor(card)).card_notes_export()) cardv["notes"] = "";
|
||||||
for(IndexMap<FieldP, ValueP>::iterator it = card_data.begin() ; it != card_data.end() ; ++it) {
|
for(IndexMap<FieldP, ValueP>::iterator it = card_data.begin() ; it != card_data.end() ; ++it) {
|
||||||
ImageValue* value = dynamic_cast<ImageValue*>(it->get());
|
ImageValue* value = dynamic_cast<ImageValue*>(it->get());
|
||||||
if (value && !value->filename.empty()) {
|
if (value && !value->filename.empty()) {
|
||||||
@@ -172,6 +173,7 @@ Image export_image(const SetP& set, const vector<CardP>& cards, bool scale_to_lo
|
|||||||
IndexMap<FieldP, ValueP>& card_data = card->data;
|
IndexMap<FieldP, ValueP>& card_data = card->data;
|
||||||
boost::json::object& cardv = mse_to_json(card, set.get());
|
boost::json::object& cardv = mse_to_json(card, set.get());
|
||||||
boost::json::object& cardv_data = cardv["data"].as_object();
|
boost::json::object& cardv_data = cardv["data"].as_object();
|
||||||
|
if (!settings.stylesheetSettingsFor(set->stylesheetFor(card)).card_notes_export()) cardv["notes"] = "";
|
||||||
for(IndexMap<FieldP, ValueP>::iterator it = card_data.begin() ; it != card_data.end() ; ++it) {
|
for(IndexMap<FieldP, ValueP>::iterator it = card_data.begin() ; it != card_data.end() ; ++it) {
|
||||||
ImageValue* value = dynamic_cast<ImageValue*>(it->get());
|
ImageValue* value = dynamic_cast<ImageValue*>(it->get());
|
||||||
if (value && !value->filename.empty()) {
|
if (value && !value->filename.empty()) {
|
||||||
|
|||||||
+11
-8
@@ -126,14 +126,15 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(GameSettings) {
|
|||||||
|
|
||||||
|
|
||||||
StyleSheetSettings::StyleSheetSettings()
|
StyleSheetSettings::StyleSheetSettings()
|
||||||
: card_zoom (1.0, true)
|
: card_zoom (1.0, true)
|
||||||
, export_zoom (1.0, true)
|
, export_zoom (1.0, true)
|
||||||
, card_angle (0, true)
|
, card_angle (0, true)
|
||||||
, card_anti_alias (true, true)
|
, card_anti_alias (true, true)
|
||||||
, card_borders (true, true)
|
, card_borders (true, true)
|
||||||
, card_draw_editing (true, true)
|
, card_draw_editing (true, true)
|
||||||
, card_normal_export (true, true)
|
, card_normal_export (true, true)
|
||||||
, card_spellcheck_enabled(true, true)
|
, card_notes_export (false, true)
|
||||||
|
, card_spellcheck_enabled(true, true)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void StyleSheetSettings::useDefault(const StyleSheetSettings& ss) {
|
void StyleSheetSettings::useDefault(const StyleSheetSettings& ss) {
|
||||||
@@ -144,6 +145,7 @@ void StyleSheetSettings::useDefault(const StyleSheetSettings& ss) {
|
|||||||
if (card_borders .isDefault()) card_borders .assignDefault(ss.card_borders);
|
if (card_borders .isDefault()) card_borders .assignDefault(ss.card_borders);
|
||||||
if (card_draw_editing .isDefault()) card_draw_editing .assignDefault(ss.card_draw_editing);
|
if (card_draw_editing .isDefault()) card_draw_editing .assignDefault(ss.card_draw_editing);
|
||||||
if (card_normal_export .isDefault()) card_normal_export .assignDefault(ss.card_normal_export);
|
if (card_normal_export .isDefault()) card_normal_export .assignDefault(ss.card_normal_export);
|
||||||
|
if (card_notes_export .isDefault()) card_notes_export .assignDefault(ss.card_notes_export);
|
||||||
if (card_spellcheck_enabled.isDefault()) card_spellcheck_enabled.assignDefault(ss.card_spellcheck_enabled);
|
if (card_spellcheck_enabled.isDefault()) card_spellcheck_enabled.assignDefault(ss.card_spellcheck_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +157,7 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(StyleSheetSettings) {
|
|||||||
REFLECT(card_borders);
|
REFLECT(card_borders);
|
||||||
REFLECT(card_draw_editing);
|
REFLECT(card_draw_editing);
|
||||||
REFLECT(card_normal_export);
|
REFLECT(card_normal_export);
|
||||||
|
REFLECT(card_notes_export);
|
||||||
REFLECT(card_spellcheck_enabled);
|
REFLECT(card_spellcheck_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ public:
|
|||||||
Defaultable<bool> card_borders;
|
Defaultable<bool> card_borders;
|
||||||
Defaultable<bool> card_draw_editing;
|
Defaultable<bool> card_draw_editing;
|
||||||
Defaultable<bool> card_normal_export;
|
Defaultable<bool> card_normal_export;
|
||||||
|
Defaultable<bool> card_notes_export;
|
||||||
Defaultable<bool> card_spellcheck_enabled;
|
Defaultable<bool> card_spellcheck_enabled;
|
||||||
|
|
||||||
/// Where the settings are the default, use the value from ss
|
/// Where the settings are the default, use the value from ss
|
||||||
|
|||||||
@@ -92,7 +92,10 @@ void PackageList::showData(const String& pattern) {
|
|||||||
Image img;
|
Image img;
|
||||||
Bitmap bmp;
|
Bitmap bmp;
|
||||||
if (stream && image_load_file(img, *stream)) {
|
if (stream && image_load_file(img, *stream)) {
|
||||||
bmp = Bitmap(img);
|
bmp = Bitmap(img);
|
||||||
|
if (bmp.GetWidth() > 150 || bmp.GetHeight() > 150) {
|
||||||
|
queue_message(MESSAGE_WARNING, _ERROR_1_("icon too large", p->relativeFilename()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// add to list
|
// add to list
|
||||||
packages.push_back(PackageData(p, bmp));
|
packages.push_back(PackageData(p, bmp));
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE();
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
wxCheckBox* high_quality, *borders, *draw_editing, *spellcheck_enabled, *non_normal_export;
|
wxCheckBox* high_quality, *borders, *draw_editing, *spellcheck_enabled, *non_normal_export, *notes_export;
|
||||||
|
|
||||||
wxComboBox* zoom;
|
wxComboBox* zoom;
|
||||||
int zoom_int;
|
int zoom_int;
|
||||||
@@ -226,6 +226,7 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
|
|||||||
draw_editing = new wxCheckBox(this, wxID_ANY, _BUTTON_("show editing hints"));
|
draw_editing = new wxCheckBox(this, wxID_ANY, _BUTTON_("show editing hints"));
|
||||||
spellcheck_enabled = new wxCheckBox(this, wxID_ANY, _BUTTON_("spellcheck enabled"));
|
spellcheck_enabled = new wxCheckBox(this, wxID_ANY, _BUTTON_("spellcheck enabled"));
|
||||||
non_normal_export = new wxCheckBox(this, wxID_ANY, _BUTTON_("zoom export"));
|
non_normal_export = new wxCheckBox(this, wxID_ANY, _BUTTON_("zoom export"));
|
||||||
|
notes_export = new wxCheckBox(this, wxID_ANY, _BUTTON_("notes export"));
|
||||||
zoom = new wxComboBox(this, ID_ZOOM);
|
zoom = new wxComboBox(this, ID_ZOOM);
|
||||||
export_zoom = new wxComboBox(this, ID_EXPORT_ZOOM);
|
export_zoom = new wxComboBox(this, ID_EXPORT_ZOOM);
|
||||||
|
|
||||||
@@ -235,7 +236,8 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
|
|||||||
borders-> SetValue( settings.default_stylesheet_settings.card_borders());
|
borders-> SetValue( settings.default_stylesheet_settings.card_borders());
|
||||||
draw_editing-> SetValue( settings.default_stylesheet_settings.card_draw_editing());
|
draw_editing-> SetValue( settings.default_stylesheet_settings.card_draw_editing());
|
||||||
spellcheck_enabled->SetValue( settings.default_stylesheet_settings.card_spellcheck_enabled());
|
spellcheck_enabled->SetValue( settings.default_stylesheet_settings.card_spellcheck_enabled());
|
||||||
non_normal_export->SetValue(!settings.default_stylesheet_settings.card_normal_export());
|
non_normal_export-> SetValue(!settings.default_stylesheet_settings.card_normal_export());
|
||||||
|
notes_export-> SetValue( settings.default_stylesheet_settings.card_notes_export());
|
||||||
zoom_int = static_cast<int>(settings.default_stylesheet_settings.card_zoom() * 100);
|
zoom_int = static_cast<int>(settings.default_stylesheet_settings.card_zoom() * 100);
|
||||||
zoom->SetValue(String::Format(_("%d%%"),zoom_int));
|
zoom->SetValue(String::Format(_("%d%%"),zoom_int));
|
||||||
int zoom_choices[] = { 50,66,75,80,100,120,125,150,175,200 };
|
int zoom_choices[] = { 50,66,75,80,100,120,125,150,175,200 };
|
||||||
@@ -271,6 +273,7 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
|
|||||||
s2->Add(s3, 0, wxEXPAND | wxALL, 4);
|
s2->Add(s3, 0, wxEXPAND | wxALL, 4);
|
||||||
s2->Add(s4, 0, wxEXPAND | wxALL, 4);
|
s2->Add(s4, 0, wxEXPAND | wxALL, 4);
|
||||||
s2->Add(non_normal_export, 0, wxEXPAND | wxALL, 4);
|
s2->Add(non_normal_export, 0, wxEXPAND | wxALL, 4);
|
||||||
|
s2->Add(notes_export, 0, wxEXPAND | wxALL, 4);
|
||||||
|
|
||||||
s->Add(s2, 0, wxEXPAND | wxALL, 8);
|
s->Add(s2, 0, wxEXPAND | wxALL, 8);
|
||||||
|
|
||||||
@@ -284,6 +287,7 @@ void DisplayPreferencesPage::store() {
|
|||||||
settings.default_stylesheet_settings.card_draw_editing = draw_editing->GetValue();
|
settings.default_stylesheet_settings.card_draw_editing = draw_editing->GetValue();
|
||||||
settings.default_stylesheet_settings.card_spellcheck_enabled = spellcheck_enabled->GetValue();
|
settings.default_stylesheet_settings.card_spellcheck_enabled = spellcheck_enabled->GetValue();
|
||||||
settings.default_stylesheet_settings.card_normal_export = !non_normal_export->GetValue();
|
settings.default_stylesheet_settings.card_normal_export = !non_normal_export->GetValue();
|
||||||
|
settings.default_stylesheet_settings.card_notes_export = notes_export->GetValue();
|
||||||
|
|
||||||
updateZoom();
|
updateZoom();
|
||||||
settings.default_stylesheet_settings.card_zoom = zoom_int / 100.0;
|
settings.default_stylesheet_settings.card_zoom = zoom_int / 100.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user