Qbox-project / qbx_scoreboard

GNU General Public License v3.0
2 stars 9 forks source link

[SUGGESTION] Actions adds itself to the scoreboard #17

Open ArturMichalak opened 4 months ago

ArturMichalak commented 4 months ago

The problem

How about adding an export for adding actions to the dashboard from within the action?

sequenceDiagram
  participant qbx_scoreboard
  participant qbx_jewelery
  participant qbx_bankrobbery
  qbx_scoreboard->>qbx_scoreboard: load config
  qbx_scoreboard->>qbx_jewelery: triggered event: Introduce yourself
  qbx_scoreboard->>qbx_bankrobbery: triggered event: Introduce yourself
  qbx_jewelery->>qbx_scoreboard: export:Register: {Name = 'Jewelery' , RequiredServices...}
  qbx_bankrobbery->>qbx_scoreboard: export:Register: {Name = 'Bank', RequiredServices...}

Ideal solution

Scoreboard on loading sends an event that it is active. Compatible actions send it their metadata.

Alternative solutions

No response

Additional context

No response

mafewtm commented 4 months ago

Gonna have to be more descriptive on this one

ArturMichalak commented 4 months ago

Is the graph enough?

Manason commented 4 months ago

Would it be better if qbx_bankrobbery just checks for the existence of qbx_scoreboard running to decide to call the export? Not sure the purpose of the intro event would be. I guess it would allow any load order, but requiring that scoreboard be loaded first seems like a fine solution.

ArturMichalak commented 4 months ago

The problem could occur when reloading the qbx_scoreboard resource

Manason commented 4 months ago

The problem could occur when reloading the qbx_scoreboard resource

Ok, I see what you are going for. I think other resources could listen for the resource loaded event instead of needing a custom one.

ArturMichalak commented 4 months ago

It's a good idea