mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
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
This commit is contained in:
@@ -272,6 +272,11 @@ String Package::nameOut(const String& file) {
|
||||
} else {
|
||||
// create temp file
|
||||
String name = wxFileName::CreateTempFileName(_("mse"));
|
||||
String rect = LocalFileName::getRect(file);
|
||||
if (!rect.empty()) {
|
||||
if (name.Contains(".")) name = name.BeforeLast('.') + rect + _(".") + name.AfterLast('.');
|
||||
else name = name + rect;
|
||||
}
|
||||
it->second.tempName = name;
|
||||
return name;
|
||||
}
|
||||
@@ -361,7 +366,7 @@ LocalFileName LocalFileName::fromReadString(String const& fn, String const& pref
|
||||
if (!fn.empty() && clipboard_package()) {
|
||||
// copy file into current package
|
||||
try {
|
||||
LocalFileName local_name = clipboard_package()->newFileName(_("image"),_("")); // a new unique name in the package, assume it's an image
|
||||
LocalFileName local_name = clipboard_package()->newFileName(_("image"), getRect(fn)); // a new unique name in the package, assume it's an image
|
||||
auto out_stream = clipboard_package()->openOut(local_name);
|
||||
auto in_stream = Package::openAbsoluteFile(fn);
|
||||
out_stream->Write(*in_stream); // copy
|
||||
@@ -657,7 +662,7 @@ void Packaged::validate(Version) {
|
||||
if (short_name.empty()) {
|
||||
if (!full_name.empty()) short_name = full_name;
|
||||
else short_name = folder_name;
|
||||
}
|
||||
}
|
||||
// check dependencies
|
||||
FOR_EACH(dep, dependencies) {
|
||||
package_manager.checkDependency(*dep, true);
|
||||
|
||||
Reference in New Issue
Block a user