New feature:When edited

When edited hat block calls stuff on edit.(anything---except what a pre-8.0.0 script could do(i.e variable editing doesn't count))
The first slot lets you choose to monitor which sprite's scripts is being mangled.
You can pull the upvar data out just like pulling the message out of a receive message block.
The data is a list:

  • Which sprite's scripts got mangled
  • Where got mangled(in the categories?pallete?costume tab?sound tab?sprite tab?settings menu?)
  • What got mangled(a script?a variable?a costume?a sound?sprite settings?world settings?)
  • Several additional properties,maybe 2 or 3
  • The data that's being mangled(script xml,variable content,etc)
  • untitled script pic (43)

Code:

                        new List(
                            [spriteName].concat(
                                details
                            ).concat([timestamp])
Language setting will invoke it,either by hand or by extension
                ide.stage.fireUserEditEvent(
                    ide.currentSprite.name,
                        ['project', 'language', lang],
                        ide.version
                    );
                },
"Changes" would invoke it
IDE_Morph.prototype.updateChanges = function (spriteName, details) {
    //snip snip
    this.stage.fireUserEditEvent(
        spriteName || this.currentSprite.name,
        details || [],
        this.version
    );
};
Recording unsaved changes(this is something a lot other stuff would invoke,including restore,editNotes,some stuff about categories,renaming scenes/projects,extensions obj_name and cst_embed,recordUserEdit,) or saving("save","export") would invoke it
IDE_Morph.prototype.recordUnsavedChanges = function (spriteName, details) {
    this.scene.hasUnsavedEdits = true;
    this.updateChanges(spriteName, details);
};

IDE_Morph.prototype.recordSavedChanges = function () {
    this.scenes.itemsArray().forEach(scene => scene.hasUnsavedEdits = false);
    this.updateChanges(this.currentSprite.name, ['project', 'save']);
};
Recording user edits(another thing that a lot stuff invoke,including the macro blocks in control category,sprite setPivot,SpriteMorph.prototype.synchScriptsFrom,sprite setName,making variables/blocks by hand,hide/show blocks,dragging blocks from search panel,deleting/renaming variables by hand,adding costumes/sounds,perpetuateAndEdit,dropped image/audio,duplicating/cloning/releasing sprites,new/edit pivot/renaming/removing costumes,snapshotting/dropping costumes,renaming/removing/dropping sounds,dragging comments/scripts into palete(to destroy them),editing sprite draggability/rotation style by hand,adding sprites,duplicating/deleting blocks by hand,relabeling blocks by hand,custom block update,moving comments,setting label(?),moving blocks,anything on right click menu of blocks,setting input slots,expanding/collapsing comments)
SpriteMorph.prototype.recordUserEdit = function (...details) {
    var ide = this.parentThatIsA(IDE_Morph);
    if (ide) {
        ide.recordUnsavedChanges(
            this.name,
            Array.from(details).concat(details[0] === 'scripts' ?
                [this.scriptsOnlyXML()]
                : []
            )
        );
    }
};

ps:(unrelated) @dardoro,the primitive cst_embed will embed metadata without js function block

What won't trigger the event:

  • Running stuff either by event or script clicking(macro/extension blocks in the script still might trigger events)
  • Variable changing either by script or by hand
  • ListWatcher changing
  • Looking at lists,"open in another dialog",blockify(wont trigger when clicked but will when resulting block put down),changing list display in any way
  • Opening project(saving them would trigger)
  • Blocks running,except a few library/extension blocks and the macro blocks in control category