This commit is contained in:
GenevensiS
2025-08-11 17:54:52 +02:00
parent 81e9a1e26f
commit 78b93e5701
7 changed files with 7 additions and 26 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ endif()
# You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to # You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to
# HUNSPELL_LIBRARIES. If so, uncomment the below line and point it to the correct vcpkg root folder/library. # HUNSPELL_LIBRARIES. If so, uncomment the below line and point it to the correct vcpkg root folder/library.
set(HUNSPELL_LIBRARIES "C:\\src\\vcpkg\\installed\\${VCPKG_TARGET_TRIPLET}\\lib\\hunspell-1.7.lib") #set(HUNSPELL_LIBRARIES "C:\\PATH\\TO\\ROOT\\vcpkg\\installed\\${VCPKG_TARGET_TRIPLET}\\lib\\hunspell-1.7.lib")
message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}") message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}")
include_directories("${PROJECT_BINARY_DIR}/src") include_directories("${PROJECT_BINARY_DIR}/src")
-4
View File
@@ -71,7 +71,6 @@ CardsDataObject::CardsDataObject(const SetP& set, const vector<CardP>& cards) {
} }
WrappedCards data = { set->game.get(), set->game->name(), cards }; WrappedCards data = { set->game.get(), set->game->name(), cards };
SetText(serialize_for_clipboard(*set, data)); SetText(serialize_for_clipboard(*set, data));
queue_message(MESSAGE_WARNING, GetText());
// restore cards // restore cards
for (size_t i = 0 ; i < cards.size() ; ++i) { for (size_t i = 0 ; i < cards.size() ; ++i) {
if (has_styling[i]) { if (has_styling[i]) {
@@ -148,9 +147,6 @@ CardsOnClipboard::CardsOnClipboard(const SetP& set, const vector<CardP>& cards)
else if (cards.size() < 6) { else if (cards.size() < 6) {
Add(new wxImageDataObject(export_image(set, cards, true, 0, 1.0, 0.0))); Add(new wxImageDataObject(export_image(set, cards, true, 0, 1.0, 0.0)));
} }
else if (cards.size() < 6) {
Add(new wxBitmapDataObject(export_bitmap(set, cards, true, 0, 1.0, 0.0)));
}
// Conversion to serialized card format // Conversion to serialized card format
Add(new CardsDataObject(set, cards), true); Add(new CardsDataObject(set, cards), true);
} }
+3 -2
View File
@@ -98,8 +98,9 @@ Image export_image(const SetP& set, const CardP& card);
Image export_image(const SetP& set, const CardP& card, const double zoom, const Radians angle_radians = 0.0); Image export_image(const SetP& set, const CardP& card, const double zoom, const Radians angle_radians = 0.0);
Image export_image(const SetP& set, const vector<CardP>& cards, bool scale_to_lowest_dpi, int padding, const double zoom, const Radians angle_radians = 0.0); Image export_image(const SetP& set, const vector<CardP>& cards, bool scale_to_lowest_dpi, int padding, const double zoom, const Radians angle_radians = 0.0);
/// Export the image of a single card to a given filename /// Export the image of one or more cards to a given filename
void export_image(const SetP& set, const CardP& card, const String& filename); void export_image(const SetP& set, const CardP& card, const String& filename);
void export_image(const SetP& set, const vector<CardP>& cards, const String& path, const String& filename_template, FilenameConflicts conflicts);
/// Export a set to Magic Workstation format /// Export a set to Magic Workstation format
void export_mws(Window* parent, const SetP& set); void export_mws(Window* parent, const SetP& set);
+1 -4
View File
@@ -19,8 +19,6 @@
#include <render/card/viewer.hpp> #include <render/card/viewer.hpp>
#include <wx/filename.h> #include <wx/filename.h>
#define wxIMAGE_OPTION_PNG_DESCRIPTION wxString("PngDescription")
// ----------------------------------------------------------------------------- : Card export // ----------------------------------------------------------------------------- : Card export
class UnzoomedDataViewer : public DataViewer { class UnzoomedDataViewer : public DataViewer {
@@ -101,7 +99,6 @@ Bitmap export_bitmap(const SetP& set, const CardP& card, const double zoom, cons
return bitmap; return bitmap;
} }
// put multiple card images into one bitmap
Bitmap export_bitmap(const SetP& set, const vector<CardP>& cards, bool scale_to_lowest_dpi, int padding, const double zoom, const Radians angle_radians) { Bitmap export_bitmap(const SetP& set, const vector<CardP>& cards, bool scale_to_lowest_dpi, int padding, const double zoom, const Radians angle_radians) {
if (!set) throw Error(_("no set")); if (!set) throw Error(_("no set"));
vector<Bitmap> bitmaps; vector<Bitmap> bitmaps;
@@ -186,7 +183,7 @@ void export_image(const SetP& set, const CardP& card, const String& filename) {
// but image.saveFile determines it automagicly // but image.saveFile determines it automagicly
} }
void export_images(const SetP& set, const vector<CardP>& cards, void export_image(const SetP& set, const vector<CardP>& cards,
const String& path, const String& filename_template, FilenameConflicts conflicts) const String& path, const String& filename_template, FilenameConflicts conflicts)
{ {
wxBusyCursor busy; wxBusyCursor busy;
-13
View File
@@ -172,19 +172,6 @@ void AddJSONWindow::onBrowseFiles(wxCommandEvent&) {
} }
void AddJSONWindow::onOk(wxCommandEvent&) { void AddJSONWindow::onOk(wxCommandEvent&) {
// debug test shit
export_image(set, set->cards.front(), "C:\\Users\\Oli\\Desktop\\tetest\\test.png");
auto extImg = make_intrusive<ExternalImage>("C:/Users/Oli/Desktop/tetest/test.png");
Image img = extImg->generate(GeneratedImage::Options(0, 0, set->stylesheet.get(), set.get()));
if (img.HasOption(wxIMAGE_OPTION_FILENAME)) queue_message(MESSAGE_ERROR, img.GetOption(wxIMAGE_OPTION_FILENAME));
else queue_message(MESSAGE_ERROR, _("no dice"));
return;
/// Perform the import /// Perform the import
wxBusyCursor wait; wxBusyCursor wait;
// Read the file // Read the file
+1 -1
View File
@@ -65,7 +65,7 @@ void ImagesExportWindow::onOk(wxCommandEvent&) {
if (name.empty()) return; if (name.empty()) return;
settings.default_export_dir = wxPathOnly(name); settings.default_export_dir = wxPathOnly(name);
// Export // Export
export_images(set, getSelection(), name, gs.images_export_filename, gs.images_export_conflicts); export_image(set, getSelection(), name, gs.images_export_filename, gs.images_export_conflicts);
// Done // Done
EndModal(wxID_OK); EndModal(wxID_OK);
} }
+1 -1
View File
@@ -253,7 +253,7 @@ int MSE::OnRun() {
out = out.substr(pos + 1); out = out.substr(pos + 1);
} }
// export // export
export_images(set, set->cards, path, out, CONFLICT_NUMBER_OVERWRITE); export_image(set, set->cards, path, out, CONFLICT_NUMBER_OVERWRITE);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} else if (args[0] == _("--export")) { } else if (args[0] == _("--export")) {
if (args.size() < 2) { if (args.size() < 2) {