jMonkeyEngine-Contributions / Lemur

Lemur is a jMonkeyEngine-based UI toolkit.
http://jmonkeyengine-contributions.github.io/Lemur/
BSD 3-Clause "New" or "Revised" License
117 stars 33 forks source link

Panel's runEffect returns false if the effect hasn't got any channel set #53

Closed NemesisMate closed 5 years ago

NemesisMate commented 7 years ago

The Panel's runEffect( String effectName ) method should return true if the effect is present and it could be run and false otherwise. However, if the effect is present but it channel is null it returns false too. This is due to the EffectControl's runEffect( String name, boolean fastForward ) method returning null when there is no channel set on the effect:

    public EffectInfo runEffect( String name, boolean fastForward ) {

       ..................

        EffectInfo result = null;

        if( a != null ) {
            anim().add(a);

            if( channel != null ) {
                // Keep track of it for later
                result = new EffectInfo(name, e, a);
                channels.put(channel, result);
            }            
        }
        return result;
    }
pspeed42 commented 7 years ago

I will take a look at this when I get back from vacation. Thanks for reporting it.

On Thu, Aug 17, 2017 at 8:00 AM, NemesisMate notifications@github.com wrote:

The Panel's runEffect( String effectName ) method should return true if the effect is present and it could be run and false otherwise. However, if the effect is present but it channel is null it returns false too. This is due to the EffectControl's runEffect( String name, boolean fastForward ) method returning null when there is no channel set on the effect:

public EffectInfo runEffect( String name, boolean fastForward ) {

   ..................

    EffectInfo result = null;

    if( a != null ) {
        anim().add(a);

        if( channel != null ) {
            // Keep track of it for later
            result = new EffectInfo(name, e, a);
            channels.put(channel, result);
        }
    }
    return result;
}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jMonkeyEngine-Contributions/Lemur/issues/53, or mute the thread https://github.com/notifications/unsubscribe-auth/AGrfnsCDeSMcr01eLmuCzUFZDfsz0qWaks5sZCtMgaJpZM4O6KV0 .

pspeed42 commented 5 years ago

If you have time and still have a test case then it would be cool if you can try out the fix. Thanks for reporting the issue.

pspeed42 commented 5 years ago

Going to go ahead and close this. If the patch doesn't fix the problem then we can reopen the issue.