Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New UI #367

Merged
merged 47 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7bfac30
Add Flipper
Reselim Nov 20, 2020
b0886cf
Remove old UI
Reselim Nov 20, 2020
0b3adb2
Add boilerplate UI
Reselim Nov 20, 2020
d6f9357
Change plugin version
Reselim Nov 20, 2020
77ba883
Merge upstream
Reselim Nov 20, 2020
ec9059b
Merge remote-tracking branch 'upstream/master' into new-ui
Reselim Nov 20, 2020
6d1d06a
Bunch of new UI changes
Reselim Nov 22, 2020
87d041c
Touch ripple for buttons and a few other things
Reselim Nov 22, 2020
5068849
Make the close button on the PluginGui work
Reselim Nov 22, 2020
fdf6059
Set button state to guiEnabled
Reselim Nov 22, 2020
e9c8413
Implement Connecting, NotConnected; add Header; don't update plugin b…
Reselim Nov 24, 2020
8c7e628
Replace mapLerpColor with mapLerp
Reselim Nov 26, 2020
39cd005
Update blendAlpha to be 0 without any values
Reselim Nov 26, 2020
cbb0bc3
Add ActionFillTransparency to Theme.Button
Reselim Nov 26, 2020
1c1dcd1
Suffix all Theme entries
Reselim Nov 26, 2020
b1a511b
Update Flipper
Reselim Nov 28, 2020
c62dc08
Add disconnect button
Reselim Nov 28, 2020
5e5eb88
Remove cancel button
Reselim Nov 28, 2020
e8cb305
Add settings page
Reselim Nov 29, 2020
e943907
Add scrollbar and dark theme support to settings
Reselim Nov 29, 2020
3f7e1fb
Include settings in startSession
Reselim Nov 29, 2020
7a16413
Set context default value to nil
Reselim Nov 29, 2020
3915193
Add Error page
Reselim Nov 29, 2020
0b21464
Fix preloadAssets
Reselim Nov 29, 2020
8c84b49
Fix preloadAssets import
Reselim Nov 29, 2020
96ee3ad
Update checkbox colors a little
Reselim Nov 29, 2020
d738e2f
Add setting descriptions
Reselim Nov 29, 2020
5526b90
Fix scrolling frame in settings panel
Reselim Nov 29, 2020
4f73633
Remove .vscode
Reselim Dec 1, 2020
d4905be
Rename Throbber to Spinner
Reselim Dec 1, 2020
a78eff5
Update merge
Reselim Dec 1, 2020
d3490a6
Move Spinner images to assets
Reselim Dec 1, 2020
5bb5936
Change casing of directories
Reselim Dec 1, 2020
9ff34da
Remove old directories
Reselim Dec 1, 2020
b9768eb
Add comments to getDerivedStateFromProps
Reselim Dec 2, 2020
20b9371
Account for offset in host TextBox size
Reselim Dec 3, 2020
f07832b
Turn width variables into constants
Reselim Dec 3, 2020
271f74c
Attempt to fix the comments
Reselim Dec 7, 2020
64ff80f
Add a missing comma in Settings
Reselim Dec 7, 2020
b8cca7d
Remove a double space
Reselim Dec 7, 2020
9b581ba
Remove Dummy object
Reselim Dec 7, 2020
a488a08
Move most of the Studio logic out of render
Reselim Dec 7, 2020
8a306f3
Don't truncate port input
Reselim Dec 7, 2020
868aed6
Replace merge with Dictionary.merge
Reselim Dec 7, 2020
0291b16
Replace "Got it!" with "Okay"
Reselim Dec 7, 2020
a40139f
Add projectName to setStatus call
Reselim Dec 14, 2020
5b4bb3b
Add Flipper to build.rs
Reselim Dec 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
url = https://github.com/LPGhatguy/roblox-lua-promise.git
[submodule "plugin/modules/t"]
path = plugin/modules/t
url = https://github.com/osyrisrblx/t.git
url = https://github.com/osyrisrblx/t.git
[submodule "plugin/modules/flipper"]
path = plugin/modules/flipper
url = https://github.com/Reselim/Flipper
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ fn main() -> Result<(), anyhow::Error> {
"t" => VfsSnapshot::dir(hashmap! {
"lib" => snapshot_from_fs_path(&plugin_modules.join("t").join("lib"))?
}),
"flipper" => VfsSnapshot::dir(hashmap! {
"src" => snapshot_from_fs_path(&plugin_modules.join("flipper").join("src"))?
}),
}),
});

