flame icon indicating copy to clipboard operation
flame copied to clipboard

[Dev Tools] Debug Navigation for quick switching between overlays

Open BenAuerDev opened this issue 1 year ago • 1 comments

Problem to solve

When building multiple overlays, I caught myself changing initialActiveOverlays and reloading quite a few times.

Proposal

It would be nice if there was some sort of debug navigation in the dev tools allowing to quickly jump between overlays.

More information

No response

Other

  • [ ] Are you interested in working on a PR for this?

BenAuerDev avatar Dec 14 '24 13:12 BenAuerDev

Great idea, I think this should be fairly trivial to add to the Flame DevTools: https://github.com/flame-engine/flame/blob/main/packages/flame_devtools/README.md

spydon avatar Dec 14 '24 13:12 spydon

Hey @spydon happy new year :rocket:

I had a look at the code of the flame_devtools and tried to get the overlays like:

registerExtension(
  'ext.flame_devtools.getOverlays',
  (method, parameters) async {
    final overlays = game.overlays.activeOverlays;
    return ServiceExtensionResponse.result(
      json.encode({
        'overlays': overlays,
      }),
    );
  },
);

but this returns null if no overlays are active.

Is it possible to access overlayBuilderMap of a game within registerExtension or would it make sense to add the logic to do so?

PS: This is a first draft of the UI part, if you have any remarks or something please let me know :)

screenshot-2025-01-02-11-37-48

BenAuerDev avatar Jan 05 '25 18:01 BenAuerDev

Is it possible to access overlayBuilderMap of a game within registerExtension or would it make sense to add the logic to do so?

I guess you could expose the _builder in OverlayManager too? Or just add a method to get all the overlay keys in there?

PS: This is a first draft of the UI part, if you have any remarks or something please let me know :)

Very nice! I think the overlays section should probably shrink to only take up as little space as it needs, since there will be a lot more components than overlays in most cases, and if there are no overlays it would be good if the section didn't show at all.

Happy new year to you too! :fire:

spydon avatar Jan 05 '25 22:01 spydon