Class name doesn't show up on new project [FIXED]

(Read-only) To re-open a bug, start a new thread in the Bugs forum.

Moderator: MSandro

Locked
bromagosa
Posts: 33
Joined: Sep 15th, '15, 07:11

Class name doesn't show up on new project [FIXED]

Post by bromagosa » Sep 15th, '15, 08:43

When creating a new project -or when opening the UI-, the current class name doesn't show up in the Classes list. You need to create a new class and delete it to get it to show up.

bromagosa
Posts: 33
Joined: Sep 15th, '15, 07:11

Re: Class name doesn't show up on new project

Post by bromagosa » Sep 17th, '15, 12:58

I've just fixed this little bug. Or at least I think so.

In Scripter.gp, line 500, (Scripter >> createInitialClass) instead of:

Code: Select all

targetObj = (instantiate className (stageMorph this))
restoreScripts this
saveScripts this
It should read:

Code: Select all

setTargetObj this (instantiate className (stageMorph this))
setTargetObj does already do restoreScripts and saveScripts, so I removed them from createInitialClass as well.

I'm attaching the file, but really this is the only change I made:
Attachments
Scripter.gp
(22.04 KiB) Downloaded 291 times

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Class name doesn't show up on new project

Post by JohnM » Sep 17th, '15, 13:37

Thanks, Bernat!

FYI, we're probably going to change the design of the classes/instances library updating model to one based on "polling" (with cheap detection of changes). There are simply too many different places in the code that can effect the classes/instances library. That feature was added right before the Scratch conference and, although we kept fixing glitches, new ones kept popping up. That suggests that the design itself could be improved.

Meanwhile, it's great to have your fix.

Locked