Expand Down
2 changes: 1 addition & 1 deletion foreman.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[tools]
rojo = { source = "rojo-rbx/rojo", version = "6.0.0-rc.1" }
rojo = { source = "rojo-rbx/rojo", version = "6.0.0-rc.3" }
run-in-roblox = { source = "rojo-rbx/run-in-roblox", version = "0.3.0" }
3 changes: 3 additions & 0 deletions plugin/default.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
},
"t": {
"$path": "modules/t/lib"
},
"Flipper": {
"$path": "modules/flipper/src"
}
}
}
1 change: 1 addition & 0 deletions plugin/modules/flipper
Submodule flipper added at 4cf7a0
41 changes: 41 additions & 0 deletions plugin/src/App/Components/BorderedContainer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
local Rojo = script:FindFirstAncestor("Rojo")
local Plugin = Rojo.Plugin

local Roact = require(Rojo.Roact)

local Theme = require(Plugin.App.Theme)
local Assets = require(Plugin.Assets)

local SlicedImage = require(script.Parent.SlicedImage)

local e = Roact.createElement

local function BorderedContainer(props)
return Theme.with(function(theme)
return e(SlicedImage, {
slice = Assets.Slices.RoundedBackground,
color = theme.BorderedContainer.BackgroundColor,
transparency = props.transparency,

size = props.size,
position = props.position,
anchorPoint = props.anchorPoint,
layoutOrder = props.layoutOrder,
}, {
Content = e("Frame", {
Size = UDim2.new(1, 0, 1, 0),
BackgroundTransparency = 1,
}, props[Roact.Children]),

Border = e(SlicedImage, {
slice = Assets.Slices.RoundedBorder,
color = theme.BorderedContainer.BorderColor,
transparency = props.transparency,

size = UDim2.new(1, 0, 1, 0),
}),
})
end)
end

return BorderedContainer
96 changes: 96 additions & 0 deletions plugin/src/App/Components/Checkbox.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
local Rojo = script:FindFirstAncestor("Rojo")
local Plugin = Rojo.Plugin

local Roact = require(Rojo.Roact)
local Flipper = require(Rojo.Flipper)

local Assets = require(Plugin.Assets)
local Theme = require(Plugin.App.Theme)
local bindingUtil = require(Plugin.App.bindingUtil)

local SlicedImage = require(script.Parent.SlicedImage)

local e = Roact.createElement

local Checkbox = Roact.Component:extend("Checkbox")

function Checkbox:init()
self.motor = Flipper.SingleMotor.new(self.props.active and 1 or 0)
self.binding = bindingUtil.fromMotor(self.motor)
end

function Checkbox:didUpdate(lastProps)
if lastProps.active ~= self.props.active then
self.motor:setGoal(
Flipper.Spring.new(self.props.active and 1 or 0, {
frequency = 6,
dampingRatio = 1.1,
})
)
end
end

