HoverRace  2.0
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HoverRace::Client::HoverScript::ConsoleScene Class Reference

UI for the system console. More...

#include <ConsoleScene.h>

+ Inheritance diagram for HoverRace::Client::HoverScript::ConsoleScene:

Classes

class  LogLines
 

Public Member Functions

 ConsoleScene (Display::Display &display, GameDirector &director, SysConsole &console)
 
virtual ~ConsoleScene ()
 
void Advance (Util::OS::timestamp_t tick) override
 
void AttachController (Control::InputEventController &controller, ConnList &conns) override
 Configure the controller mappings. More...
 
void DetachController (Control::InputEventController &controller, ConnList &conns) override
 Remove the controller mappings. More...
 
void PrepareRender () override
 
void Render () override
 
- Public Member Functions inherited from HoverRace::Client::UiScene
 UiScene (const std::string &name="")
 
virtual ~UiScene ()
 
bool IsMouseCursorEnabled () const override
 Determine if the mouse cursor is enabled for this scene. More...
 
- Public Member Functions inherited from HoverRace::Client::Scene
 Scene (const std::string &name="Unnamed Scene")
 Constructor. More...
 
virtual ~Scene ()
 
void AdvanceScene (Util::OS::timestamp_t tick)
 
void AttachInput (Control::InputEventController &controller)
 Attach the user input to the scene. More...
 
void DetachInput (Control::InputEventController &controller)
 Detach the user input from the scene. More...
 
const std::string & GetName () const
 Retrieve the name of the scene. More...
 
Phase GetPhase () const
 
State GetState () const
 
bool MoveToBackground ()
 Signal that the scene is moving into the background. More...
 
bool MoveToForeground ()
 Signal that the scene is moving into the foreground. More...
 
virtual void OnScenePushed ()
 Called when the scene is actually pushed to the stage. More...
 
Sceneoperator= (const Scene &)=delete
 
virtual std::ostream & OutputDebugText (std::ostream &oss) const
 Output a stream of debug information describing this scene. More...
 
void PrepareScene ()
 
void RenderScene ()
 
bool SetPhase (Phase phase)
 Switch to another phase. More...
 

Private Types

using SUPER = UiScene
 

Private Member Functions

void AppendLogLine (const SysConsole::LogLine &line)
 
void Layout () override
 Adjust the size and position of any child elements. More...
 
void OnConsoleBottom ()
 
void OnConsoleDown ()
 
void OnConsoleNextCmd ()
 
void OnConsolePrevCmd ()
 
void OnConsoleToggle ()
 
void OnConsoleTop ()
 
void OnConsoleUp ()
 
void OnDisplayConfigChanged ()
 
void OnLogAdded (int idx)
 
void OnLogCleared ()
 
void OnTextControl (Control::TextControl::key_t key)
 
void OnTextInput (const std::string &s)
 
void UpdateCommandLine ()
 

Private Attributes

Vec2 charSize
 
SysConsoleconsole
 
bool cursorOn
 
Util::OS::timestamp_t cursorTick
 
GameDirectordirector
 
boost::signals2::scoped_connection displayConfigChangedConn
 
std::unique_ptr< Display::ScreenFadefader
 
std::unique_ptr< Display::ActiveTextinputLbl
 
int lastLogIdx
 
bool layoutChanged
 
boost::signals2::scoped_connection logAddedConn
 
boost::signals2::scoped_connection logClearedConn
 
std::unique_ptr< LogLineslogLines
 
bool logsChanged
 
std::unique_ptr< Display::LabelmeasureLbl
 Used to measure the size of glyphs. More...
 

Additional Inherited Members

- Public Types inherited from HoverRace::Client::Scene
enum  Phase {
  Phase::INITIALIZING, Phase::STARTING, Phase::RUNNING, Phase::STOPPING,
  Phase::STOPPED
}
 
enum  State {
  State::INITIALIZING, State::BACKGROUND, State::RAISING, State::FOREGROUND,
  State::LOWERING
}
 
- Protected Member Functions inherited from HoverRace::Client::UiScene
void RequestLayout ()
 Indicate that the current layout is out-of-date and needs to be adjusted. More...
 
void SetFocusRoot (std::shared_ptr< Display::UiViewModel > root)
 Set the widget used as the root for all focus management. More...
 
- Protected Member Functions inherited from HoverRace::Client::Scene
Util::OS::timestamp_t GetPhaseDuration (Util::OS::timestamp_t curTime=Util::OS::Time())
 Calculate how much time we've spent in the current phase. More...
 
Util::OS::timestamp_t GetStartingPhaseTime ()
 Return how long the starting phase lasted. More...
 
Util::OS::timestamp_t GetStateDuration (Util::OS::timestamp_t curTime=Util::OS::Time())
 Calculate how much time we've spent in the current state. More...
 
virtual void OnPhaseChanged (Phase oldPhase)
 Fired immediately after entering a new phase. More...
 
virtual void OnPhaseTransition (double progress)
 Fired during the starting and stopping phases, if SetPhaseTransitionDuration() was set. More...
 
virtual void OnStateChanged (State oldState)
 Fired immediately after entering a new state. More...
 
virtual void OnStateTransition (double progress)
 Fired during the raising and lowering states, if SetStateTransitionDuration() was set. More...
 
