Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.211.mcz ==================== Summary ==================== Name: EToys-tfel.211 Author: tfel Time: 30 August 2016, 12:26:41.667946 pm UUID: 3b473c59-76cc-5f45-a96c-eab36c25f3fd Ancestors: EToys-tfel.210 optional dependency on ScratchPlugin =============== Diff against EToys-tfel.210 =============== Item was changed: ----- Method: EtoyDAVLoginMorph>>launchBrowser (in category 'actions') ----- launchBrowser ActiveWorld addMorph: self buildPanel centeredNear: Sensor cursorPoint. + (Smalltalk classNamed: 'ScratchPlugin') ifNotNil: [:sp | sp primOpenURL: self url]. - ScratchPlugin primOpenURL: self url. ! Item was changed: ----- Method: FileList2>>loginHit (in category '*Etoys-Squeakland-private') ----- loginHit | s failed ret loginDialog | + (Smalltalk classNamed: 'EtoyDAVLoginMorph') ifNil: [^ false]. loginDialog := modalView valueOfProperty: #loginDialog ifAbsent: [nil]. loginDialog ifNotNil: [^ false]. s := ServerDirectory servers at: 'My Squeakland' ifAbsent: [^ false]. failed := [EtoysUtilities loggedIn: false. loginDialog := nil. s user: nil]. ret := true. + loginDialog := (Smalltalk classNamed: 'EtoyDAVLoginMorph') new. - loginDialog := EtoyDAVLoginMorph new. loginDialog loginAndDo: [:n :p | s ifNotNil: [ s user: n. s password: p. [s copy createPersonalDirectory: n] on: Error do: [:ex | "either directory already exists or could not create. Here, it is just eaten as the following test will tell us whether it can be read."]. [s entries] on: ProtocolClientError, NetworkError do: [:ex | failed value. self inform: 'Login failed.'. ret := false]. ret ifTrue: [Utilities authorName: n. Utilities loggedIn: true]]. self updateLoginButtonAppearance. EtoysUtilities loggedIn ifTrue: [ self directory: directory. brevityState := #FileList. "self addPath: path." self changed: #fileList. self changed: #contents. self changed: #currentDirectorySelected. EToyProjectDetailsMorph updateTripletsFromWebSiteInBackground. ]. loginDialog := nil. true. ] ifCanceled: failed. ! Item was changed: ----- Method: KedamaMorph>>acceptForm: (in category 'event handling') ----- acceptForm: aForm | c xArray yArray colorArray newX newY turtlesByColor colorArrays thisPlayer xArrays yArrays | turtlesDict keysAndValuesDo: [:player :vector | player setTurtleCount: 0]. turtlesByColor := Dictionary new. turtlesDict keysAndValuesDo: [:player :vector | turtlesByColor at: player color put: player]. xArrays := Dictionary new. yArrays := Dictionary new. colorArrays := Dictionary new. 0 to: aForm height do: [:y | 0 to: aForm width do: [:x | c := aForm colorAt: (x@y). c isTransparent ifFalse: [ newX := x. newY := y. ((newX >= 0 and: [newX < (self dimensions * pixelsPerPatch) x]) and: [newY >= 0 and: [newY < (self dimensions * pixelsPerPatch) y]]) ifTrue: [ thisPlayer := turtlesByColor at: c ifAbsentPut: [ turtlesByColor keys + detect: [:thisColor | (thisColor diff: c) < 0.2] + ifFound: [:thisColor | turtlesByColor at: thisColor] - detect: [:color | (color diff: c) < 0.2] - ifFound: [:color | turtlesByColor at: color] ifNone: [ (self player newTurtleSilently color: c; player)]]. xArray := xArrays at: thisPlayer ifAbsentPut: [OrderedCollection new: aForm width * aForm height]. yArray := yArrays at: thisPlayer ifAbsentPut: [OrderedCollection new: aForm width * aForm height]. colorArray := colorArrays at: thisPlayer ifAbsentPut: [OrderedCollection new: aForm width * aForm height]. xArray add: newX asFloat / pixelsPerPatch. yArray add: newY asFloat / pixelsPerPatch. colorArray add: (c pixelValueForDepth: 32). ]. ]. ]. ]. xArrays keysAndValuesDo: [:player :xArry | self makeTurtlesAtPositionsIn: {xArry asArray. (yArrays at: player) asArray. (colorArrays at: player) asArray} examplerPlayer: player ofPrototype: nil. player costume privateTurtleCount: (self turtlesCountOf: player)].! Item was changed: ----- Method: SketchMorph>>blur:form: (in category '*Etoys-Squeakland-filters') ----- blur: aWidth form: filteredForm | f fOut fWidth | aWidth = 0 ifTrue:[^ filteredForm]. f := filteredForm asFormOfDepth: 32. fWidth := f width + (aWidth - 1) max: f width. fOut := f deepCopy. + (Smalltalk classNamed: 'ScratchPlugin') ifNotNil: [:sp | + sp + primBlur: f bits + into: fOut bits + width: fWidth]. - ScratchPlugin - primBlur: f bits - into: fOut bits - width: fWidth. ^ fOut asFormOfDepth: 16! Item was changed: ----- Method: SketchMorph>>brightnessShift:form: (in category '*Etoys-Squeakland-filters') ----- brightnessShift: aShift form: filteredForm | f fOut shift | aShift = 0 ifTrue:[^ filteredForm]. shift := aShift min: 100 max: -100. f := filteredForm asFormOfDepth: 32. fOut := f deepCopy. + (Smalltalk classNamed: 'ScratchPlugin') ifNotNil: [:sp | + sp + primShiftBrightness: f bits + into: fOut bits + by: shift]. - ScratchPlugin - primShiftBrightness: f bits - into: fOut bits - by: shift. ^ fOut asFormOfDepth: 16! Item was changed: ----- Method: SketchMorph>>fishEye:form: (in category '*Etoys-Squeakland-filters') ----- fishEye: aPower form: aForm | f fOut power | aPower = 0 ifTrue:[^aForm]. power := (100 + (aPower * 10)) max:0. f := aForm asFormOfDepth: 32. fOut := f deepCopy. + (Smalltalk classNamed: 'ScratchPlugin') ifNotNil: [:sp | + sp primFisheye: f bits into: fOut bits width: f width power: power]. - ScratchPlugin primFisheye: f bits into: fOut bits width: f width power: power. ^fOut asFormOfDepth: 16! Item was changed: ----- Method: SketchMorph>>hueShift:form: (in category '*Etoys-Squeakland-filters') ----- hueShift: aShift form: filteredForm | f fOut shift | aShift = 0 ifTrue:[^ filteredForm]. shift := aShift min: 360 max: -360. f := filteredForm asFormOfDepth: 32. fOut := f deepCopy. + (Smalltalk classNamed: 'ScratchPlugin') ifNotNil: [:sp | + sp + primShiftHue: f bits + into: fOut bits + byDegrees: shift]. - ScratchPlugin - primShiftHue: f bits - into: fOut bits - byDegrees: shift. ^ fOut asFormOfDepth: 16! Item was changed: ----- Method: SketchMorph>>saturationShift:form: (in category '*Etoys-Squeakland-filters') ----- saturationShift: aShift form: filteredForm | f fOut shift | aShift = 0 ifTrue:[^ filteredForm]. shift := aShift min: 100 max: -100. f := filteredForm asFormOfDepth: 32. fOut := f deepCopy. + (Smalltalk classNamed: 'ScratchPlugin') ifNotNil: [:sp | + sp + primShiftSaturation: f bits + into: fOut bits + by: shift]. - ScratchPlugin - primShiftSaturation: f bits - into: fOut bits - by: shift. ^ fOut asFormOfDepth: 16! Item was changed: ----- Method: SketchMorph>>whirl:form: (in category '*Etoys-Squeakland-filters') ----- whirl: anAngle form: aForm | f fOut | anAngle = 0 ifTrue:[^aForm]. f := aForm asFormOfDepth: 32. fOut := f deepCopy. + (Smalltalk classNamed: 'ScratchPlugin') ifNotNil: [:sp | + sp primWhirl: f bits into: fOut bits width: f width angle: anAngle]. - ScratchPlugin primWhirl: f bits into: fOut bits width: f width angle: anAngle. ^fOut asFormOfDepth: 16! |
Free forum by Nabble | Edit this page |