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

Inject the triggering-signal to the command if so requested. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GV3
Copy link

@GV3 GV3 commented Jun 5, 2013

On cases when the instance of the triggering signal is necessary inside the Command it can now be requested it's injection by using the [Inject(name="trigger")] tag in the Command as so:

[Inject(name="trigger")]
public var triggerSignal:ISignal;

This was mainly created to obtain the actual QualifiedClassName of the trigger (ISignal). But many other uses can be also applied.

On cases when the instance of the triggering signal is necessary inside the Command it can now be requested it's injection by  using the [Inject(name="trigger")] tag in the Command as so:

    [Inject(name="trigger")]
    public var triggerSignal:ISignal;

This was mainly created to obtain the actual QualifiedClassName of the trigger (ISignal). But many other uses can be also applied.
@creynders
Copy link
Contributor

I can't quite imagine a use case where this is necessary, i.e. where there's no better approach, but obviously I can be mistaken. Could you provide an example of such a use case?

@GV3
Copy link
Author

GV3 commented Jul 17, 2013

Hi Creynders, Of course!

so, this change was made for the sole purpose of coding a new RL2 library possible.

This library is called SALSA and it stands for "Signal Activated Library (of) Sound Assets".

And it works this way:

The Main Salsa instance will be provided with a list of sounds (.json) that will:

  1. load sound assets
  2. map them to be played or muted on specific Signals.
  3. Manage the overlapping of the sounds and mutes between them.
  4. Supports as well the management of components that individually and independently and manage globally from the parent SALSA the components that individually use SALSA. Allowing the SALSA parent to solve overlapping, mutes, and play the sounds.

The tricky parts came when we started to load sub-swf's and the main SALSA was managing all the components Sounds or child-SALSAS. For this we required to have in the Command the trigger Signal so that we could compare it to the Signals mapped in the children-SALSA. Like I said, specially when we have composition is necessary to have the trigger-Signal injected in such a way.

We will be open-sourcing the lib also. But to open-source the lib only makes sense if the pull-request is merged to the SignalCommandMap else everybody would need to get our fork and would be a bit messy.

@creynders
Copy link
Contributor

Hmmm... I don't quite get why you'd want to use RL for this directly, but probably I'm just not seeing the whole picture. Anyway, a LOT (i.e. everything) has changed in the SCM since you created the PR so it can't be accepted anyhow. That said we could provide the mapping you're looking for, but I'm not sure whether we should. It is an extra (named !) mapping and ... yeah, I don't know, I'm not convinced I guess. But the decision is not mine to make anyway. @pixels4nickels what do you think?

@GV3
Copy link
Author

GV3 commented Jul 17, 2013

I'll clean up a bit the code of the lib and add a READ me so that you can have a look at it and tell us if you maybe see a better solution to our needs. At the time we invested 2 days trying to avoid the named mapping, but honestly had no other weapon left.

I'll post the link here

@matej-snivam
Copy link

I used SALSA library and I can only say that it is amazing. I guess, you could look at code, and maybe suggest the better solution if there is any. If there is not, well it is a great library and great addition for RL

@creynders
Copy link
Contributor

@GV3 cool, let me know when you're ready!

@pixels4nickels
Copy link
Owner

Hey guys,
I am still wanting to see how this need arises. I will take a little look
when it is ready. It would be good to also have a minimal example showing
this need. Sounds like a lovely project.
On Jul 17, 2013 6:01 AM, "creynders" [email protected] wrote:

@GV3 https://github.com/GV3 cool, let me know when you're ready!


Reply to this email directly or view it on GitHubhttps://github.com//pull/21#issuecomment-21110842
.

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.

4 participants