Graphics Quality Changer Plugin

I created a simple plugin to help you switch between graphics quality levels 1 and 21 quickly. I made this because I find myself switching my graphics quality level in Studio settings very often, which can be very tedious. This plugin makes this process much faster, by letting you do this with just one click.

I frequently change my graphics setting because my computer can’t handle running at max graphics all of the time. I normally keep it on quality level 1, but when I need to see farther, see what my game would look like on different devices, or take pictures of my work, I turn my graphics quality up to 21. Using this plugin, you don’t have to go through Studio settings to do this, but can instead just click the button in the corner.

Level 1:
image

Level 21:
image

This plugin supports both light and dark themes:

Here is a link to the plugin:

Or, if you don’t trust random plugins and want to make sure it’s not a virus, here is the source code. The entire plugin is 210 lines long, and is all in just one script.

Plugin source code
local renderSettings = settings():GetService("RenderSettings")
local tweenServ = game:GetService("TweenService")
local studio = settings().Studio

-- UI Instances
local backgroundFrame
local frame
local title
local textButton
local uiGradient
local text1
local text21

-- Create plugin toolbar, button, and widget
local toolbar = plugin:CreateToolbar("Graphics Quality")
local button = toolbar:CreateButton(
	"Menu",
	"Open or close the graphics quality changer menu",
	"rbxassetid://6388524619"
)
local widget = plugin:CreateDockWidgetPluginGui(
	"Graphics Quality Changer",
	DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Left, true, false, 300, 125, 250, 110)
)
local pluginAction = plugin:CreatePluginAction("GraphicsQualityChanger", "Graphics Quality Changer", "Switch between graphics quality level 1 and 21", "rbxassetid://6388524619", true)

-- Values
local buttonTweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint)
local textTweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Exponential)
local level1 = Enum.QualityLevel.Level01
local level21 = Enum.QualityLevel.Level21
local on = false

--<>-- Create UI instances --<>--
 
do
	-- Create an instance
	local function createInstance(className, properties, parent)
		local instance = Instance.new(className)

		for i, v in pairs(properties) do
			instance[i] = v
		end

		if parent then
			instance.Parent = parent
		end

		return instance
	end

	-- Widget background
	backgroundFrame = createInstance("Frame", {
		Size = UDim2.fromScale(1, 1),

		BorderSizePixel = 0,
		Name = "Background"
	}, widget)

	-- Background frame
	frame = createInstance("Frame",{
		AnchorPoint = Vector2.new(0.5, 0.5),
		Size = UDim2.fromOffset(250, 110),
		Position = UDim2.fromScale(0.5, 0.5),

		BackgroundTransparency = 1
	})

	-- Button
	textButton = createInstance("TextButton", {
		AnchorPoint = Vector2.new(0.5, 0),
		Position = UDim2.new(0.5, 0, 0.4, 0),
		Size = UDim2.new(0.75, 0, 0.5, 0),
		
		AutoButtonColor = false,
		ClipsDescendants = true,
		Name = "Button",
		
		BackgroundColor3 = Color3.new(1, 1, 1),

		Text = "",
		TextTransparency = 1
	}, frame)

	-- Button text - 1
	text1 = createInstance("TextLabel", {
		Size = UDim2.fromScale(1, 1),

		BackgroundTransparency = 1,
		Name = "Text1",

		Font = Enum.Font.GothamBold,
		TextSize = 28,
		Text = "1"
	}, textButton)
	
	-- Button text - 21
	text21 = createInstance("TextLabel", {
		Size = UDim2.fromScale(1, 1),

		BackgroundTransparency = 1,
		Name = "Text21",

		Font = Enum.Font.GothamBold,
		TextSize = 28,
		Text = "21"
	}, textButton)

	-- UICorner
	createInstance("UICorner", {
		CornerRadius = UDim.new(0.15, 0)
	}, textButton)

	-- UIGradient
	uiGradient = createInstance("UIGradient", {}, textButton)

	-- Title Text
	title = createInstance("TextLabel", {
		AnchorPoint = Vector2.new(0.5, 0),
		Position = UDim2.fromScale(0.5, 0.1),
		Size = UDim2.fromScale(0.8, 0.2),

		BackgroundTransparency = 1,
		Name = "Title",

		Text = "Graphics Quality Level:",
		Font = Enum.Font.GothamSemibold,
		TextSize = 16
	}, frame)

	frame.Parent = widget
