From d6af38eba1bdf52a7f44194cb00a5e64fa1833b6 Mon Sep 17 00:00:00 2001 From: reidlab Date: Sun, 13 Aug 2023 10:03:18 -0700 Subject: [PATCH] revamp hotbar ui --- readme.md | 2 + .../StarterPlayerScripts/ui/hotbar/hotbar.tsx | 48 ++++++------ .../StarterPlayerScripts/ui/hotbar/slot.tsx | 76 ++++++++----------- 3 files changed, 57 insertions(+), 69 deletions(-) diff --git a/readme.md b/readme.md index 24d58b7..ae6b618 100644 --- a/readme.md +++ b/readme.md @@ -7,6 +7,8 @@ An in-dev game that I plan to make a shooter game out of. — reidlab +# Ui theming is based on Catppucin Mocha. You can find the colors [here](https://github.com/catppuccin/catppuccin) and the style guide [here](https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md) + # Hacks * I get a strange error about private identifiers in [`./src/ReplicatedStorage/ecs/state.ts`](./src/ReplicatedStorage/ecs/state.ts) * I decided to omit the "TS" folder from [`./default.project.json:40`](./default.project.json) due to the script override not working in Health.server.ts in StarterCharacterScripts. diff --git a/src/StarterPlayer/StarterPlayerScripts/ui/hotbar/hotbar.tsx b/src/StarterPlayer/StarterPlayerScripts/ui/hotbar/hotbar.tsx index ad20962..0c370af 100644 --- a/src/StarterPlayer/StarterPlayerScripts/ui/hotbar/hotbar.tsx +++ b/src/StarterPlayer/StarterPlayerScripts/ui/hotbar/hotbar.tsx @@ -27,38 +27,36 @@ const hotbar: Hooks.FC = (props, hooks) => { Enum.KeyCode.Six, Enum.KeyCode.Seven, Enum.KeyCode.Eight, - Enum.KeyCode.Nine + Enum.KeyCode.Nine, + // idk if this works + Enum.KeyCode.Zero ] return ( - - - - { - clientState.backpack.GetChildren().map((tool, i) => ( - - )) - } - + + + { + clientState.backpack.GetChildren().map((tool, i) => ( + + )) + } ) } diff --git a/src/StarterPlayer/StarterPlayerScripts/ui/hotbar/slot.tsx b/src/StarterPlayer/StarterPlayerScripts/ui/hotbar/slot.tsx index b9e790c..926d8d0 100644 --- a/src/StarterPlayer/StarterPlayerScripts/ui/hotbar/slot.tsx +++ b/src/StarterPlayer/StarterPlayerScripts/ui/hotbar/slot.tsx @@ -44,50 +44,38 @@ const slot: Hooks.FC = (props, hooks) => { }) return ( - - { - handleActivated() - } - }} - > - - - - - - - - - - - - + + + + + + ) }