Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultEntityWidth and defaultEntityHeight can contain null #980

Closed
stinkytoe opened this issue Oct 15, 2023 · 3 comments
Closed

defaultEntityWidth and defaultEntityHeight can contain null #980

stinkytoe opened this issue Oct 15, 2023 · 3 comments
Assignees
Labels
🪳 Bug Something isn't working Json
Milestone

Comments

@stinkytoe
Copy link

I am writing an importer for the rust bevy engine for your LDtk json format. I used the JSON_SCHEMA.json file you provided on your website. The version in the repo as of today seems to be the same.

defaultEntityWidth and defaultEntityHeight only have the integer type listed, but the editor generates a null for these fields when I save a project. This prevents my parser from being able to deserialize these values. I'm using serde_json, if that's relevant.

I was able to work around this by manually editing the schema and adding both integer and null as possible types. I don't think I'll need to actually use this field, so no worries if the type doesn't agree in the future.

Request: either change the schema to include null as an option, or change the editor to fill these with sane values by default.

BTW, LDtk is awesome and you're awesome!

@deepnight deepnight self-assigned this Oct 15, 2023
@deepnight deepnight added 🪳 Bug Something isn't working Json labels Oct 15, 2023
@deepnight deepnight added this to the 1.5.0 milestone Oct 15, 2023
@deepnight
Copy link
Owner

Thanks for reporting this issue, I'll have a look for next update 🤔

@deepnight deepnight modified the milestones: 1.5.0, 1.4.2 Oct 15, 2023
@Cammin
Copy link

Cammin commented Oct 17, 2023

I have also had this problem. Here was my process of encountering the problem and what I did to fix it:

When making a new blank project, 2 fields in the JSON file are null. Any additional attempts at saving the project don't write these null values to 16 either.
However, when I close and then reopen the project, and then save, it will properly write these null values to 16.

The big problem is, that these values are not explicitly nullable in the JSON schema, causing my JSON deserializer to fail!
Either these fields should be nullable in the JSON schema, or LDtk should never be able to write these null values in the first place.

image

@deepnight
Copy link
Owner

Fixed in 1.5

Lojemiru added a commit to Lojemiru/LDtk-AM2E that referenced this issue Feb 16, 2024
* Debug cleanup

* Added collapsers to layer panel (wip)

* Tried to fix uncollapsed forms

* Fixed jFormsWrapper

* Fixed tiles panel select default

* Added more columns to rule

* Better rule groups CSS

* Adjusted rules groups CSS

* Rule size is now automatic

* Adjusted default rule values columns

