Skip to content

Commit

Permalink
12.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
onelivesleft committed Oct 25, 2020
1 parent a14e7f0 commit 545dd22
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 12.4.2
* Fixed confirm dialogs broken by Atom update.
* If you get an error when you try to Get Lua Scripts you need to update Atom.

## 12.4.1
* Fixed goto line number not working with included files.
* Fixed snippet parameter order for onObjectDrop and onObjectPickUp.
Expand Down
14 changes: 6 additions & 8 deletions lib/tabletopsimulator-lua.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1214,22 +1214,23 @@ module.exports = TabletopsimulatorLua =
if atom.config.get('tabletopsimulator-lua.loadSave.communicationMode') == 'disable'
return
# Confirm just in case they misclicked Save & Play
remote.dialog.showMessageBox(remote.getCurrentWindow(), {
promise = remote.dialog.showMessageBox(remote.getCurrentWindow(), {
type: 'info',
normalizeAccessKeys: true,
message: 'Get Lua Scripts from game?'
detailedMessage: 'This will erase any changes that you have made in Atom since the last Save & Play.'
buttons: ['Get Scripts', 'Cancel']
}).then((event) ->
}).then (event) =>
if event.response == 0
#destroyTTSEditors()
#deleteCachedFiles()
log_seperator(LOG_MSG)
log LOG_MSG, "Get Lua Scripts: Sending request to TTS..."
#if not TabletopsimulatorLua.if_connected
TabletopsimulatorLua.startConnection()
TabletopsimulatorLua.connection.wri
)
TabletopsimulatorLua.connection.write '{ messageID: ' + ATOM_MSG_GET_SCRIPTS + ' }'
log LOG_MSG, "Sent."


# hack needed because atom 1.19 makes save() async
blocking_save: (editor) =>
Expand Down Expand Up @@ -1298,11 +1299,8 @@ module.exports = TabletopsimulatorLua =
@blocking_save(editor).then (buffer) =>
log LOG_MSG, buffer.getPath()
savedFiles += 1
if savedFiles == openFiles
if savedFiles == openFiles # Only process the files once we've saved them all.
log LOG_MSG, "All done!"
# This is a horrible hack I feel - we see how many editors are open, then
# run this block after each save, but only do the below code if the
# number of files we have saved is the number of files open. Urgh.

# Read all files into JSON object
@luaObjects = {}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tabletopsimulator-lua",
"main": "./lib/tabletopsimulator-lua",
"version": "12.4.1",
"version": "12.4.2",
"description": "Official plugin for Tabletop Simulator's Lua Scripting.",
"keywords": [
"tabletop",
Expand Down

0 comments on commit 545dd22

Please sign in to comment.