nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::LoginScreen Class Reference

#include <login_screen.h>

Public Member Functions

 LoginScreen (uint64_t content, const ItemTable &items, const figures::Figures &figures, const rig::Rig &rig)
std::optional< protocol::LoginRequest > Build ()
void Render (const Renderer &renderer)
void Show (const protocol::LoginReply &reply)
void ShowError (std::string error)
const std::optional< protocol::WorldListing > & world () const
 The world picked, which a token from an enter request is for.
std::string character_name () const
 The name of the character picked, once it's entering.

Static Public Member Functions

static Figure FigureOf (const protocol::CharacterListing &character, const ItemTable &items, const figures::Figures &figures=figures::Figures::default_instance())

Static Public Attributes

static constexpr int kPreviewWidth = 760
static constexpr int kPreviewHeight = 1012

Detailed Description

Before the world: the account's login, then the worlds, then the account's characters in the world picked, each drawn as it is, turned with the mouse, to pick one to enter as or delete one, and a screen to make a new one on, with its name and how it looks: its build, skin and hair. All of it over embers rising in the dark, with the game's name over the login.

Definition at line 26 of file login_screen.h.

Constructor & Destructor Documentation

◆ LoginScreen()

nanommo::LoginScreen::LoginScreen ( uint64_t content,
const ItemTable & items,
const figures::Figures & figures,
const rig::Rig & rig )
inline

With the ClientHash of this client's content, to tell the worlds that have other content apart, its items, to dress a new character in the kit it'll start with, and its figures and rig, for the looks to choose from.

Definition at line 36 of file login_screen.h.

Member Function Documentation

◆ Build()

std::optional< protocol::LoginRequest > nanommo::LoginScreen::Build ( )

Draws the screen we're on, and returns what to ask the login server, if there's anything: a login, a new account, the characters again, a new or a deleted character, or a token to enter the world as one.

Definition at line 262 of file login_screen.cc.

◆ character_name()

std::string nanommo::LoginScreen::character_name ( ) const

The name of the character picked, once it's entering.

Definition at line 339 of file login_screen.cc.

◆ FigureOf()

Figure nanommo::LoginScreen::FigureOf ( const protocol::CharacterListing & character,
const ItemTable & items,
const figures::Figures & figures = figures::Figures::default_instance() )
static

The character as the preview draws it: its looks, or its id, which they come from for a character from before there were looks to choose, and what it wears, or the kit a fresh one starts with.

Definition at line 223 of file login_screen.cc.

◆ Render()

void nanommo::LoginScreen::Render ( const Renderer & renderer)

Draws the character picked, for the characters' screen, or the one being made, as it's turned, before the frame.

Definition at line 782 of file login_screen.cc.

◆ Show()

void nanommo::LoginScreen::Show ( const protocol::LoginReply & reply)

What the login server said to what Build asked: the session, the worlds and the characters, or an error, such as a name that's taken. A session that's run out goes back to the login.

Definition at line 297 of file login_screen.cc.

◆ ShowError()

void nanommo::LoginScreen::ShowError ( std::string error)
inline

Definition at line 53 of file login_screen.h.

◆ world()

const std::optional< protocol::WorldListing > & nanommo::LoginScreen::world ( ) const
inline

The world picked, which a token from an enter request is for.

Definition at line 56 of file login_screen.h.

Member Data Documentation

◆ kPreviewHeight

int nanommo::LoginScreen::kPreviewHeight = 1012
staticconstexpr

Definition at line 31 of file login_screen.h.

◆ kPreviewWidth

int nanommo::LoginScreen::kPreviewWidth = 760
staticconstexpr

The preview's size, in pixels: enough for it to be sharp at its size on a 4K screen.

Definition at line 30 of file login_screen.h.


The documentation for this class was generated from the following files: