diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-25 01:41:56 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-25 01:45:01 +0100 |
commit | 635f872ea40ed6594ed4d89b4ecc13c8ef116658 (patch) | |
tree | c2b58ef4ae2ff7ec3666f0d71e7c3816d59ff84a | |
parent | 252bfd133d77f808c6eea0c9dfc5a7d5d9226fcb (diff) |
now switch to const field readers in inspector
-rw-r--r-- | editor/inspect-types.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/inspect-types.cpp b/editor/inspect-types.cpp index 8a366bfb..b9c3eb6e 100644 --- a/editor/inspect-types.cpp +++ b/editor/inspect-types.cpp @@ -22,7 +22,7 @@ struct entity_accessors<object, inspect_intent_t> { using E = Entity<object>; return std::tuple{ E::type<object_id>::field{"id"_s, - [](const object& x) { return x.id; }, + &object::id, [](object&, object_id) {}, constantly(st::readonly), }, @@ -70,16 +70,16 @@ struct entity_accessors<object, inspect_intent_t> { //constantly(constraints::range{Vector2b(iTILE_SIZE2/-2), Vector2b(iTILE_SIZE2/2)}), }, E::type<pass_mode>::field{"pass-mode"_s, - [](const object& x) { return x.pass; }, + &object::pass, [](object& x, pass_mode value) { x.set_bbox(x.offset, x.bbox_offset, x.bbox_size, value); }, }, E::type<Vector2b>::field{"bbox-offset"_s, - [](const object& x) { return x.bbox_offset; }, + &object::bbox_offset, [](object& x, Vector2b value) { x.set_bbox(x.offset, value, x.bbox_size, x.pass); }, [](const object& x) { return x.pass == pass_mode::pass ? st::readonly : st::enabled; }, }, E::type<Vector2ub>::field{"bbox-size"_s, - [](const object& x) { return x.bbox_size; }, + &object::bbox_size, [](object& x, Vector2ub value) { x.set_bbox(x.offset, x.bbox_offset, value, x.pass); }, [](const object& x) { return x.pass == pass_mode::pass ? st::readonly : st::enabled; }, constantly(constraints::range<Vector2ub>{{1,1}, {255, 255}}), |