Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 821c753

Browse files
committed
[[ ideScriptEdited ]] Add ideScriptEdited message
When the script editor field is changed, send a message ideScriptEdited pScript, pObj to any subscribers.
1 parent 1c0338c commit 821c753

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

Toolset/palettes/script editor/behaviors/revsestackbehavior.livecodescript

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,17 @@ end seGetObjectState
797797
# Stores the specified state for the object for later use. And updates any
798798
# script editor components that may depend on this information.
799799
command seSetObjectState pObject, pState
800+
if pState is "edited" then
801+
local tObj
802+
put the long id of pObject into tObj
803+
if not revIDEObjectIsOnIDEStack(tObj) then
804+
local tParams
805+
put the text of field "Script" into tParams[1]
806+
put tObj into tParams[2]
807+
send "ideMessageSendWithParameters" && "ideScriptEdited, tObj, tParams" to stack "revIDELibrary" in 0 milliseconds
808+
end if
809+
end if
810+
800811
# Small optimization, if pState is equal to the current state, don't do anything
801812
if pState is sObjectStates[seGetRuggedId(pObject)] then
802813
exit seSetObjectState

notes/feature-ide_script_edited.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ideScriptEdited message
2+
3+
A new IDE message has been added:
4+
5+
ideScriptEdited pScript, pObj
6+
7+
This message is sent when the script of an object as displayed
8+
in the script editor is changed. pScript contains the current
9+
contents of the script editor field for pObj, which, until applied,
10+
is not necessarily the same as `the script of pObj`.

0 commit comments

Comments
 (0)