mainmenu

package
v0.0.0-...-2b0e672 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-2.0 Imports: 31 Imported by: 0

Documentation

Overview

mainmenu package contains main menu and also settings, load/save and new game menus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct {
	// contains filtered or unexported fields
}

Struct for game console.

func (*Console) Draw

func (c *Console) Draw(win *mtk.Window)

Draw draws console.

func (*Console) Echo

func (c *Console) Echo(text string)

Echo prints specified text to console.

func (*Console) Opened

func (c *Console) Opened() bool

Checks if console is open.

func (*Console) Show

func (c *Console) Show(show bool)

Show toggles console visibility.

func (*Console) Update

func (c *Console) Update(win *mtk.Window)

Update handles key events and updates console.

type LoadGameMenu

type LoadGameMenu struct {
	// contains filtered or unexported fields
}

LoadGameMenu struct represents load game menu.

func (*LoadGameMenu) Draw

func (lgm *LoadGameMenu) Draw(win *mtk.Window)

Draw draws all menu elements in specified window.

func (*LoadGameMenu) Hide

func (lgm *LoadGameMenu) Hide()

Hide hides menu.

func (*LoadGameMenu) Opened

func (lgm *LoadGameMenu) Opened() bool

Opened checks whether menu is open.

func (*LoadGameMenu) Show

func (lgm *LoadGameMenu) Show()

Show shows menu.

func (*LoadGameMenu) Update

func (lgm *LoadGameMenu) Update(win *mtk.Window)

Update updates all menu elements.

type LoadingScreen

type LoadingScreen struct {
	// contains filtered or unexported fields
}

Struct for main menu loading screen.

func (*LoadingScreen) Draw

func (ls *LoadingScreen) Draw(win *mtk.Window)

Draw draws loading screen.

func (*LoadingScreen) SetLoadInfo

func (ls *LoadingScreen) SetLoadInfo(text string)

SetLoadInfo sets specified text as current load info text.

func (*LoadingScreen) Update

func (ls *LoadingScreen) Update(win *mtk.Window)

Update updates loading screen.

type LoginMenu

type LoginMenu struct {
	// contains filtered or unexported fields
}

Struct for login menu.

func (*LoginMenu) Draw

func (lm *LoginMenu) Draw(win *mtk.Window)

Draw draws login menu in specified window.

func (*LoginMenu) Hide

func (lm *LoginMenu) Hide()

Hide hides menu.

func (*LoginMenu) Opened

func (lm *LoginMenu) Opened() bool

Opened checks if menu is open.

func (*LoginMenu) Show

func (lm *LoginMenu) Show()

Show shows menu.

func (*LoginMenu) Update

func (lm *LoginMenu) Update(win *mtk.Window)

Update updates all menu elements.

type MainMenu struct {
	// contains filtered or unexported fields
}

MainMenu struct reperesents container with all menu screens(settings menu, new game menu, etc.). Wraps all main menu screens.

func New

func New() *MainMenu

New creates new main menu

func (mm *MainMenu) AddPlayableChar(c PlayableCharData)

AddPlaybaleChar adds new playable character to playable characters list.

func (mm *MainMenu) CloseLoadingScreen()

CloseLoadingScreen closes loading screen.

func (mm *MainMenu) Console() *Console

Console returns main menu console.

func (mm *MainMenu) Draw(win *mtk.Window)

Draw draws current menu screen.

func (mm *MainMenu) Exit()

Exit sends exit request to main menu.

func (mm *MainMenu) HideMenus()

HideMenus hides all menus.

func (mm *MainMenu) ImportPlayableChars() error

ImportPlayableChars import all characters from current module.

func (mm *MainMenu) OpenLoadGameMenu()

OpenLoadGameMenu opens load game menu.

func (mm *MainMenu) OpenLoadingScreen(loadInfo string)

OpenLoadingScreen opens loading screen with specified loading information.

func (mm *MainMenu) OpenMenu()

OpenMenu opens menu.

func (mm *MainMenu) OpenNewCharMenu()

OpenNewCharMenu opens new character creation menu.

func (mm *MainMenu) OpenNewGameMenu()

OpenNewGameMenu opens new game creation menu.

func (mm *MainMenu) OpenSettings()

