-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow adjusting settings directly. (#12)
This includes the majority of the common settings for use in generating seeds. Use the gear button to adjust most of the settings. Some will stay in the runtime section immediately below the gear, and Switchsanity items will appear below that if necessary.
- Loading branch information
1 parent
c02153d
commit a3ff4ee
Showing
137 changed files
with
3,510 additions
and
972 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,58 @@ | ||
import { MouseEvent, WheelEvent } from 'react' | ||
|
||
import useDonkStore from '@renderer/store' | ||
import { BananaportRange } from '@renderer/store/common' | ||
import { useShallow } from 'zustand/react/shallow' | ||
|
||
import portFullIcon from '../assets/images/settings/bananaport.png' | ||
import portHalfIcon from '../assets/images/settings/bananaport_isles.png' | ||
|
||
const portToIcon = (num: BananaportRange): string => { | ||
return num == 1 ? portHalfIcon : portFullIcon | ||
} | ||
|
||
const clamp = (num: number): number => Math.min(Math.max(num, 0), 2) | ||
|
||
const nextPort = (num: number): number => clamp(num + 1) | ||
|
||
const prevPort = (num: number): number => clamp(num - 1) | ||
|
||
const BananaportSelector: React.FC = () => { | ||
const [bananaportOpen, setSetting] = useDonkStore( | ||
useShallow((state) => [state.bananaportOpen, state.setSetting]) | ||
) | ||
|
||
const handleNextLevel = (): void => { | ||
setSetting('bananaportOpen', nextPort(bananaportOpen)) | ||
} | ||
|
||
const handlePrevLevel = (e: MouseEvent<HTMLImageElement>): void => { | ||
e.preventDefault() | ||
setSetting('bananaportOpen', prevPort(bananaportOpen)) | ||
} | ||
|
||
const handleWheel = (e: WheelEvent<HTMLImageElement>): void => { | ||
if (e.deltaY >= 0) { | ||
setSetting('bananaportOpen', nextPort(bananaportOpen)) | ||
} else { | ||
setSetting('bananaportOpen', prevPort(bananaportOpen)) | ||
} | ||
} | ||
|
||
return ( | ||
<div> | ||
<img | ||
className="simple-icon" | ||
height={24} | ||
title={bananaportOpen == 0 ? 'None' : bananaportOpen == 1 ? 'Isles' : 'All'} | ||
src={portToIcon(bananaportOpen)} | ||
onClick={handleNextLevel} | ||
onContextMenu={handlePrevLevel} | ||
onWheel={handleWheel} | ||
style={{ filter: `grayscale(${bananaportOpen != 0 ? '0' : '1'})` }} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default BananaportSelector |
Oops, something went wrong.