function Checkbox:render()
return Theme.with(function(theme)
theme = theme.Checkbox

local activeTransparency = Roact.joinBindings({
self.binding:map(function(value)
return 1 - value
end),
self.props.transparency,
}):map(bindingUtil.blendAlpha)

return e("ImageButton", {
Size = UDim2.new(0, 28, 0, 28),
Position = self.props.position,
AnchorPoint = self.props.anchorPoint,
LayoutOrder = self.props.layoutOrder,
ZIndex = self.props.zIndex,
BackgroundTransparency = 1,

[Roact.Event.Activated] = self.props.onClick,
}, {
Active = e(SlicedImage, {
slice = Assets.Slices.RoundedBackground,
color = theme.Active.BackgroundColor,
transparency = activeTransparency,
size = UDim2.new(1, 0, 1, 0),
zIndex = 2,
}, {
Icon = e("ImageLabel", {
Image = Assets.Images.Checkbox.Active,
ImageColor3 = theme.Active.IconColor,
ImageTransparency = activeTransparency,

Size = UDim2.new(0, 16, 0, 16),
Position = UDim2.new(0.5, 0, 0.5, 0),
AnchorPoint = Vector2.new(0.5, 0.5),

BackgroundTransparency = 1,
}),
}),

Inactive = e(SlicedImage, {
slice = Assets.Slices.RoundedBorder,
color = theme.Inactive.BorderColor,
transparency = self.props.transparency,
size = UDim2.new(1, 0, 1, 0),
}, {
Icon = e("ImageLabel", {
Image = Assets.Images.Checkbox.Inactive,
ImageColor3 = theme.Inactive.IconColor,
ImageTransparency = self.props.transparency,

Size = UDim2.new(0, 16, 0, 16),
Position = UDim2.new(0.5, 0, 0.5, 0),
AnchorPoint = Vector2.new(0.5, 0.5),

BackgroundTransparency = 1,
}),
}),
})
end)
end

return Checkbox
55 changes: 55 additions & 0 deletions plugin/src/App/Components/Header.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
local Rojo = script:FindFirstAncestor("Rojo")
local Plugin = Rojo.Plugin

local Roact = require(Rojo.Roact)

local Theme = require(Plugin.App.Theme)
local Assets = require(Plugin.Assets)
local Config = require(Plugin.Config)
local Version = require(Plugin.Version)

local e = Roact.createElement

local function Header(props)
return Theme.with(function(theme)
return e("Frame", {
Size = UDim2.new(1, 0, 0, 32),
LayoutOrder = props.layoutOrder,
BackgroundTransparency = 1,
}, {
Logo = e("ImageLabel", {
Image = Assets.Images.Logo,
ImageColor3 = theme.Header.LogoColor,
ImageTransparency = props.transparency,

Size = UDim2.new(0, 60, 0, 27),

LayoutOrder = 1,
BackgroundTransparency = 1,
}),

Version = e("TextLabel", {
Text = Version.display(Config.version),
Font = Enum.Font.Gotham,
TextSize = 14,
TextColor3 = theme.Header.VersionColor,
TextXAlignment = Enum.TextXAlignment.Left,
TextTransparency = props.transparency,

Size = UDim2.new(1, 0, 0, 14),

LayoutOrder = 2,
BackgroundTransparency = 1,
}),

Layout = e("UIListLayout", {
VerticalAlignment = Enum.VerticalAlignment.Center,
FillDirection = Enum.FillDirection.Horizontal,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 15),
}),
})
end)
end

return Header
79 changes: 79 additions & 0 deletions plugin/src/App/Components/IconButton.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
local Rojo = script:FindFirstAncestor("Rojo")
local Plugin = Rojo.Plugin

local Roact = require(Rojo.Roact)
local Flipper = require(Rojo.Flipper)

local Assets = require(Plugin.Assets)
local bindingUtil = require(Plugin.App.bindingUtil)

local HOVER_SPRING_PROPS = {
frequency = 5,
dampingRatio = 1.1,
}

local e = Roact.createElement

local IconButton = Roact.Component:extend("IconButton")

function IconButton:init()
self.motor = Flipper.SingleMotor.new(0)
self.binding = bindingUtil.fromMotor(self.motor)
end

function IconButton:render()
local iconSize = self.props.iconSize

