mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-04-21 04:15:42 +00:00
remove mouse sensitivity value, improve type strictness
This commit is contained in:
parent
8542e07259
commit
d47d3adc27
3 changed files with 53 additions and 26 deletions
|
|
@ -265,9 +265,6 @@ export function InspectorControls({
|
|||
Mouse sensitivity
|
||||
</label>
|
||||
<div className={styles.Control}>
|
||||
<output htmlFor="mouseSensitivityInput">
|
||||
{Math.round(mouseSensitivity * 8000) / 64}
|
||||
</output>
|
||||
<input
|
||||
id="mouseSensitivityInput"
|
||||
type="range"
|
||||
|
|
|
|||
|
|
@ -87,15 +87,33 @@ type PersistedSettings = {
|
|||
};
|
||||
|
||||
export function useSettings() {
|
||||
return useContext(SettingsContext);
|
||||
const context = useContext(SettingsContext);
|
||||
if (!context) {
|
||||
throw new Error(
|
||||
"No SettingsContext found. Did you remember to add a <SettingsProvider>?",
|
||||
);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
export function useDebug() {
|
||||
return useContext(DebugContext);
|
||||
const context = useContext(DebugContext);
|
||||
if (!context) {
|
||||
throw new Error(
|
||||
"No DebugContext found. Did you remember to add a <SettingsProvider>?",
|
||||
);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
export function useControls() {
|
||||
return useContext(ControlsContext);
|
||||
const context = useContext(ControlsContext);
|
||||
if (!context) {
|
||||
throw new Error(
|
||||
"No ControlsContext found. Did you remember to add a <SettingsProvider>?",
|
||||
);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
export function SettingsProvider({ children }: { children: ReactNode }) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue