Tweak Bootstrap Script Scheduleing

View: New views
2 Messages — Rating Filter:   Alert me  

Tweak Bootstrap Script Scheduleing

by Jens Lincke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

When bootstraping a CWorldPlayer from Morphic the ScriptScheduler is
added in initialize if nil. But already registered Scripts like a
onDragDrop: in a CWorldWorld subclass have no scheduler and get
suspended when triggered...

Is the solution to patch the scheduler into the script in this case
(like Bert Freudenberg proposed) ok?

CWorldPlayer>>initialize
        "Bootstrap a new world"
        super initialize.
        scheduler ifNil:[
                scheduler := ScriptScheduler new.
                "set the context for any newly spawned scripts"
                scheduler run.
                self myScripts do: [:eachScript |
                        eachScript setScheduler: scheduler.
                ]
        ].
         ...


- Jens Lincke -
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

Re: Tweak Bootstrap Script Scheduleing

by Andreas Raab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jens Lincke wrote:
> When bootstraping a CWorldPlayer from Morphic the ScriptScheduler is
> added in initialize if nil. But already registered Scripts like a
> onDragDrop: in a CWorldWorld subclass have no scheduler and get
> suspended when triggered...
>
> Is the solution to patch the scheduler into the script in this case
> (like Bert Freudenberg proposed) ok?

Yes, it's a reasonable workaround. I was hoping that I could reply to
this pointing you to the new and improved island scheme that makes these
hacks unnecessary. Unfortunately, this will take some more time so for
the time being just go with that version.

Cheers,
   - Andreas
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak