<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Excellent idea! :-) I just added some tests.</p>
<p><br>
</p>
<p>How safe it is ... It works quite well for "simple" MessageSends such as [self forward: 13] or cascades and also supports test and color tiles. However, I did not cover full Smalltalk syntax, so assignments, variables, arrays, return nodes or even FutureNodes
 (I do not even know what they do exactly :D) are not yet supported. It's also a question of design, as EToys does not support most of them. Other special tiles such as for sound or random are neither respected yet. So yes, I would consider it experimental
 for the moment :)</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<p><br>
</p>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Dienstag, 15. Oktober 2019 15:10 Uhr<br>
<b>An:</b> gettimothy via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: EToys-ct.368.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size:10pt; font-family:Arial; color:#000000">
Are there tests for this back-and-forth conversion? How safe is this new feature? May be flag it as experimental? :-)
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid; border-width:1px; margin-top:20px; margin-left:0px; padding-left:10px">
<p style="color:#AAAAAA; margin-top:10px">Am 15.10.2019 14:58:16 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">A new version of EToys was added to project The Inbox:<br>
http://source.squeak.org/inbox/EToys-ct.368.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: EToys-ct.368<br>
Author: ct<br>
Time: 15 October 2019, 2:57:44.969129 pm<br>
UUID: a02688f9-acfd-4240-a068-bdb24539e268<br>
Ancestors: EToys-ct.366<br>
<br>
Changes "revert to tile version" behavior in script editor: Instead of discarding the changed code, always use the new approach and convert the decompiled code back to tiles.<br>
<br>
=============== Diff against EToys-ct.366 ===============<br>
<br>
Item was added:<br>
+ ----- Method: MethodWithInterface>>revertTileVersionFrom:for: (in category 'updating') -----<br>
+ revertTileVersionFrom: anEditor for: playerScripted<br>
+ "Only for universal tiles."<br>
+ <br>
+ anEditor removeAllButFirstSubmorph.<br>
+ anEditor insertUniversalTiles.<br>
+ anEditor showingMethodPane: false!<br>
<br>
Item was changed:<br>
----- Method: ScriptEditorMorph>>revertToTileVersion (in category 'save & revert') -----<br>
revertToTileVersion<br>
"The receiver, currently showing textual code, is asked to revert to the last-saved tile version"<br>
<br>
| aUserScript |<br>
<br>
self <br>
hResizing: #shrinkWrap;<br>
vResizing: #shrinkWrap.<br>
aUserScript := playerScripted class userScriptForPlayer: playerScripted selector: scriptName.<br>
+ aUserScript revertTileVersionFrom: self for: playerScripted.<br>
- aUserScript revertToLastSavedTileVersionFor: self.<br>
self currentWorld startSteppingSubmorphsOf: self!<br>
<br>
Item was changed:<br>
----- Method: ScriptEditorMorph>>toggleWhetherShowingTiles (in category 'other') -----<br>
toggleWhetherShowingTiles<br>
"Toggle between showing the method pane and showing the tiles pane"<br>
<br>
self showingMethodPane<br>
ifFalse: "currently showing tiles"<br>
[self showSourceInScriptor]<br>
+ ifTrue: "currently showing textual source"<br>
+ [self revertToTileVersion]!<br>
- <br>
- ifTrue: "current showing textual source"<br>
- [Preferences universalTiles<br>
- ifTrue: [^ self revertToTileVersion].<br>
- self savedTileVersionsCount >= 1<br>
- ifTrue:<br>
- [(self userScriptObject lastSourceString = (playerScripted class sourceCodeAt: scriptName))<br>
- ifFalse:<br>
- [(self confirm: <br>
- 'Caution -- this script was changed<br>
- textually; if you revert to tiles at this<br>
- point you will lose all the changes you<br>
- may have made textually. Do you<br>
- really want to do this?' translated) ifFalse: [^ self]].<br>
- self revertToTileVersion]<br>
- ifFalse:<br>
- [Beeper beep]]!<br>
<br>
Item was added:<br>
+ ----- Method: UniclassScript>>revertTileVersionFrom:for: (in category 'updating') -----<br>
+ revertTileVersionFrom: anEditor for: playerScripted<br>
+ <br>
+ anEditor removeAllButFirstSubmorph.<br>
+ Preferences universalTiles<br>
+ ifFalse: [<br>
+ ((self playerClass >> self selector) decompile asTileSetForPlayer: playerScripted)<br>
+ withIndexDo: [:tile :index |<br>
+ anEditor insertTileRow: {tile} after: index].<br>
+ anEditor allMorphsDo: #layoutChanged]<br>
+ ifTrue: [<br>
+ anEditor insertUniversalTiles].<br>
+ anEditor showingMethodPane: false.<br>
+ isTextuallyCoded := false.!<br>
<br>
Item was added:<br>
+ ----- Method: UserScript>>revertTileVersionFrom:for: (in category 'versions') -----<br>
+ revertTileVersionFrom: anEditor for: playerScripted<br>
+ <br>
+ anEditor removeAllButFirstSubmorph.<br>
+ ((self playerClass >> self selector) decompile asTileSetForPlayer: playerScripted)<br>
+ withIndexDo: [:tile :index |<br>
+ anEditor insertTileRow: {tile} after: index].<br>
+ anEditor allMorphsDo: #layoutChanged.<br>
+ anEditor showingMethodPane: false.<br>
+ self becomeTextuallyCoded.!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>