* Fixed crash when deleting level field enum (deepnight#1020)

* Unified fieldDefs tidy (deepnight#1020)

* Fixed exportToToc (deepnight#1019)

* Update empty map

* Fixed log path overflow (deepnight#969)

* Added a UI option for Auto-layer rendering (deepnight#975)

* Changelog

* Fixed crash in Select (deepnight#995)

* Fixed null in defaultEntityWidth/Height (deepnight#980)

* Added CommandPalette (wip, deepnight#1021)

* Better command palette

* Added searchable to FieldDefs

* Added context & fieldDefs search

* Updated help

* Samples

* Added entity search bleep

* Adjusted bleeps

* Added multilines as searchable

* Fixed command palette wrapper CSS

* Minor

* Fixed layers panel title

* Added definitions search

* Fixed crash on world search

* Updated samples

* Changelog

* Docs

* Quicktypes

* GC fix

* Minor

* Cleanup

* Fixed rendering of useless elements in rules panel (deepnight#984)

* GC fixes (deepnight#984)

* Added ctx menu to intGrid values (deepnight#1004)

* Fixed irrelevant __worldX/Y coords in entities (deepnight#1002)

* Docs

* Changelog

* Added manyRules test map

* Updated sample

* Minor help

* Fixed null crash

* Fixed entity ref still displayed while disabled (deepnight#1000, deepnight#759)

* Adjusted external enum buttons size

* Fixed rule copy bug (deepnight#1003)

* Better remap arrows

* Minor

* Changelog

* Added entity allowOutOfBounds flag (deepnight#1014, deepnight#684)

* Fixed support for out-of-bounds entities (deepnight#684)

* Fixed entityTool history

* Fixed tool event canceling

* Fixed null crash in empty projects

* Updated sample

* Help panel fixes

* Fixed macos display shortcuts (deepnight#962)

* Fixed cmd+M macos shortcut (deepnight#962)

* Fixed cmd-H macos shortcut (deepnight#962)

* Unified app commands event

* Fixed Enter shortcut

* Fixed help panel shortcut

* Added macOs Ctrl key support

* Fixed macOs fullscreen shortcut (deepnight#962)

* Added tool appCommand event
Fixed ctrl check
Fixed forced macOs

* Fixed unknown cmd in help panel

* Unified tile shortcuts with app commands

* Updated empty map

* Added edge tiles rendering (deepnight#981)

* Updated samples

* Fixed edge dist check

* Added app settings for edge tiles render dist

* Reworked fading in world level renders

* Edge tiles cleanup

* Changelog

* Updated samples

* Docs

* Quicktypes

* Minor

* Enabled debug display on release builds
Added OS to debug display

* Fixed macOs cmd/ctrl key issue (deepnight#1024)

* Fixed fadeMask in world layers (deepnight#1025)

* Fixed incorrect macOs shortcuts in Help panel

* Cleanup app commands bindings

* Searching again while already searching selects all input text

* Updated README logo

* Removed useless title in readme

* Changelog typo

* Fixed world render layer order

* Optimized LayerDef event invalidation

* Fixed allocs in IntGrid group getter

* Optimized irrelevant rules while drawing (deepnight#1031)

* Fixed optimization to work with groups (deepnight#1031)

* Fixed RuleAdded invalidation (deepnight#1031)

* Fixed pure auto-layers

* Fixed isUsingUnknownIntGridValues()

* Fixed empty rule patterns

* Added separate ruleGroup class

* Renamed rule get/set

* Added rule usedValues cache

* Added group toString

* Added area use count optim

* Added debug flags

* Fixed intGrid optim debug

* Added support for intGrid groups in optim

* Discard irrelevant rules using sub grid (deepnight#1031)

* Fixed debug printer max height

* Fixed world level render

* Cleanup

* Disabled rule invalidation while editing it (deepnight#1031)

* Renamed rule methods

* Inlined layer tags list

* Adjusted layer tags list

* Fixed miss click on level selection (deepnight#1032)

* Fixed null crash on createTileHtmlImageFromRect (deepnight#999)

* Adjusted multi-lines field icon

* Fixed useless init timeline saving (deepnight#1031)

* Added multi lines bug test

* Cleanup

* Quicktypes

* Updated samples

* Docs

* Removed Chrono debug

* Fixed lists in panels

* Right aligned labels

* Changelog

* Chrono init in App

* Cleanup

* Add Col to import

* Optimized layerDefs access (deepnight#1031)

* Added rule radius

* Optimized intGrid layer count check

* Added test maps

* Lab

* Cleanup LayerInstance

* Renamed test map

* Removed useless keys() loop (deepnight#1031)

* Optimized tileset tile access (deepnight#1031)

* Lab

* Fixed world level render iterator

* Minor sample fix

* Added layer async rendering

* Fixed async render

* Better options in layers panel

* Test maps

* Changelog

* Changelog

* Path custom fields will now remember their last open folder for later uses (deepnight#1030)

* Reduced test map

* Cleanup

* Docs

* Quicktypes

* Updated samples

* Archived docs

* Added async render for Tiles layers (deepnight#1036)

* Lab

* Fixed tiles async painting (deepnight#1036)

* Added tilesets defs fast access (deepnight#1035)

* Added Entity defs fast access (deepnight#1035)

* Added Enums defs fast access (deepnight#1035)

* Lab

* Fixed missing Kill Tiles option for IntGrid layers (deepnight#1040)

* Updated test map

* Updated macOS icons (deepnight#1039)

* Updated app icon on macOS (deepnight#1039)

* Fixed advanced options align

* Fixed crash on World creation (deepnight#1038)

* Fixed tool palettes (deepnight#1034)

* Fixed transparent edge tiles (deepnight#1037)

* Fixed Kill Tiles on IntGrid layers (deepnight#1040)

* Minor

* Changelog

* Increased version number

* Docs

* Quicktypes

* Added li arg to LayerInstanceSelected event

* Fixed edge layers alpha (deepnight#1026)

* Fixed IntGrid counts cache when resizing levels (deepnight#1042)

* Fixed Lang null support

* Fixed %depth pattern support (deepnight#717)

* Fixed edge render markAsDone

* Updated samples

* Changelog

* Added test map

* Renamed test map

* Fixed palette lists CSS

* Archived docs

* Updated to latest Heaps

* Increased version

* Updated samples

* Added groupChanged to intGrid value sorting event

* Added ProjectFlagChanged event

* Fixed loading crash on old projects

* Fixed hasModal class not removing

* Added pendingActions menu

* Simplified pendingRebuilds

* Added bug map

* Fixed auto-layer rendering bug

* Changelog

* Test map

* Disabled some weird, probably useless, code

* Added rules invalidated flag

* Reworked rule invalidation

* Minor

* Unified invalidated rules rebuild

* Docs

* Updated Haxe version in test script

* Fixed scripts

* Prepapre merge

* Archived docs

* Fixed edge tiles sticking around (deepnight#1045)

* Changelog

* Minor

* Updated 1.5.2 archives

* Fixed cleanupIdentifier arg type (deepnight#1051)

* Fixed infinite loop in fixUniqueIdStr (deepnight#1051)

* Fixed crash on async painting with no default Tileset (deepnight#1047)

* Fixed crash with new entities (deepnight#1050)

* Keep large image thumbnails from getting stuck (deepnight#1008)

Keep large image thumbnails from getting stuck

* Changelog

* Minor fixes (deepnight#1008)

* Added project cache debug

* Fixed various bugs & optim issues (deepnight#1008)

* Fixed macos Copy/paste menu (deepnight#998)

* Minor fix in deploy checklist

* Added CTRL+click to emulate right click (deepnight#1048)

* Persist tile custom data to Tiled custom properties (deepnight#989)

* adding tile custom data to tiled export custom properties

* match style

* Updated samples

* Added ne,nw,se,sw corners directions for __neighbours

* Changelog

* Increased version

* Docs

* Updated samples

* Updated empty map

* Quicktypes

* Archived docs

* Fixed doc

* last update pre-scary merge

---------

Co-authored-by: Sebastien Benard <github@deepnight.net>
Co-authored-by: hnhhzy <etzhaoyue@vip.qq.com>
Co-authored-by: TomMalitz <tmalitz214@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 Bug Something isn't working Json
Projects
None yet
Development

No branches or pull requests

3 participants