return e("ImageButton", {
Size = UDim2.new(0, iconSize * 1.5, 0, iconSize * 1.5),
Position = self.props.position,
AnchorPoint = self.props.anchorPoint,

LayoutOrder = self.props.layoutOrder,
ZIndex = self.props.zIndex,
BackgroundTransparency = 1,

[Roact.Event.Activated] = self.props.onClick,

[Roact.Event.MouseEnter] = function()
self.motor:setGoal(
Flipper.Spring.new(1, HOVER_SPRING_PROPS)
)
end,

[Roact.Event.MouseLeave] = function()
self.motor:setGoal(
Flipper.Spring.new(0, HOVER_SPRING_PROPS)
)
end,
}, {
Icon = e("ImageLabel", {
Image = self.props.icon,
ImageColor3 = self.props.color,
ImageTransparency = self.props.transparency,

Size = UDim2.new(0, iconSize, 0, iconSize),
Position = UDim2.new(0.5, 0, 0.5, 0),
AnchorPoint = Vector2.new(0.5, 0.5),

BackgroundTransparency = 1,
}),

HoverCircle = e("ImageLabel", {
Image = Assets.Images.Circles[128],
ImageColor3 = self.props.color,
ImageTransparency = Roact.joinBindings({
hover = self.binding,
transparency = self.props.transparency,
}):map(function(values)
return bindingUtil.blendAlpha({ 0.85, 1 - values.hover, values.transparency })
end),

Size = UDim2.new(1, 0, 1, 0),

BackgroundTransparency = 1,
}),
})
end

return IconButton
42 changes: 42 additions & 0 deletions plugin/src/App/Components/ScrollingFrame.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
local Rojo = script:FindFirstAncestor("Rojo")
local Plugin = Rojo.Plugin

local Roact = require(Rojo.Roact)

local Assets = require(Plugin.Assets)
local Theme = require(Plugin.App.Theme)
local bindingUtil = require(Plugin.App.bindingUtil)

local e = Roact.createElement

local function ScrollingFrame(props)
return Theme.with(function(theme)
return e("ScrollingFrame", {
ScrollBarThickness = 9,
ScrollBarImageColor3 = theme.ScrollBarColor,
ScrollBarImageTransparency = props.transparency:map(function(value)
return bindingUtil.blendAlpha({ 0.65, value })
end),
TopImage = Assets.Images.ScrollBar.Top,
MidImage = Assets.Images.ScrollBar.Middle,
BottomImage = Assets.Images.ScrollBar.Bottom,

ElasticBehavior = Enum.ElasticBehavior.Always,
ScrollingDirection = Enum.ScrollingDirection.Y,

Size = props.size,
Position = props.position,
AnchorPoint = props.anchorPoint,
CanvasSize = props.contentSize:map(function(value)
return UDim2.new(0, 0, 0, value.Y)
end),

BorderSizePixel = 0,
BackgroundTransparency = 1,

[Roact.Change.AbsoluteSize] = props[Roact.Change.AbsoluteSize]
}, props[Roact.Children])
end)
end

return ScrollingFrame
29 changes: 29 additions & 0 deletions plugin/src/App/Components/SlicedImage.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local Rojo = script:FindFirstAncestor("Rojo")

local Roact = require(Rojo.Roact)

local e = Roact.createElement

local function SlicedImage(props)
local slice = props.slice

return e("ImageLabel", {
Image = slice.Image,
ImageColor3 = props.color,
ImageTransparency = props.transparency,

ScaleType = Enum.ScaleType.Slice,
SliceCenter = slice.Center,
SliceScale = slice.Scale,

Size = props.size,
Position = props.position,
AnchorPoint = props.anchorPoint,

ZIndex = props.zIndex,
LayoutOrder = props.layoutOrder,
BackgroundTransparency = 1,
}, props[Roact.Children])
end

return SlicedImage
Loading