update ui
This commit is contained in:
parent
d21682999c
commit
2a78f33239
15 changed files with 361 additions and 193 deletions
|
@ -2,8 +2,8 @@ import Roact from "@rbxts/roact"
|
|||
import { useEffect } from "@rbxts/roact-hooked"
|
||||
import { useWorldContext } from "../contexts/worldContext"
|
||||
import { ContextActionService, HttpService } from "@rbxts/services"
|
||||
import Padding from "ReplicatedStorage/ui/components/padding"
|
||||
import Acrylic from "ReplicatedStorage/ui/components/acrylic"
|
||||
import Text from "ReplicatedStorage/ui/components/text"
|
||||
import Surface from "ReplicatedStorage/ui/components/surface"
|
||||
import { Spring } from "@rbxts/flipper"
|
||||
import { useGroupMotor } from "@rbxts/roact-hooked-plus"
|
||||
|
||||
|
@ -28,9 +28,6 @@ function slot(props: SlotProps): Roact.Element {
|
|||
delete spreadableProps.tool
|
||||
|
||||
const [slotBorderColorAndSlotRatio, setSlotGoal] = useGroupMotor([0, 6])
|
||||
const slotBorderColor = slotBorderColorAndSlotRatio.map((t) => t[0]).map((val) => {
|
||||
return Color3.fromHex("#6c7086").Lerp(Color3.fromHex("#b4befe"), val)
|
||||
})
|
||||
const slotRatio = slotBorderColorAndSlotRatio.map((t) => t[1])
|
||||
|
||||
const { clientState } = useWorldContext()
|
||||
|
@ -63,49 +60,25 @@ function slot(props: SlotProps): Roact.Element {
|
|||
})
|
||||
|
||||
return (
|
||||
<frame
|
||||
BackgroundColor3={Color3.fromHex("#1e1e2e")}
|
||||
BackgroundTransparency={.3}
|
||||
Size={new UDim2(1, 0, 1, 0)}
|
||||
<Surface
|
||||
size={new UDim2(1, 0, 1, 0)}
|
||||
position={new UDim2(0, 0, 0, 0)}
|
||||
ratio={slotRatio}
|
||||
>
|
||||
<Acrylic
|
||||
radius={5}
|
||||
distance={0.001}
|
||||
<Text
|
||||
Size={new UDim2(.2, 0, 1, 0)}
|
||||
Text={tostring(index)}
|
||||
paddingY={new UDim(.3, 0)}
|
||||
bold
|
||||
/>
|
||||
<uiaspectratioconstraint
|
||||
AspectRatio={slotRatio}
|
||||
<Text
|
||||
Size={new UDim2(.8, 0, 1, 0)}
|
||||
Position={new UDim2(.2, 0, 0, 0)}
|
||||
TextXAlignment={Enum.TextXAlignment.Left}
|
||||
paddingY={new UDim(.3, 0)}
|
||||
Text={tool.Name}
|
||||
/>
|
||||
<uicorner
|
||||
CornerRadius={new UDim(0, 5)}
|
||||
/>
|
||||
<uistroke
|
||||
Thickness={1}
|
||||
Color={slotBorderColor}
|
||||
/>
|
||||
<frame BackgroundTransparency={1} Size={new UDim2(1, 0, 1, 0)}>
|
||||
<Padding
|
||||
paddingY={new UDim(.3, 0)}
|
||||
/>
|
||||
<textlabel
|
||||
TextColor3={Color3.fromHex("#cdd6f4")}
|
||||
BackgroundTransparency={1}
|
||||
Size={new UDim2(.2, 0, 1, 0)}
|
||||
Font={Enum.Font.GothamBold}
|
||||
Text={tostring(index)}
|
||||
TextScaled
|
||||
/>
|
||||
<textlabel
|
||||
TextColor3={Color3.fromHex("#cdd6f4")}
|
||||
BackgroundTransparency={1}
|
||||
Size={new UDim2(.8, 0, 1, 0)}
|
||||
Position={new UDim2(.2, 0, 0, 0)}
|
||||
Font={Enum.Font.Gotham}
|
||||
Text={tool.Name}
|
||||
TextXAlignment={Enum.TextXAlignment.Left}
|
||||
TextScaled
|
||||
/>
|
||||
</frame>
|
||||
</frame>
|
||||
</Surface>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue