So you mean you want to hide your sprite and only use one script? Just put make a variable that hides the sprite when it is equal to one, and then make a new if that shows it if the variable is equal to 0.
Offline
Sunrise-Moon wrote:
So you mean you want to hide your sprite and only use one script? Just put make a variable that hides the sprite when it is equal to one, and then make a new if that shows it if the variable is equal to 0.
No, he means he wants to disable the checkbox near a custom block with an input so it's watcher doesn't say (sprite1's %s [ ]) or something like that.
Offline
It's all in CommandBlockMorph's #canBecomeWatcher
It does both tests for sections of messages (good if all the blocks in a category shoudn't be shown) and individual messages. I have a fix somewhere that replaces the %'s in the strings with the actual parameters, though. If you want it, ask me and I'll dig it out
Last edited by nXIII (2010-07-14 12:17:04)
Offline
Jwosty wrote:
Actually, what I meant is do disable watchers for a specific custom block I made.
I think the only way to do that is to have more than one argument in it.
Offline
nXIII wrote:
It's all in CommandBlockMorph's #canBecomeWatcher
It does both tests for sections of messages (good if all the blocks in a category shoudn't be shown) and individual messages. I have a fix somewhere that replaces the %'s in the strings with the actual parameters, though. If you want it, ask me and I'll dig it out![]()
Oh, thanks! (I didn't seem to see that first part) I'll see if it works!
Last edited by Jwosty (2010-07-24 16:43:40)
Google it.
Offline
It didn't work when I changed the method to this:
canBecomeWatcher
"I determine which blocks can become watchers."
canBecomeWatcher
"I determine which blocks can become watchers."
| i |
i _ selector asString findAnySubStr: #('mouse' 'key' 'touching' 'distance' 'now') startingAt: 1.
^ (self isReporter) &
(self argumentCount <= 1) &
((#(not atRandom abs rounded lineCountOfList: stringLength:) includes: selector) not) &
(i > selector asString size)(The block was called '[day index] now' with a drop down menu)
Help?
Last edited by Jwosty (2010-07-24 17:01:59)
Google it.
Offline
Jwosty wrote:
It didn't work when I changed the method to this:
canBecomeWatcher
"I determine which blocks can become watchers."
Code:
canBecomeWatcher "I determine which blocks can become watchers." | i | i _ selector asString findAnySubStr: #('mouse' 'key' 'touching' 'distance' 'now') startingAt: 1. ^ (self isReporter) & (self argumentCount <= 1) & ((#(not atRandom abs rounded lineCountOfList: stringLength:) includes: selector) not) & (i > selector asString size)(The block was called '[day index] now' with a drop down menu)
Help?
What was the method of the block? (the "#methodName:Here" part) That's what you need to put in the brackets. Odd, but apparently that's how it works.
Offline
I don't know what #metodNameHere part you are talking about...
So, here is the 'blockSpecs' part:
('%t now' r dateTime: 'day index')This is the 'dateTime part:
dateTime: itemName
"returns the date or time selection from a menu"
| hour |
"date"
'year' = itemName ifTrue: [^ Date today year].
'month' = itemName ifTrue: [^ Date today monthName].
'day index' = itemName ifTrue: [^ Date today day].
'full date' = itemName ifTrue: [^ Date today].
'weekday' = itemName ifTrue: [^ Date today weekday].
"time"
'hour' = itemName ifTrue: [(Time now hours > 12) ifTrue:
[ hour:= (Time now hours - 12)]
ifFalse:
[ hour:= Time now hours]. ^ hour.].
'minute' = itemName ifTrue: [^ Time now minutes].
'second' = itemName ifTrue: [^ Time now seconds].
^42dateFunctionNames:
dateFunctionNames
"Answer a collection of date names."
^ #(
'year'
'month'
'day index'
'full date'
'weekday'
'hour'
'minute'
'second' )And finally, the unColoredArgMorphFor: aString (Just the part with my dateTime menu):
$t = code ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #dateFunctionNames; choice: 'day index'].
Thanks!
Google it.
Offline
Jwosty wrote:
I don't know what #metodNameHere part you are talking about...
So, here is the 'blockSpecs' part:Code:
('%t now' r dateTime: 'day index')This is the 'dateTime part: ... Thanks!
![]()
Are you using the source code or Scratch?
If you're using Scratch, put this part ('%t now' #- #dateTime) in the brackets.
If you're using the source code, I don't know what to do at the moment -- let me open up my ancient copy of it and have a look around.
Offline