The Trunk: EToys-cmm.131.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: EToys-cmm.131.mcz

commits-2
Chris Muller uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-cmm.131.mcz

==================== Summary ====================

Name: EToys-cmm.131
Author: cmm
Time: 11 September 2015, 4:59:34.968 pm
UUID: 94d94c4d-c84a-4e56-9697-3b550241e7f6
Ancestors: EToys-eem.130

Fix some preference accessing due to the recent change to Preferences class>>#doesNotUnderstand:.

=============== Diff against EToys-eem.130 ===============

Item was changed:
  ----- Method: Morph class>>additionsToViewerCategoryUserEvents (in category '*eToys-customevents-user events') -----
  additionsToViewerCategoryUserEvents
  "Answer further viewer additions relating to user-defined events; these appear in the 'scripting' category"
 
+ ^ (Preferences valueOfFlag: #allowEtoyUserCustomEvents)
- ^ Preferences allowEtoyUserCustomEvents
  ifTrue: [ #(scripting (
  (command triggerCustomEvent: 'trigger a user-defined (global) event' CustomEvents)
  (slot triggeringObject 'the object that is triggering an event, either user-defined or pre-defined' Player readOnly Player getTriggeringObject unused unused)))]
  ifFalse: [#(scripting ())]!

Item was changed:
  ----- Method: Morph>>enforceTileColorPolicy (in category '*Etoys-support') -----
  enforceTileColorPolicy
+ (Preferences valueOfFlag: #coloredTilesEnabled)
- Preferences coloredTilesEnabled
  ifTrue:
  [self makeAllTilesColored]
  ifFalse:
  [self makeAllTilesGreen]!

Item was changed:
  ----- Method: Player>>getAllowEtoyUserCustomEvents (in category 'slot getters/setters') -----
  getAllowEtoyUserCustomEvents
  "Answer whether to use the vector vocabulary."
 
+ ^ Preferences valueOfFlag: #allowEtoyUserCustomEvents!
- ^ Preferences allowEtoyUserCustomEvents!

Item was changed:
  ----- Method: ScriptInstantiation>>presentScriptStatusPopUp (in category 'customevents-status control') -----
  presentScriptStatusPopUp
  "Put up a menu of status alternatives and carry out the request"
 
  | reply  m menu submenu |
 
  menu := MenuMorph new.
  self addStatusChoices: #( normal " -- run when called" ) toMenu: menu.
  self addStatusChoices:
  #( paused "ready to run all the time"
  ticking "run all the time" )
  toMenu: menu.
  self addStatusChoices: (ScriptingSystem standardEventStati copyFrom: 1 to: 3) toMenu: menu.
  self addStatusChoices: (ScriptingSystem standardEventStati allButFirst: 3) toMenu: menu.
  self addStatusChoices:
  #(opening "when I am being opened"
  closing "when I am being closed" )
  toMenu: menu.
 
  submenu := MenuMorph new.
  self addStatusChoices: (ScriptingSystem globalCustomEventNamesFor: player) toSubMenu: submenu forMenu: menu.
  menu add: 'more... ' translated subMenu: submenu.
 
+ (Preferences valueOfFlag: #allowEtoyUserCustomEvents) ifTrue: [
- (Preferences allowEtoyUserCustomEvents) ifTrue: [
  submenu addLine.
  self addStatusChoices: ScriptingSystem userCustomEventNames toSubMenu: submenu forMenu: menu.
  submenu addLine.
  self addStatusChoices:
  (Array streamContents: [ :s | s nextPut: { 'define a new custom event'. #defineNewEvent }.
  ScriptingSystem userCustomEventNames isEmpty
  ifFalse: [ s nextPut: { 'delete a custom event'. #deleteCustomEvent } ]])
  toSubMenu: submenu forMenu: menu ].
 
  menu addLine.
 
  self addStatusChoices: #(
  ('what do these mean?'explainStatusAlternatives)
  ('apply my status to all siblings' assignStatusToAllSiblings) ) toMenu: menu.
 
  menu addTitle: 'When should this script run?' translated.
  menu submorphs last delete.
  menu invokeModal.
 
  reply := menu modalSelection.
 
  reply == #explainStatusAlternatives ifTrue: [^ self explainStatusAlternatives].
  reply == #assignStatusToAllSiblings ifTrue: [^ self assignStatusToAllSiblings].
  reply == #defineNewEvent ifTrue: [ ^self defineNewEvent ].
  reply == #deleteCustomEvent ifTrue: [ ^self deleteCustomEvent ].
 
  reply ifNotNil:
  [self status: reply.  "Gets event handlers fixed up"
  reply == #paused ifTrue:
  [m := player costume.
  (m isKindOf: SpeakerMorph) ifTrue: [m stopSound]].
  self updateAllStatusMorphs]
  !

Item was changed:
  ----- Method: StandardScriptingSystem>>statusHelpStringFor: (in category '*Etoys-customevents-help dictionary') -----
  statusHelpStringFor: aPlayer
  ^String streamContents: [ :stream |
  stream nextPutAll: 'normal -- run when called
  paused -- ready to run all the time
  ticking -- run all the time
  mouseDown -- run when mouse goes down on me
  mouseStillDown -- while mouse still down
  mouseUp -- when mouse comes back up
  mouseEnter -- when mouse enters my bounds, button up
  mouseLeave -- when mouse exits my bounds, button up
  mouseEnterDragging -- when mouse enters my bounds, button down
  mouseLeaveDragging -- when mouse exits my bounds, button down
  opening -- when I am being opened
  closing -- when I am being closed' translated.
 
  "'keyStroke -- run when user hits a key' "
 
  stream cr; cr; nextPutAll: 'More events:' translated; cr.
 
  (self customEventNamesAndHelpStringsFor: aPlayer) do: [ :array |
  stream cr;
  nextPutAll: array first;
  nextPutAll: ' -- '.
  array second do: [ :help | stream nextPutAll: help translated ]
  separatedBy: [ stream nextPutAll: ' or ' translated ]].
 
+ (Preferences valueOfFlag: #allowEtoyUserCustomEvents) ifTrue: [
- (Preferences allowEtoyUserCustomEvents) ifTrue: [
  self userCustomEventNames isEmpty ifFalse: [
  stream cr; cr; nextPutAll: 'User custom events:' translated; cr.
  self currentWorld userCustomEventsRegistry keysAndValuesDo: [ :key :value |
  stream cr; nextPutAll: key; nextPutAll: ' -- '; nextPutAll: value ]]]]!