void SetPhaseTransitionDuration (Util::OS::timestamp_t ms)
 Set the maximum duration of the starting or stopping phases. More...
 
void SetStateTransitionDuration (Util::OS::timestamp_t ms)
 Set the maximum duration of the raising or lowering state. More...
 
- Protected Attributes inherited from HoverRace::Client::Scene
std::shared_ptr< Util::ProfileradvanceProfiler
 
std::shared_ptr< Util::ProfilerprepareProfiler
 
std::shared_ptr< Util::ProfilerrenderProfiler
 
std::shared_ptr< Util::ProfilerrootProfiler
 

Detailed Description

UI for the system console.

Author
Michael Imamura

Member Typedef Documentation

Constructor & Destructor Documentation

HoverRace::Client::HoverScript::ConsoleScene::ConsoleScene ( Display::Display display,
GameDirector director,
SysConsole console 
)
HoverRace::Client::HoverScript::ConsoleScene::~ConsoleScene ( )
virtual

Member Function Documentation

void HoverRace::Client::HoverScript::ConsoleScene::Advance ( Util::OS::timestamp_t  tick)
overridevirtual

Reimplemented from HoverRace::Client::Scene.

void HoverRace::Client::HoverScript::ConsoleScene::AppendLogLine ( const SysConsole::LogLine line)
private
void HoverRace::Client::HoverScript::ConsoleScene::AttachController ( Control::InputEventController controller,
ConnList conns 
)
overridevirtual

Configure the controller mappings.

This is called whenever the scene becomes the foreground scene or the controller config needs to be rebuilt.

Parameters
controllerThe current controller being used. It can be assumed that the controller's action mappings have been cleared.
connsThe list to manage connections while the input is attached. Any connections added to this list will be automatically disconnected when then the input is detached.

Reimplemented from HoverRace::Client::UiScene.

void HoverRace::Client::HoverScript::ConsoleScene::DetachController ( Control::InputEventController controller,
ConnList conns 
)
overridevirtual

Remove the controller mappings.

Parameters
controllerThe current controller being used. It can be assumed that the controller's action mappings have been cleared.
connsThe same connection list passed to AttachController.

Reimplemented from HoverRace::Client::UiScene.

void HoverRace::Client::HoverScript::ConsoleScene::Layout ( )
overrideprivatevirtual

Adjust the size and position of any child elements.

Subclasses with child elements that are relative to each other should override this function.

This is called automatically during the PrepareRender() phase if RequestLayout() has been called. It is also called the first time PrepareRender() is invoked. After this function is called, it will not be called again until another call to RequestLayout().

Reimplemented from HoverRace::Client::UiScene.

void HoverRace::Client::HoverScript::ConsoleScene::OnConsoleBottom ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnConsoleDown ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnConsoleNextCmd ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnConsolePrevCmd ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnConsoleToggle ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnConsoleTop ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnConsoleUp ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnDisplayConfigChanged ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnLogAdded ( int  idx)
private
void HoverRace::Client::HoverScript::ConsoleScene::OnLogCleared ( )
private
void HoverRace::Client::HoverScript::ConsoleScene::OnTextControl ( Control::TextControl::key_t  key)
private
void HoverRace::Client::HoverScript::ConsoleScene::OnTextInput ( const std::string &  s)
private
void HoverRace::Client::HoverScript::ConsoleScene::PrepareRender ( )
overridevirtual

Reimplemented from HoverRace::Client::UiScene.

void HoverRace::Client::HoverScript::ConsoleScene::Render ( )
overridevirtual

Reimplemented from HoverRace::Client::UiScene.

void HoverRace::Client::HoverScript::ConsoleScene::UpdateCommandLine ( )
private

Member Data Documentation

Vec2 HoverRace::Client::HoverScript::ConsoleScene::charSize
private
SysConsole& HoverRace::Client::HoverScript::ConsoleScene::console
private
bool HoverRace::Client::HoverScript::ConsoleScene::cursorOn
private
Util::OS::timestamp_t HoverRace::Client::HoverScript::ConsoleScene::cursorTick
private
GameDirector& HoverRace::Client::HoverScript::ConsoleScene::director
private
boost::signals2::scoped_connection HoverRace::Client::HoverScript::ConsoleScene::displayConfigChangedConn
private
std::unique_ptr<Display::ScreenFade> HoverRace::Client::HoverScript::ConsoleScene::fader
private
std::unique_ptr<Display::ActiveText> HoverRace::Client::HoverScript::ConsoleScene::inputLbl
private
int HoverRace::Client::HoverScript::ConsoleScene::lastLogIdx
private
bool HoverRace::Client::HoverScript::ConsoleScene::layoutChanged
private
boost::signals2::scoped_connection HoverRace::Client::HoverScript::ConsoleScene::logAddedConn
private
boost::signals2::scoped_connection HoverRace::Client::HoverScript::ConsoleScene::logClearedConn
private
std::unique_ptr<LogLines> HoverRace::Client::HoverScript::ConsoleScene::logLines
private
bool HoverRace::Client::HoverScript::ConsoleScene::logsChanged
private
std::unique_ptr<Display::Label> HoverRace::Client::HoverScript::ConsoleScene::measureLbl
private

Used to measure the size of glyphs.


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