choose

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EffectModeSilence = iota
	EffectModeFadeIn
	EffectModeNormal
	EffectModeFadeOut
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart struct {
	MusicFS  fs.FS
	Base     string // For comparing fsys.
	Filename string
	Hash     string // md5 with 16 bytes

	mode.ChartHeader
	Duration         int32
	MainBPM          float64
	MinBPM           float64
	MaxBPM           float64
	AddAtTime        time.Time
	LastUpdateAtTime time.Time
	Level            float64
	NoteCounts       []int
	// Attributes can be added by user, such as
	// Genre, Language, Levels from game clients
	Attributes map[string]any
}

Chart contains information of a chart. Favorites and Played count needs to be checked frequently.

func (Chart) FolderNodeName added in v0.6.0

func (c Chart) FolderNodeName() string

Music name itself may be duplicated. Artist + Title (Music name) may be unique.

func (Chart) NodeName added in v0.6.0

func (c Chart) NodeName() string

type Node added in v0.6.0

type Node struct {
	Parent                   *Node
	PrevSibling, NextSibling *Node
	FirstChild, LastChild    *Node

	Type NodeType
	Data string
}

Inspired by html.Node. But html.Node is too complicated for constructing chart tree.

func (*Node) AppendChild added in v0.6.0

func (n *Node) AppendChild(child *Node)

GPT-4

func (Node) LeafData added in v0.6.0

func (root Node) LeafData() string

func (*Node) Next added in v0.6.0

func (n *Node) Next() *Node

func (*Node) Prev added in v0.6.0

func (n *Node) Prev() *Node

type NodeType added in v0.6.0

type NodeType int
const (
	RootNode NodeType = iota
	FolderNode
	ChartNode
	LeafNode // Hash
)

type PreviewMusicPlayer added in v0.6.0

type PreviewMusicPlayer struct {
	*audios.MusicPlayer
	// MusicVolume *float64
	StartTime  time.Time
	EffectMode int
}

type Scene

type Scene struct {
	*scene.Config
	*scene.Asset

	ctrl.UIKeyListener

	PreviewMusicPlayer

	KeyHandleMusicVolume          func() bool
	KeyHandleSoundVolume          func() bool
	KeyHandleMusicOffset          func() bool
	KeyHandleBackgroundBrightness func() bool
	KeyHandleDebugPrint           func() bool

	// Todo: key handle mode and sub mode.
	// Todo: add 'NoRepeat' option to KeyHandle.
	// KeyHandleMode       func() bool
	// KeyHandleSubMode    func() bool
	KeyHandleSpeedScale func() bool
	// contains filtered or unexported fields
}

func NewScene

func NewScene(cfg *scene.Config, asset *scene.Asset, root fs.FS) (s *Scene, err error)

func (Scene) Draw

func (s Scene) Draw(screen draws.Image)

Background brightness at Song select: 60% (153 / 255), confirmed. Score box color: Gray128 with 50% transparent Hovered Score box color: Gray96 with 50% transparent

func (*Scene) HandleEffect added in v0.6.0

func (s *Scene) HandleEffect()

Memo: osu! seems fading music out when changing music.

func (*Scene) Update

func (s *Scene) Update() any

Node is all in choose scene.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL