From 6173d479dd3e84980794778be5b2f02c1b925bf4 Mon Sep 17 00:00:00 2001 From: boatbomber Date: Mon, 27 Oct 2025 12:10:51 -0700 Subject: [PATCH] Only wrap the input in theme --- plugin/src/App/StatusPages/Settings/init.lua | 406 +++++++++---------- 1 file changed, 203 insertions(+), 203 deletions(-) diff --git a/plugin/src/App/StatusPages/Settings/init.lua b/plugin/src/App/StatusPages/Settings/init.lua index 26673b69..a47ad238 100644 --- a/plugin/src/App/StatusPages/Settings/init.lua +++ b/plugin/src/App/StatusPages/Settings/init.lua @@ -83,104 +83,104 @@ function SettingsPage:render() return layoutOrder end - return Theme.with(function(theme) - return Roact.createFragment({ - Navbar = e(Navbar, { - onBack = self.props.onBack, + return Roact.createFragment({ + Navbar = e(Navbar, { + onBack = self.props.onBack, + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + Content = e(ScrollingFrame, { + size = UDim2.new(1, 0, 1, -47), + position = UDim2.new(0, 0, 0, 47), + contentSize = self.contentSize, + transparency = self.props.transparency, + }, { + AutoReconnect = e(Setting, { + id = "autoReconnect", + name = "Auto Reconnect", + description = "Reconnect to server on place open if the served project matches the last sync to the place", transparency = self.props.transparency, layoutOrder = layoutIncrement(), }), - Content = e(ScrollingFrame, { - size = UDim2.new(1, 0, 1, -47), - position = UDim2.new(0, 0, 0, 47), - contentSize = self.contentSize, + + ShowNotifications = e(Setting, { + id = "showNotifications", + name = "Show Notifications", + description = "Popup notifications in viewport", transparency = self.props.transparency, - }, { - AutoReconnect = e(Setting, { - id = "autoReconnect", - name = "Auto Reconnect", - description = "Reconnect to server on place open if the served project matches the last sync to the place", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), + layoutOrder = layoutIncrement(), + }), - ShowNotifications = e(Setting, { - id = "showNotifications", - name = "Show Notifications", - description = "Popup notifications in viewport", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), + SyncReminderMode = e(Setting, { + id = "syncReminderMode", + name = "Sync Reminder", + description = "What type of reminders you receive for syncing your project", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + visible = Settings:getBinding("showNotifications"), - SyncReminderMode = e(Setting, { - id = "syncReminderMode", - name = "Sync Reminder", - description = "What type of reminders you receive for syncing your project", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - visible = Settings:getBinding("showNotifications"), + options = syncReminderModes, + }), - options = syncReminderModes, - }), + SyncReminderPolling = e(Setting, { + id = "syncReminderPolling", + name = "Sync Reminder Polling", + description = "Look for available sync servers periodically", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + visible = Settings:getBindings("syncReminderMode", "showNotifications"):map(function(values) + return values.syncReminderMode ~= "None" and values.showNotifications + end), + }), - SyncReminderPolling = e(Setting, { - id = "syncReminderPolling", - name = "Sync Reminder Polling", - description = "Look for available sync servers periodically", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - visible = Settings:getBindings("syncReminderMode", "showNotifications"):map(function(values) - return values.syncReminderMode ~= "None" and values.showNotifications + ConfirmationBehavior = e(Setting, { + id = "confirmationBehavior", + name = "Confirmation Behavior", + description = "When to prompt for confirmation before syncing", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + + options = confirmationBehaviors, + }), + + LargeChangesConfirmationThreshold = e(Setting, { + id = "largeChangesConfirmationThreshold", + name = "Confirmation Threshold", + description = "How many modified instances to be considered a large change", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + visible = Settings:getBinding("confirmationBehavior"):map(function(value) + return value == "Large Changes" + end), + input = e(TextInput, { + size = UDim2.new(0, 40, 0, 28), + text = Settings:getBinding("largeChangesConfirmationThreshold"):map(function(value) + return tostring(value) end), - }), - - ConfirmationBehavior = e(Setting, { - id = "confirmationBehavior", - name = "Confirmation Behavior", - description = "When to prompt for confirmation before syncing", transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - - options = confirmationBehaviors, + enabled = true, + onEntered = function(text) + local number = tonumber(string.match(text, "%d+")) + if number then + Settings:set("largeChangesConfirmationThreshold", math.clamp(number, 1, 999)) + else + -- Force text back to last valid value + Settings:set( + "largeChangesConfirmationThreshold", + Settings:get("largeChangesConfirmationThreshold") + ) + end + end, }), + }), - LargeChangesConfirmationThreshold = e(Setting, { - id = "largeChangesConfirmationThreshold", - name = "Confirmation Threshold", - description = "How many modified instances to be considered a large change", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - visible = Settings:getBinding("confirmationBehavior"):map(function(value) - return value == "Large Changes" - end), - input = e(TextInput, { - size = UDim2.new(0, 40, 0, 28), - text = Settings:getBinding("largeChangesConfirmationThreshold"):map(function(value) - return tostring(value) - end), - transparency = self.props.transparency, - enabled = true, - onEntered = function(text) - local number = tonumber(string.match(text, "%d+")) - if number then - Settings:set("largeChangesConfirmationThreshold", math.clamp(number, 1, 999)) - else - -- Force text back to last valid value - Settings:set( - "largeChangesConfirmationThreshold", - Settings:get("largeChangesConfirmationThreshold") - ) - end - end, - }), - }), - - Permissions = e(Setting, { - name = "Third Party Permissions", - description = "Manage permissions for third party plugins", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - input = e("TextButton", { + Permissions = e(Setting, { + name = "Third Party Permissions", + description = "Manage permissions for third party plugins", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + input = Theme.with(function(theme) + return e("TextButton", { Text = "", BackgroundTransparency = 1, Size = UDim2.fromOffset(28, 28), @@ -209,124 +209,124 @@ function SettingsPage:render() BackgroundTransparency = 1, }), }), - }), - }), - - PlaySounds = e(Setting, { - id = "playSounds", - name = "Play Sounds", - description = "Toggle sound effects", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), - - EnableSyncFallback = e(Setting, { - id = "enableSyncFallback", - name = "Enable Sync Fallback", - description = "Whether Instances that fail to sync are remade as a fallback. If this is enabled, Instances may be destroyed and remade when syncing.", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), - - CheckForUpdates = e(Setting, { - id = "checkForUpdates", - name = "Check For Updates", - description = "Notify about newer compatible Rojo releases", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), - - CheckForPreleases = e(Setting, { - id = "checkForPrereleases", - name = "Include Prerelease Updates", - description = "Include prereleases when checking for updates", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - visible = if string.find(debug.traceback(), "\n[^\n]-user_.-$") == nil - then false -- Must be a local install to allow prerelease checks - else Settings:getBinding("checkForUpdates"), - }), - - AutoConnectPlaytestServer = e(Setting, { - id = "autoConnectPlaytestServer", - name = "Auto Connect Playtest Server", - description = "Automatically connect game server to Rojo when playtesting while connected in Edit", - tag = "unstable", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), - - OpenScriptsExternally = e(Setting, { - id = "openScriptsExternally", - name = "Open Scripts Externally", - description = "Attempt to open scripts in an external editor", - tag = "unstable", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), - - TwoWaySync = e(Setting, { - id = "twoWaySync", - name = "Two-Way Sync", - description = "Editing files in Studio will sync them into the filesystem", - locked = self.props.syncActive, - lockedTooltip = "(Cannot change while currently syncing. Disconnect first.)", - tag = "unstable", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), - - LogLevel = e(Setting, { - id = "logLevel", - name = "Log Level", - description = "Plugin output verbosity level", - tag = "debug", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - - options = invertedLevels, - showReset = Settings:getBinding("logLevel"):map(function(value) - return value ~= "Info" - end), - onReset = function() - Settings:set("logLevel", "Info") - end, - }), - - TypecheckingEnabled = e(Setting, { - id = "typecheckingEnabled", - name = "Typechecking", - description = "Toggle typechecking on the API surface", - tag = "debug", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), - - TimingLogsEnabled = e(Setting, { - id = "timingLogsEnabled", - name = "Timing Logs", - description = "Toggle logging timing of internal actions for benchmarking Rojo performance", - tag = "debug", - transparency = self.props.transparency, - layoutOrder = layoutIncrement(), - }), - - Layout = e("UIListLayout", { - FillDirection = Enum.FillDirection.Vertical, - SortOrder = Enum.SortOrder.LayoutOrder, - - [Roact.Change.AbsoluteContentSize] = function(object) - self.setContentSize(object.AbsoluteContentSize) - end, - }), - - Padding = e("UIPadding", { - PaddingLeft = UDim.new(0, 20), - PaddingRight = UDim.new(0, 20), - }), + }) + end), }), - }) - end) + + PlaySounds = e(Setting, { + id = "playSounds", + name = "Play Sounds", + description = "Toggle sound effects", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + + EnableSyncFallback = e(Setting, { + id = "enableSyncFallback", + name = "Enable Sync Fallback", + description = "Whether Instances that fail to sync are remade as a fallback. If this is enabled, Instances may be destroyed and remade when syncing.", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + + CheckForUpdates = e(Setting, { + id = "checkForUpdates", + name = "Check For Updates", + description = "Notify about newer compatible Rojo releases", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + + CheckForPreleases = e(Setting, { + id = "checkForPrereleases", + name = "Include Prerelease Updates", + description = "Include prereleases when checking for updates", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + visible = if string.find(debug.traceback(), "\n[^\n]-user_.-$") == nil + then false -- Must be a local install to allow prerelease checks + else Settings:getBinding("checkForUpdates"), + }), + + AutoConnectPlaytestServer = e(Setting, { + id = "autoConnectPlaytestServer", + name = "Auto Connect Playtest Server", + description = "Automatically connect game server to Rojo when playtesting while connected in Edit", + tag = "unstable", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + + OpenScriptsExternally = e(Setting, { + id = "openScriptsExternally", + name = "Open Scripts Externally", + description = "Attempt to open scripts in an external editor", + tag = "unstable", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + + TwoWaySync = e(Setting, { + id = "twoWaySync", + name = "Two-Way Sync", + description = "Editing files in Studio will sync them into the filesystem", + locked = self.props.syncActive, + lockedTooltip = "(Cannot change while currently syncing. Disconnect first.)", + tag = "unstable", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + + LogLevel = e(Setting, { + id = "logLevel", + name = "Log Level", + description = "Plugin output verbosity level", + tag = "debug", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + + options = invertedLevels, + showReset = Settings:getBinding("logLevel"):map(function(value) + return value ~= "Info" + end), + onReset = function() + Settings:set("logLevel", "Info") + end, + }), + + TypecheckingEnabled = e(Setting, { + id = "typecheckingEnabled", + name = "Typechecking", + description = "Toggle typechecking on the API surface", + tag = "debug", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + + TimingLogsEnabled = e(Setting, { + id = "timingLogsEnabled", + name = "Timing Logs", + description = "Toggle logging timing of internal actions for benchmarking Rojo performance", + tag = "debug", + transparency = self.props.transparency, + layoutOrder = layoutIncrement(), + }), + + Layout = e("UIListLayout", { + FillDirection = Enum.FillDirection.Vertical, + SortOrder = Enum.SortOrder.LayoutOrder, + + [Roact.Change.AbsoluteContentSize] = function(object) + self.setContentSize(object.AbsoluteContentSize) + end, + }), + + Padding = e("UIPadding", { + PaddingLeft = UDim.new(0, 20), + PaddingRight = UDim.new(0, 20), + }), + }), + }) end return SettingsPage