-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from TurtIeSocks/various-client-adjustments
various client adjustments
- Loading branch information
Showing
22 changed files
with
191 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"private": true, | ||
"name": "koji", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Tool to make RDM routes", | ||
"main": "server/dist/index.js", | ||
"author": "TurtIeSocks <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react' | ||
import { List, Divider, ListItem } from '@mui/material' | ||
|
||
import ListSubheader from '../../styled/Subheader' | ||
import Toggle from '../inputs/Toggle' | ||
import MultiOptions from '../inputs/MultiOptions' | ||
|
||
export default function DrawingTab() { | ||
return ( | ||
<List dense> | ||
<ListSubheader disableGutters>Drawing Options</ListSubheader> | ||
<Toggle field="snappable" /> | ||
<Toggle field="continueDrawing" /> | ||
<ListItem> | ||
Activate: | ||
<MultiOptions field="setActiveMode" buttons={['hover', 'click']} /> | ||
</ListItem> | ||
<Divider sx={{ my: 2 }} /> | ||
<ListSubheader disableGutters>Vectors</ListSubheader> | ||
<Toggle field="showCircles" /> | ||
<Toggle field="showLines" /> | ||
<Toggle field="showPolygons" /> | ||
<Toggle field="showArrows" /> | ||
</List> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import * as React from 'react' | ||
import { | ||
ToggleButtonGroup, | ||
ToggleButton, | ||
Select, | ||
MenuItem, | ||
} from '@mui/material' | ||
|
||
import { usePersist, type UsePersist } from '@hooks/usePersist' | ||
import { fromCamelCase, fromSnakeCase } from '@services/utils' | ||
import { OnlyType } from '@assets/types' | ||
|
||
export default function MultiOptions< | ||
T extends keyof OnlyType<UsePersist, string>, | ||
K extends UsePersist[T], | ||
>({ | ||
field, | ||
buttons, | ||
disabled = false, | ||
type = 'button', | ||
}: { | ||
field: T | ||
buttons: K[] | ||
disabled?: boolean | ||
type?: 'button' | 'select' | ||
}) { | ||
const value = usePersist((s) => s[field]) | ||
const setStore = usePersist((s) => s.setStore) | ||
|
||
return type === 'button' ? ( | ||
<ToggleButtonGroup | ||
size="small" | ||
color="primary" | ||
value={value} | ||
exclusive | ||
onChange={(_e, v) => setStore(field, v)} | ||
sx={{ mx: 'auto' }} | ||
disabled={disabled} | ||
> | ||
{buttons.map((m) => ( | ||
<ToggleButton key={m} value={m} disabled={disabled}> | ||
{m.includes('_') ? fromSnakeCase(m) : fromCamelCase(m)} | ||
</ToggleButton> | ||
))} | ||
</ToggleButtonGroup> | ||
) : ( | ||
<Select | ||
size="small" | ||
color="primary" | ||
value={value} | ||
onChange={({ target }) => setStore(field, target.value as K)} // Mui y u like this | ||
sx={{ mx: 'auto' }} | ||
disabled={disabled} | ||
> | ||
{buttons.map((m) => ( | ||
<MenuItem key={m} value={m}> | ||
{m.includes('_') ? fromSnakeCase(m) : fromCamelCase(m)} | ||
</MenuItem> | ||
))} | ||
</Select> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.