From 81e9a1e26f4736d624fef40d6d307b59eb6d4c95 Mon Sep 17 00:00:00 2001 From: GenevensiS <66968533+G-e-n-e-v-e-n-s-i-S@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:57:04 +0200 Subject: [PATCH] Card data in images (start) * Add uuid implementation * Simplify uid implementation * Check for uid conflicts upon adding/copying cards * Remove unnecessary checks these are already checked as part of the first loop, since they were added to set.cards * Implement card linking * refactor to avoid triple loop * Start link visualization * Continue link visualization * formatting * add missing locale entries * improve layout * improve UI refresh * copy links when copying cards * implement second face editor * refactor using macros * get references * pasting multiple cards and links * start refactoring editors * continue refactoring editors * continue refactoring editors again * finish refactoring editors * refresh card list on link editor event * tweak event handling * Add insert_image script function * change parameter type * add script functions to get cards * add dimensions_of script function calculate both dimensions simultaneously while rendering the image only once. * save value even if not editable * add get_mse_locale script function * Change zoom scale choices * bug fixes * Scale symbol spacing with font size * sync locales * standardize line ending * handle links in new_card * initial waiting on wxWidgets 3.3.1 * update comment * store rect in image filename * store rect in temp file name * Update package.cpp * change line endings --- src/data/field.cpp | 22 ++++++- src/data/field.hpp | 6 +- src/data/format/clipboard.cpp | 11 ++-- src/data/format/formats.hpp | 24 ++++---- src/data/format/image.cpp | 55 ++++++++++++++---- src/data/settings.cpp | 18 +++--- src/gui/add_json_window.cpp | 14 +++++ src/gui/image_slice_window.cpp | 100 ++++++++++++++++---------------- src/gui/set/cards_panel.hpp | 2 +- src/gui/value/image.cpp | 21 ++++--- src/script/functions/export.cpp | 2 +- src/script/functions/image.cpp | 4 +- src/util/io/package.cpp | 9 ++- src/util/io/package.hpp | 9 +++ src/util/locale.hpp | 4 +- tools/doc/extra/overview.hpp | 2 +- 16 files changed, 193 insertions(+), 110 deletions(-) diff --git a/src/data/field.cpp b/src/data/field.cpp index c4805977..0e58d043 100644 --- a/src/data/field.cpp +++ b/src/data/field.cpp @@ -113,9 +113,14 @@ Style::Style(const FieldP& field) , visible(true) , automatic_side(AUTO_UNKNOWN) , content_dependent(false) -{} +{ + field->styleP = this; +} -Style::~Style() {} +Style::~Style() +{ + fieldP->styleP = nullptr; +} IMPLEMENT_REFLECTION(Style) { REFLECT(z_index); @@ -133,6 +138,7 @@ IMPLEMENT_REFLECTION(Style) { void init_object(const FieldP& field, StyleP& style) { if (!style) style = field->newStyle(); + field->styleP = style; } template <> StyleP read_new