From bc60ca94625cc19372a14691a0a492440220c3f7 Mon Sep 17 00:00:00 2001 From: NcxyZero Date: Tue, 30 Jul 2024 19:21:36 +0200 Subject: [PATCH 1/3] SyncLock --- plugin/src/App/init.lua | 29 ++++++++++++++++------------- plugin/src/Settings.lua | 1 + 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index bd21765d0..4632e7c32 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -299,7 +299,7 @@ function App:getHostAndPort() return if #host > 0 then host else Config.defaultHost, if #port > 0 then port else Config.defaultPort end -function App:isSyncLockAvailable() +function App:isSyncLockAvailable() if #Players:GetPlayers() == 0 then -- Team Create is not active, so no one can be holding the lock return true @@ -408,21 +408,24 @@ function App:useRunningConnectionInfo() end function App:startSession() - local claimedLock, priorOwner = self:claimSyncLock() - if not claimedLock then - local msg = string.format("Could not sync because user '%s' is already syncing", tostring(priorOwner)) + local syncLockEnabled = Settings:get("SyncLock") - Log.warn(msg) - self:addNotification(msg, 10) - self:setState({ - appStatus = AppStatus.Error, - errorMessage = msg, - toolbarIcon = Assets.Images.PluginButtonWarning, - }) + if syncLockEnabled then + local claimedLock, priorOwner = self:claimSyncLock() + if not claimedLock then + local msg = string.format("Could not sync because user '%s' is already syncing", tostring(priorOwner)) - return - end + Log.warn(msg) + self:addNotification(msg, 10) + self:setState({ + appStatus = AppStatus.Error, + errorMessage = msg, + toolbarIcon = Assets.Images.PluginButtonWarning, + }) + return + end + end local host, port = self:getHostAndPort() local baseUrl = if string.find(host, "^https?://") diff --git a/plugin/src/Settings.lua b/plugin/src/Settings.lua index 67f13ba21..86ee0231d 100644 --- a/plugin/src/Settings.lua +++ b/plugin/src/Settings.lua @@ -13,6 +13,7 @@ local defaultSettings = { openScriptsExternally = false, twoWaySync = false, showNotifications = true, + syncLock = true, syncReminder = true, autoConnectPlaytestServer = false, confirmationBehavior = "Initial", From 826354652526214db1e68df53eda86ec5440e05f Mon Sep 17 00:00:00 2001 From: NcxyZero Date: Tue, 30 Jul 2024 22:44:01 +0200 Subject: [PATCH 2/3] SyncLock --- plugin/src/App/StatusPages/Settings/init.lua | 8 ++++++++ plugin/src/App/init.lua | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugin/src/App/StatusPages/Settings/init.lua b/plugin/src/App/StatusPages/Settings/init.lua index 70f835084..3a842833c 100644 --- a/plugin/src/App/StatusPages/Settings/init.lua +++ b/plugin/src/App/StatusPages/Settings/init.lua @@ -104,6 +104,14 @@ function SettingsPage:render() layoutOrder = layoutIncrement(), }), + SyncLock = e(Setting, { + id = "syncLock", + name = "Sync Lock", + description = "Toggle sync lock", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + SyncReminder = e(Setting, { id = "syncReminder", name = "Sync Reminder", diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index 4632e7c32..5ef5e78b3 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -408,7 +408,7 @@ function App:useRunningConnectionInfo() end function App:startSession() - local syncLockEnabled = Settings:get("SyncLock") + local syncLockEnabled = Settings:get("syncLock") if syncLockEnabled then local claimedLock, priorOwner = self:claimSyncLock() From 4f7d3a2eaa6696e178500d3c89a21d6d3e35b46d Mon Sep 17 00:00:00 2001 From: NcxyZero Date: Wed, 31 Jul 2024 00:26:53 +0200 Subject: [PATCH 3/3] modified: CHANGELOG.md modified: Cargo.lock modified: Cargo.toml modified: plugin/Version.txt --- CHANGELOG.md | 3 +++ Cargo.lock | 2 +- Cargo.toml | 2 +- plugin/Version.txt | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13fed6f27..051e37d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Rojo Changelog +## [7.4.3] - 31 July, 2024 +* Added Sync lock toggle + ## Unreleased Changes * Projects may now manually link `Ref` properties together using `Attributes`. ([#843]) This has two parts: using `id` or `$id` in JSON files or a `Rojo_Target` attribute, an Instance diff --git a/Cargo.lock b/Cargo.lock index 1b2ae1809..3f9ffc602 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1752,7 +1752,7 @@ dependencies = [ [[package]] name = "rojo" -version = "7.4.0" +version = "7.4.3" dependencies = [ "anyhow", "backtrace", diff --git a/Cargo.toml b/Cargo.toml index a35ccd942..d9da31900 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rojo" -version = "7.4.0" +version = "7.4.3" rust-version = "1.70.0" authors = ["Lucien Greathouse "] description = "Enables professional-grade development tools for Roblox developers" diff --git a/plugin/Version.txt b/plugin/Version.txt index b61671799..a263a9c3a 100644 --- a/plugin/Version.txt +++ b/plugin/Version.txt @@ -1 +1 @@ -7.4.0 \ No newline at end of file +7.4.3 \ No newline at end of file