Mana
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Client Class Referencefinal

The core part of the client. More...

#include <client.h>

Inheritance diagram for Client:

Classes

struct  Options
 A structure holding the values of various options that can be passed from the command line. More...
 

Public Member Functions

 Client (const Options &options)
 
 ~Client () override
 
int exec ()
 
void update ()
 
void showOkDialog (const std::string &title, const std::string &message, State state)
 Pops up an OkDialog with the given title and message, and switches to the given state when Ok is pressed.
 
void showErrorDialog (const std::string &message, State state)
 Pops up an error dialog with the given message, and switches to the given state when Ok is pressed.
 
void action (const gcn::ActionEvent &event) override
 
void handleWindowSizeChanged (int width, int height)
 Should be called after the window has been resized.
 
void checkGraphicsSize ()
 

Static Public Member Functions

static Clientinstance ()
 Provides access to the client instance.
 
static void setState (State state)
 
static State getState ()
 
static const std::string & getPackageDirectory ()
 
static const std::string & getConfigDirectory ()
 
static const std::string & getLocalDataDirectory ()
 
static const std::string & getScreenshotDirectory ()
 
static VideogetVideo ()
 
static bool isActive ()
 
static bool hasInputFocus ()
 
static bool hasMouseFocus ()
 

Private Member Functions

void initRootDir ()
 
void initHomeDir ()
 Initializes the home directory.
 
void initConfiguration ()
 Initialize configuration.
 
bool initUpdatesDir ()
 Parse the update host and determine the updates directory Then verify that the directory exists (creating if needed).
 
void initScreenshotDir ()
 
void accountLogin (LoginData *loginData)
 

Private Attributes

Options mOptions
 
std::string mPackageDir
 
std::string mConfigDir
 
std::string mLocalDataDir
 
std::string mUpdateHost
 
std::string mUpdatesDir
 
std::string mScreenshotDir
 
std::string mRootDir
 
ServerInfo mCurrentServer
 
Video mVideo
 
GamemGame = nullptr
 
WindowmCurrentDialog = nullptr
 
QuitDialogmQuitDialog = nullptr
 
DesktopmDesktop = nullptr
 
ButtonmSetupButton = nullptr
 
State mState = STATE_CHOOSE_SERVER
 
State mOldState = STATE_START
 
State mStateAfterOkDialog
 
SDL_Surface * mIcon = nullptr
 
SDL_TimerID mSecondsCounterId = 0
 
FpsManager mFpsManager
 

Static Private Attributes

static ClientmInstance = nullptr
 

Detailed Description

The core part of the client.

This class initializes all subsystems, runs the event loop, and shuts everything down again.

Definition at line 112 of file client.h.

Constructor & Destructor Documentation

◆ Client()

Client::Client ( const Options options)

Definition at line 172 of file client.cpp.

◆ ~Client()

Client::~Client ( )
override

Definition at line 398 of file client.cpp.

Member Function Documentation

◆ accountLogin()

void Client::accountLogin ( LoginData loginData)
private

Definition at line 1226 of file client.cpp.

◆ action()

void Client::action ( const gcn::ActionEvent &  event)
override

Definition at line 984 of file client.cpp.

◆ checkGraphicsSize()

void Client::checkGraphicsSize ( )

Definition at line 1253 of file client.cpp.

◆ exec()

int Client::exec ( )

Definition at line 435 of file client.cpp.

◆ getConfigDirectory()

static const std::string & Client::getConfigDirectory ( )
inlinestatic

Definition at line 178 of file client.h.

◆ getLocalDataDirectory()

static const std::string & Client::getLocalDataDirectory ( )
inlinestatic

Definition at line 181 of file client.h.

◆ getPackageDirectory()

static const std::string & Client::getPackageDirectory ( )
inlinestatic

Definition at line 175 of file client.h.

◆ getScreenshotDirectory()

static const std::string & Client::getScreenshotDirectory ( )
inlinestatic

Definition at line 184 of file client.h.

◆ getState()

static State Client::getState ( )
inlinestatic

Definition at line 172 of file client.h.

◆ getVideo()

static Video & Client::getVideo ( )
inlinestatic

Definition at line 187 of file client.h.

◆ handleWindowSizeChanged()

void Client::handleWindowSizeChanged ( int  width,
int  height 
)

Should be called after the window has been resized.

Makes sure the GUI and game adapt to the new size.

Definition at line 1246 of file client.cpp.

