This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-06-06 17:41:42

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Mesh Patch -Just File it in!-

To add a mesh menu to your mod, or the scratch sourcecode, file all of these in.

To file something in, turn off fill-screen mode, open a workspace, paste one of these codes in, highlight all the code, then click the little button above the scroll bar, click more, and then click file in. 

Code:

'From Gbear605 [No updates present.] on June 6, 2011 for Adding mesh to Scratch'!


!ScratchFrameMorph methodsFor: 'intialization'!
createMenuPanel
    | t1 t2 |
    menuPanel _ AlignmentMorph new color: Color transparent;
             centering: #center;
             inset: 0;
             height: 0.
    self addShortcutButtonsTo: menuPanel.
    t1 _ #((#File #fileMenu:) (#Edit #editMenu:) (#Share #shareMenu:) (#Help #helpMenu:) (#Mesh #meshMenu:) ).
    AllowSharing ifFalse: [t1 _ t1 select: [:t3 | t3 second ~= #shareMenu:]].
    t1 do: 
        [:t3 | 
        t2 _ ScratchMenuTitleMorph new contents: (t3 at: 1) localized;
                 target: self selector: (t3 at: 2).
        menuPanel addMorphBack: t2.
        #meshMenu: = (t3 at: 2) ifFalse: [menuPanel addMorphBack: (Morph new color: Color transparent;
                 extent: 12 @ 5)]].
    topPane addMorph: menuPanel! !


!ScratchFrameMorph methodsFor: 'menu/button actions'!
meshMenu: t1 
    | t2 |
    t2 _ CustomMenu new.
    self addServerCommandsTo: t2.
    t2 localize.
    #(1 ) do: [:t3 | t2 labels at: t3 put: ((t2 labels at: t3)
                copyFrom: 1 to: (t2 labels at: t3) size - 1)
                , ScratchTranslator ellipsesSuffix].
    t2 invokeOn: self at: t1 bottomLeft + (0 @ 10)! !

!ScratchFrameMorph methodsFor: 'menu/button actions'!
addServerCommandsTo: t1 
    | t2 t3 |
    t2 _ false.
    t2 ifTrue: [^ self].
    t1 addLine.
    (workPane scratchServer notNil and: [workPane scratchServer sessionInProgress])
        ifTrue: 
            [t1 add: 'Show IP Address' action: #showNetworkAddress.
            t3 _ workPane scratchServer isHosting
                        ifTrue: ['Stop Hosting Mesh']
                        ifFalse: ['Leave Mesh'].
            t1 add: t3 action: #exitScratchSession]
        ifFalse: 
            [t1 add: 'Host Mesh' action: #startHostingScratchSession.
            t1 add: 'Join Mesh' action: #joinScratchSession]! !

Then save the image, and restart scratch.  There should now be a mesh menu.

Last edited by gbear605 (2011-06-07 14:41:28)


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#2 2011-06-24 18:31:18

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Mesh Patch -Just File it in!-

bump


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#3 2011-06-24 20:13:50

jslomba
Scratcher
Registered: 2009-09-25
Posts: 1000+

Re: Mesh Patch -Just File it in!-

message not understoood: meshMenu:


the the the the the

Offline

 

#4 2011-06-24 21:04:31

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Mesh Patch -Just File it in!-

not for me. Actually, it doesn't even work!!!!!


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#5 2011-06-26 14:55:57

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Mesh Patch -Just File it in!-

You do notice this is not ADDING mesh to scratch, it is simply enabling mesh.  wink  It is just as easy or easier to change the false to true and have mesh, just not the  menu, Making a menu sometimes doesn't work.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

Board footer