OpenSettings opens settings menu.

func (mm *MainMenu) PlayMainTheme()

PlayMainTheme start the main theme menu music.

func (mm *MainMenu) PlayableChars() (chars []PlayableCharData)

PlayableChars returns all playable characters.

func (mm *MainMenu) SetModule(mod *flame.Module)

SetMod sets module for main menu.

func (mm *MainMenu) SetOnGameCreatedFunc(f func(g *game.Game, h *res.HUDData))

SetOnGameCreatedFunc sets specified function as function triggered after new game created.

func (mm *MainMenu) SetServer(server *game.Server)

SetServer sets game server for main menu.

func (mm *MainMenu) ShowMessage(msg string)

ShowMessage creates new message window with specified message and adds it to messages queue.

func (mm *MainMenu) ShowMessageWindow(m *mtk.MessageWindow)

ShowMessageWindow adds specified message to messages queue and turns message visible(if not visible already).

func (mm *MainMenu) Update(win *mtk.Window)

Update updates current menu screen.

type Menu struct {
	// contains filtered or unexported fields
}

Menu struct represents main menu screen with buttons to other menus.

func (m *Menu) Draw(win *mtk.Window)

Draw draws all menu elements in specified window.

func (m *Menu) Hide()

Hide hides menu.

func (m *Menu) Opened() bool

Opened checks whether menu is open.

func (m *Menu) Show()

Show shows menu.

func (m *Menu) Update(win *mtk.Window)

Update updates all menu elements.

type NewCharacterMenu

type NewCharacterMenu struct {
	// contains filtered or unexported fields
}

NewCharacterMenu struct represents new game character creation screen.

func (*NewCharacterMenu) Draw

func (ncm *NewCharacterMenu) Draw(win *mtk.Window)

Draw draws all menu elements in specified window.

func (*NewCharacterMenu) Hide

func (ncm *NewCharacterMenu) Hide()

Hide hides menu.

func (*NewCharacterMenu) Opened

func (ncm *NewCharacterMenu) Opened() bool

Opened checks whether menu is open.

func (*NewCharacterMenu) Show

func (ncm *NewCharacterMenu) Show()

Show shows menu.

func (*NewCharacterMenu) Update

func (ncm *NewCharacterMenu) Update(win *mtk.Window)

Update updates all menu elements.

type NewGameMenu

type NewGameMenu struct {
	// contains filtered or unexported fields
}

NewGameMenu struct represents new game creation screen.

func (*NewGameMenu) Draw

func (ngm *NewGameMenu) Draw(win *mtk.Window)

Draw draws all menu elements in specified window.

func (*NewGameMenu) Hide

func (ngm *NewGameMenu) Hide()

Hide hides menu.

func (*NewGameMenu) Opened

func (ngm *NewGameMenu) Opened() bool

Opened checks whether menu is open.

func (*NewGameMenu) SetCharacters

func (ngm *NewGameMenu) SetCharacters(chars []PlayableCharData)

SetCharacters sets specified avatars as playable characters fo new game start.

func (*NewGameMenu) Show

func (ngm *NewGameMenu) Show()

Show shows menu.

func (*NewGameMenu) Update

func (ngm *NewGameMenu) Update(win *mtk.Window)

Update updates all menu elements.

type PlayableCharData

type PlayableCharData struct {
	flameres.CharacterData
	Avatar res.AvatarData
}

Struct with character and avatar data for playable characters.

type Settings

type Settings struct {
	// contains filtered or unexported fields
}

Settings struct represents main menu settings screen.

func (*Settings) Apply

func (s *Settings) Apply()

Apply applies current settings values.

func (*Settings) Changed

func (s *Settings) Changed() bool

Changed checks if any settings value was changed.

func (*Settings) Draw

func (s *Settings) Draw(win *pixelgl.Window)

Draw draws all menu elements.

func (*Settings) Hide

func (s *Settings) Hide()

Hide hides menu.

func (*Settings) Opened

func (s *Settings) Opened() bool

Opened checks whether menu should be drawn or not.

func (*Settings) Show

func (s *Settings) Show()

Show shows menu.

func (*Settings) Update

func (s *Settings) Update(win *mtk.Window)

Update updates all menu elements.

Jump to

Keyboard shortcuts

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