plugin: Title bar in session window, clean up Config

This commit is contained in:
Lucien Greathouse
2019-01-04 18:23:07 -08:00
parent 1888c83b6e
commit c57989a790
2 changed files with 175 additions and 148 deletions

View File

@@ -1,5 +1,7 @@
local Roact = require(script:FindFirstAncestor("Rojo").Roact) local Roact = require(script:FindFirstAncestor("Rojo").Roact)
local Config = require(script.Parent.Parent.Config)
local FitList = require(script.Parent.FitList) local FitList = require(script.Parent.FitList)
local FitText = require(script.Parent.FitText) local FitText = require(script.Parent.FitText)
@@ -14,8 +16,8 @@ function ConnectPanel:init()
self.labelSize, self.setLabelSize = Roact.createBinding(Vector2.new()) self.labelSize, self.setLabelSize = Roact.createBinding(Vector2.new())
self:setState({ self:setState({
address = "localhost", address = Config.defaultHost,
port = "34872", port = Config.defaultPort,
}) })
end end
@@ -44,6 +46,29 @@ function ConnectPanel:render()
Position = UDim2.new(0.5, 0, 0, 0), Position = UDim2.new(0.5, 0, 0, 0),
AnchorPoint = Vector2.new(0.5, 0), AnchorPoint = Vector2.new(0.5, 0),
}, },
}, {
Title = e("TextLabel", {
LayoutOrder = 1,
Font = Enum.Font.SourceSans,
TextSize = 22,
Text = "Start Rojo Session",
Size = UDim2.new(1, 0, 0, 28),
BackgroundTransparency = 1,
TextColor3 = Color3.new(1, 1, 1),
}, {
BottomBorder = e("Frame", {
BorderSizePixel = 0,
BackgroundColor3 = Color3.fromRGB(48, 48, 48),
Size = UDim2.new(1, 0, 0, 1),
Position = UDim2.new(0, 0, 1, -1),
}),
}),
Body = e(FitList, {
containerProps = {
BackgroundTransparency = 1,
LayoutOrder = 2,
},
layoutProps = { layoutProps = {
Padding = UDim.new(0, 8), Padding = UDim.new(0, 8),
}, },
@@ -215,6 +240,7 @@ function ConnectPanel:render()
}), }),
}) })
}) })
})
end end
return ConnectPanel return ConnectPanel

View File

@@ -3,5 +3,6 @@ return {
version = {0, 5, 0}, version = {0, 5, 0},
expectedServerVersionString = "0.5.0 or newer", expectedServerVersionString = "0.5.0 or newer",
protocolVersion = 2, protocolVersion = 2,
port = 34872, defaultHost = "localhost",
defaultPort = 34872,
} }