Skip to content

Commit

Permalink
refactor(ui): set screengui name
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxuum committed Aug 6, 2024
1 parent d7ab75c commit d309887
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/ui/src/app/centurion-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export function CenturionApp(client: CenturionClient) {
});

return (
<Layer displayOrder={() => options().displayOrder} visible={visible}>
<Layer
name="Centurion"
displayOrder={() => options().displayOrder}
visible={visible}
>
<Group
anchorPoint={() => options().anchorPoint}
size={() => {
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/ui/group.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Vide, { Derivable } from "@rbxts/vide";

interface GroupProps extends Vide.PropsWithChildren {
name?: Derivable<string>;
size?: Derivable<UDim2>;
position?: Derivable<UDim2>;
anchorPoint?: Derivable<Vector2>;
Expand All @@ -16,6 +17,7 @@ interface GroupProps extends Vide.PropsWithChildren {
export function Group(props: GroupProps) {
return (
<frame
Name={props.name}
Size={props.size || UDim2.fromScale(1, 1)}
Position={props.position}
AnchorPoint={props.anchorPoint}
Expand Down
6 changes: 4 additions & 2 deletions packages/ui/src/components/ui/layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { IS_EDIT } from "../../constants/util";
import { Group } from "./group";

interface LayerProps extends Vide.PropsWithChildren {
name?: Derivable<string>;
visible?: Derivable<boolean>;
displayOrder?: Derivable<number>;
}

export function Layer({ visible, displayOrder, children }: LayerProps) {
export function Layer({ name, visible, displayOrder, children }: LayerProps) {
return IS_EDIT ? (
<Group visible={visible} zIndex={displayOrder}>
<Group name={name} visible={visible} zIndex={displayOrder}>
{children}
</Group>
) : (
Expand All @@ -19,6 +20,7 @@ export function Layer({ visible, displayOrder, children }: LayerProps) {
DisplayOrder={displayOrder}
IgnoreGuiInset
ZIndexBehavior="Sibling"
Name={name}
>
{children}
</screengui>
Expand Down

0 comments on commit d309887

Please sign in to comment.