◆ hasInputFocus()

bool Client::hasInputFocus ( )
static

Definition at line 1276 of file client.cpp.

◆ hasMouseFocus()

bool Client::hasMouseFocus ( )
static

Definition at line 1281 of file client.cpp.

◆ initConfiguration()

void Client::initConfiguration ( )
private

Initialize configuration.

Definition at line 1110 of file client.cpp.

◆ initHomeDir()

void Client::initHomeDir ( )
private

Initializes the home directory.

On UNIX and FreeBSD, ~/.mana is used. On Windows and other systems we use the current working directory.

Definition at line 1058 of file client.cpp.

◆ initRootDir()

void Client::initRootDir ( )
private

Definition at line 1003 of file client.cpp.

◆ initScreenshotDir()

void Client::initScreenshotDir ( )
private

Definition at line 1195 of file client.cpp.

◆ initUpdatesDir()

bool Client::initUpdatesDir ( )
private

Parse the update host and determine the updates directory Then verify that the directory exists (creating if needed).

Definition at line 1128 of file client.cpp.

◆ instance()

static Client * Client::instance ( )
inlinestatic

Provides access to the client instance.

Definition at line 149 of file client.h.

◆ isActive()

bool Client::isActive ( )
static

Definition at line 1271 of file client.cpp.

◆ setState()

static void Client::setState ( State  state)
inlinestatic

Definition at line 169 of file client.h.

◆ showErrorDialog()

void Client::showErrorDialog ( const std::string &  message,
State  state 
)

Pops up an error dialog with the given message, and switches to the given state when Ok is pressed.

Definition at line 979 of file client.cpp.

◆ showOkDialog()

void Client::showOkDialog ( const std::string &  title,
const std::string &  message,
State  state 
)

Pops up an OkDialog with the given title and message, and switches to the given state when Ok is pressed.

Definition at line 970 of file client.cpp.

◆ update()

void Client::update ( )

Definition at line 509 of file client.cpp.

Member Data Documentation

◆ mConfigDir

std::string Client::mConfigDir
private

Definition at line 217 of file client.h.

◆ mCurrentDialog

Window* Client::mCurrentDialog = nullptr
private

Definition at line 228 of file client.h.

◆ mCurrentServer

ServerInfo Client::mCurrentServer
private

Definition at line 224 of file client.h.

◆ mDesktop

Desktop* Client::mDesktop = nullptr
private

Definition at line 230 of file client.h.

◆ mFpsManager

FpsManager Client::mFpsManager
private

Definition at line 240 of file client.h.

◆ mGame

Game* Client::mGame = nullptr
private

Definition at line 227 of file client.h.

◆ mIcon

SDL_Surface* Client::mIcon = nullptr
private

Definition at line 237 of file client.h.

◆ mInstance

Client * Client::mInstance = nullptr
staticprivate

Definition at line 212 of file client.h.

◆ mLocalDataDir

std::string Client::mLocalDataDir
private

Definition at line 218 of file client.h.

◆ mOldState

State Client::mOldState = STATE_START
private

Definition at line 234 of file client.h.

◆ mOptions

Options Client::mOptions
private

Definition at line 214 of file client.h.

◆ mPackageDir

std::string Client::mPackageDir
private

Definition at line 216 of file client.h.

◆ mQuitDialog

QuitDialog* Client::mQuitDialog = nullptr
private

Definition at line 229 of file client.h.

◆ mRootDir

std::string Client::mRootDir
private

Definition at line 222 of file client.h.

◆ mScreenshotDir

std::string Client::mScreenshotDir
private

Definition at line 221 of file client.h.

◆ mSecondsCounterId

SDL_TimerID Client::mSecondsCounterId = 0
private

Definition at line 239 of file client.h.

◆ mSetupButton

Button* Client::mSetupButton = nullptr
private

Definition at line 231 of file client.h.

◆ mState

State Client::mState = STATE_CHOOSE_SERVER
private

Definition at line 233 of file client.h.

◆ mStateAfterOkDialog

State Client::mStateAfterOkDialog
private

Definition at line 235 of file client.h.

◆ mUpdateHost

std::string Client::mUpdateHost
private

Definition at line 219 of file client.h.

◆ mUpdatesDir

std::string Client::mUpdatesDir
private

Definition at line 220 of file client.h.

◆ mVideo

Video Client::mVideo
private

Definition at line 225 of file client.h.


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