end

--<>-- Update graphics quality level --<>--

-- If graphics setting is set to 21, set on to true; update UIGradient offset
if renderSettings.QualityLevel == level21 and renderSettings.EditQualityLevel == level21 then
	on = true
	
	uiGradient.Offset = Vector2.new(on and 1 or 0, 0)
end

-- Set graphics quality level and button icon
local function updateQualityLevel()
	local level = on and level21 or level1
	renderSettings.QualityLevel = level
	renderSettings.EditQualityLevel = level
end
updateQualityLevel()

-- updateQualityLevel() and tween buttons
local function toggleQualityLevel()
	on = not on
	updateQualityLevel()

	tweenServ:Create(uiGradient, buttonTweenInfo, {Offset = Vector2.new(on and 1 or 0, 0)}):Play()
	tweenServ:Create(text1, textTweenInfo, {Position = UDim2.fromScale(0, on and -1 or 0)}):Play()
	tweenServ:Create(text21, textTweenInfo, {Position = UDim2.fromScale(0, on and 0 or 1)}):Play()
end

-- Set text transparency
text1.Position = UDim2.fromScale(0, on and 1 or 0)
text21.Position = UDim2.fromScale(0, on and 0 or 1)

--<>-- Set UI instance colors --<>--

-- Set UI colors
local function setUIColors()
	local studioTheme = studio.Theme

	local mainBackgroundColor = studioTheme:GetColor(Enum.StudioStyleGuideColor.MainBackground)
	local brightTextColor = studioTheme:GetColor(Enum.StudioStyleGuideColor.BrightText)
	local buttonColor = studioTheme:GetColor(Enum.StudioStyleGuideColor.Titlebar)
	local mainButtonColor = Color3.fromRGB(0, 162, 255)

	backgroundFrame.BackgroundColor3 = mainBackgroundColor
	title.TextColor3 = brightTextColor
	text1.TextColor3 = brightTextColor
	text21.TextColor3 = Color3.fromRGB(229, 229, 229)
	uiGradient.Color = ColorSequence.new({
		ColorSequenceKeypoint.new(0, mainButtonColor),
		ColorSequenceKeypoint.new(0.001, buttonColor),
		ColorSequenceKeypoint.new(1, buttonColor)
	})
end

setUIColors()
studio.ThemeChanged:Connect(setUIColors)

--<>-- Setup --<>--

widget.Name = "GraphicsQualityChanger"
widget.Title = "Graphics Quality Changer"
button:SetActive(widget.Enabled)

-- Set button state
widget:GetPropertyChangedSignal("Enabled"):Connect(function()
	button:SetActive(widget.Enabled)
end)

-- Connect to text button clicks
textButton.MouseButton1Click:Connect(toggleQualityLevel)

-- Connect to PluginAction
pluginAction.Triggered:Connect(toggleQualityLevel)

-- Connect to toolbar button clicks
button.Click:Connect(function()
	widget.Enabled = not widget.Enabled
end)

If you find any bugs or have any suggestions, just leave them in a reply and I’ll try to fix them!

EDIT: First update! You can now set a keybind for changing the graphics quality setting. Just go to File > Advanced > Customize Shortcuts > Search for “Graphics Quality Changer” and set your keybind there. With a keybind set, you don’t even need the plugin widget open for it to work.

14 Likes

Now this is what I call a good plugin! You should allow people to change the quality level to numbers between 1 and 21. :slight_smile:

5 Likes

Thanks! I was thinking about doing that, but that would take longer to make. I might update it with that eventually though.

2 Likes

I believe this one can do that

6 Likes