xparq / Out_of_Nothing

Versatile entity-based simulation & visualization/gamification framework PROTOTYPE
0 stars 0 forks source link

Direct widget updates (e.g. after load) should be disabled in HEADLESS mode #581

Closed xparq closed 3 months ago

xparq commented 3 months ago

Follow-up of #271

E.g., for each test run now:

- Warning: widget "Gravity mode" not found!
- WARNING: Widget "Gravity mode" not found! (WidgetPtr #000000880338E670 has been set to NULL.)
- ERROR: dereferencing NULL widget pointer!
- Warning: widget "Friction" not found!
- WARNING: Widget "Friction" not found! (WidgetPtr #000000880338E670 has been set to NULL.)
- ERROR: dereferencing NULL widget pointer!

due to

void OONApp::_on_snapshot_loaded()
{
    //
    // Sync the UI to reflect the new model state...
    //
    using namespace sfw;

    // Grav. mode:
    gui.set<GravityModeSelector>("Gravity mode", world().gravity_mode);

    // Drag:
    gui.set<Slider>("Friction", world().friction);

    ...
}

It's still safe, though, thanks to SFW's widget access API, but it's way too sloppy and noisy...