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

feat(data): Allow wrapped fields to be read as normal object with a single field #1425

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SrGesus
Copy link
Contributor

@SrGesus SrGesus commented Jan 4, 2025

Description

Previously in a scene if you had an object with a single fields you would be forced to type it as a value like so:

"object": "value1"

But that can be inconvenient so now you can also type it like any other object:

"object": {
    "field1": "value1"
}

Checklist

  • Self-review changes.

  • Evaluate impact on the documentation.

  • Ensure test coverage.

  • Write new samples.

  • Add entry to the changelog's unreleased section.

  • Add to data inspector

  • Check every reflection to see if it is a fields type with single field and use wrapper instead

    ./tools/tesseratos/src/tesseratos/voxel_palette_editor/plugin.cpp

    • AssetSelectedEvent

    ./core/src/ecs/cubos.cpp

    • ShouldQuit
    • Arguments

    ./engine/src/ui/text/text_impl.cpp

    • UITextImpl

    ./core/samples/reflection/traits/constructible/main.cpp

    • Scale

    ./engine/src/assets/asset.cpp

    • AnyAsset

    ./engine/samples/scene/main.cpp

    • Num
    • DistanceTo

    ./engine/src/physics/plugin.cpp

    • AccumulatedCorrection
    • CenterOfMass
    • Velocity
    • AngularVelocity

    ./engine/samples/assets/saving/main.cpp

    • IntegerAsset

    ./engine/samples/assets/json/main.cpp

    • Strings

    ./engine/samples/hello-cubos/main.cpp

    • Num
    • Pop

Copy link
Contributor

github-actions bot commented Jan 4, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://GameDevTecnico.github.io/cubos/preview/pr-1425/

Built to branch gh-pages at 2025-01-25 19:18 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

codecov bot commented Jan 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.42%. Comparing base (395ff0d) to head (c7a12db).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1425      +/-   ##
==========================================
- Coverage   53.42%   53.42%   -0.01%     
==========================================
  Files         462      462              
  Lines       25854    25852       -2     
  Branches     2391     2391              
==========================================
- Hits        13813    13811       -2     
  Misses      12041    12041              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SrGesus SrGesus force-pushed the allow-wrapped-field-read branch from c7a12db to f5c63a5 Compare January 25, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant