Skip to content

Commit 16a9608

Browse files
authored
Use keycode for hints instead of image
Signed-off-by: GitHub <noreply@github.com>
1 parent 038fe9d commit 16a9608

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/Components/Hotbar.luau

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ local function Hotbar(props: Props)
1616
[React.Tag] = "Hotbar",
1717
}, {
1818
SlotLeftHint = React.createElement(HotbarHint, {
19-
hintImage = UserInputService:GetImageForKeyCode(Enum.KeyCode.ButtonL1),
19+
hintKey = Enum.KeyCode.ButtonL1,
2020
forceVisible = props.forceHintVisible,
2121
order = -1,
2222
}),
2323
SlotRightHint = React.createElement(HotbarHint, {
24-
hintImage = UserInputService:GetImageForKeyCode(Enum.KeyCode.ButtonR1),
24+
hintKey = Enum.KeyCode.ButtonR1,
2525
forceVisible = props.forceHintVisible,
2626
order = 100,
2727
}),

src/Components/HotbarHint.luau

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local UserInputService = game:GetService("UserInputService")
55
local React = require("../../react")
66

77
export type Props = {
8-
hintImage: string,
8+
hintKey: Enum.KeyCode,
99
order: number?,
1010
forceVisible: boolean?,
1111

@@ -39,7 +39,7 @@ local function HotbarHint(props: Props)
3939
local visible = props.forceVisible == true or isGamepadPreferred
4040

4141
return React.createElement("ImageLabel", {
42-
Image = props.hintImage,
42+
Image = UserInputService:GetImageForKeyCode(props.hintKey),
4343
LayoutOrder = props.order,
4444
Visible = visible,
4545
[React.Tag] = "HintSlot",

src/Stories/HotbarHint.story.luau

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ local ReactRoblox = require("../../react-roblox")
66
local HotbarHint = require("../Components/HotbarHint")
77

88
local controls = {
9-
HintImage = "rbxasset://textures/ui/Controls/DesignSystem/ButtonX.png",
109
Visible = true,
1110
}
1211

@@ -16,7 +15,7 @@ return {
1615
controls = controls,
1716
story = function(props)
1817
local component = React.createElement(HotbarHint, {
19-
hintImage = props.controls.HintImage,
18+
hintKey = Enum.KeyCode.ButtonX,
2019
forceVisible = props.controls.Visible,
2120
}, {
2221
StyleLink = React.createElement("StyleLink", {

0 commit comments

Comments
 (0)