Documentation ¶
Overview ¶
mainmenu package contains main menu and also settings, load/save and new game menus.
Index ¶
- type Console
- type LoadGameMenu
- type LoadingScreen
- type LoginMenu
- type MainMenu
- func (mm *MainMenu) AddPlayableChar(c PlayableCharData)
- func (mm *MainMenu) CloseLoadingScreen()
- func (mm *MainMenu) Console() *Console
- func (mm *MainMenu) Draw(win *mtk.Window)
- func (mm *MainMenu) Exit()
- func (mm *MainMenu) HideMenus()
- func (mm *MainMenu) ImportPlayableChars() error
- func (mm *MainMenu) OpenLoadGameMenu()
- func (mm *MainMenu) OpenLoadingScreen(loadInfo string)
- func (mm *MainMenu) OpenMenu()
- func (mm *MainMenu) OpenNewCharMenu()
- func (mm *MainMenu) OpenNewGameMenu()
- func (mm *MainMenu) OpenSettings()
- func (mm *MainMenu) PlayMainTheme()
- func (mm *MainMenu) PlayableChars() (chars []PlayableCharData)
- func (mm *MainMenu) SetModule(mod *flame.Module)
- func (mm *MainMenu) SetOnGameCreatedFunc(f func(g *game.Game, h *res.HUDData))
- func (mm *MainMenu) SetServer(server *game.Server)
- func (mm *MainMenu) ShowMessage(msg string)
- func (mm *MainMenu) ShowMessageWindow(m *mtk.MessageWindow)
- func (mm *MainMenu) Update(win *mtk.Window)
- type Menu
- type NewCharacterMenu
- type NewGameMenu
- type PlayableCharData
- type Settings
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.
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) Opened ¶
func (lgm *LoadGameMenu) Opened() bool
Opened checks whether menu is open.
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.
type MainMenu ¶
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 (*MainMenu) AddPlayableChar ¶
func (mm *MainMenu) AddPlayableChar(c PlayableCharData)
AddPlaybaleChar adds new playable character to playable characters list.
func (*MainMenu) CloseLoadingScreen ¶
func (mm *MainMenu) CloseLoadingScreen()
CloseLoadingScreen closes loading screen.
func (*MainMenu) ImportPlayableChars ¶
ImportPlayableChars import all characters from current module.
func (*MainMenu) OpenLoadGameMenu ¶
func (mm *MainMenu) OpenLoadGameMenu()
OpenLoadGameMenu opens load game menu.
func (*MainMenu) OpenLoadingScreen ¶
OpenLoadingScreen opens loading screen with specified loading information.
func (*MainMenu) OpenNewCharMenu ¶
func (mm *MainMenu) OpenNewCharMenu()
OpenNewCharMenu opens new character creation menu.
func (*MainMenu) OpenNewGameMenu ¶
func (mm *MainMenu) OpenNewGameMenu()
OpenNewGameMenu opens new game creation menu.
func (*MainMenu) OpenSettings ¶
func (mm *MainMenu) OpenSettings()
OpenSettings opens settings menu.
func (*MainMenu) PlayMainTheme ¶
func (mm *MainMenu) PlayMainTheme()
PlayMainTheme start the main theme menu music.
func (*MainMenu) PlayableChars ¶
func (mm *MainMenu) PlayableChars() (chars []PlayableCharData)
PlayableChars returns all playable characters.
func (*MainMenu) SetOnGameCreatedFunc ¶
SetOnGameCreatedFunc sets specified function as function triggered after new game created.
func (*MainMenu) ShowMessage ¶
ShowMessage creates new message window with specified message and adds it to messages queue.
func (*MainMenu) ShowMessageWindow ¶
func (mm *MainMenu) ShowMessageWindow(m *mtk.MessageWindow)
ShowMessageWindow adds specified message to messages queue and turns message visible(if not visible already).
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
Menu struct represents main menu screen with buttons to other menus.
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) Opened ¶
func (ncm *NewCharacterMenu) Opened() bool
Opened checks whether menu is open.
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) 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) 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.