CGameOptions Class Reference

#include <gameoptions.h>

List of all members.

Public Types

typedef map< ASCString, PanelDataPanelDataContainer
typedef map< ASCString, int > DialogAnswers

Public Member Functions

 CGameOptions ()
void setDefaults ()
void setDefaultDirectories ()
void runTextIO (PropertyContainer &pc)
bool isChanged ()
void setChanged (bool flag=true)
void load (const ASCString &filename)
void save (const ASCString &filename)
int getSearchPathNum ()
void setSearchPath (int i, const ASCString &path)
void addSearchPath (const ASCString &path)
ASCString getSearchPath (int i)
bool getPanelData (const ASCString &name, PanelData &data)
void updatePanelData (const ASCString &name, PanelData data)
Password getDefaultPassword ()
Password getDefaultSupervisorPassword ()

Static Public Member Functions

static CGameOptionsInstance ()
 returns the only Instance

Public Attributes

int version
bool fastmove
 the number of steps to perform a move: 0 -> 3 step; != 0 -> 2 steps
int movespeed
 1/100 sec for a unit to move from one field to the next
int replayMoveSpeedFactor
 how much faster are unit going to move in replays (percent)
bool endturnquestion
 question "do you want to end your turn"
bool units_gray_after_move
 are units that cannot move but shoot displayed in gray ?
int mapzoom
 the zoom of the map display in ASC
int mapzoomeditor
 the zoom of the map display in the map editor
int attackspeed1
 first delay of attack display
int attackspeed2
 speed of moving bars in attack display
int attackspeed3
 second delay in attack display
bool forceWindowedMode
 force ASC to run in windowed mode (and not fullscreen, which is default)
bool hardwareSurface
 use screen buffer on the graphics card instead of main memory
bool hideMouseOnScreenUpdates
 hides the mouse cursor when screen updates are performed
bool debugReplay
 enables the option to review your own replay to find replay bugs
bool mapeditWindowedMode
 force the mapeditor to run in fullscreen mode (and not windowed, which is default)
int xresolution
 the horizontal resolution ASC uses
int yresolution
 the vertical resolution ASC uses
int mapeditor_xresolution
 the horizontal resolution the mapeditor uses
int mapeditor_yresolution
 the vertical resolution the mapeditor uses
bool maped_modalSelectionWindow
bool automaticTraining
 are units automatically trained in training centers
CGameOptions::Mouse mouse
 the mouse configuration. Mouse button are: bit 0 = left button ; bit 1 = right button ; bit 2 = center button
CGameOptions::SoundSettings sound
struct {
   bool   fillResources
   bool   fillAmmo
unitProduction
bool autoproduceammunition
 produce required ammo upon refuelling
int replayspeed
int panelColumns
bool cacheASCGUI
bool replayMovieMode
bool recordCampaignMaps
vector< ASCStringvisibleMapLayer
int aircraftCrashWarningTime
 the number of turns after which a unit will crash until the player is warned
PanelDataContainer panelData
ASCString BI3directory
struct {
   ASCString   hostname
   int   port
   ASCString   username
pbemServer
ASCString mailProgram
ASCString graphicsDriver
ASCString startupMap
ASCString defaultPassword
ASCString defaultSuperVisorPassword
struct {
   int   framerate
   int   ascframeratelimit
   int   quality
video
int searchPathNum
ASCString searchPath [30]
DialogAnswers dialogAnswers
ASCString languageOverride
bool saveEventMessagesExternal
 will save all Immediate Game Event messages into a seperate file for doing translations
bool logKillsToConsole

Static Public Attributes

static const int maxSearchPathNum

Classes

struct  Mouse
 the mouse configuration. Mouse button are: bit 0 = left button ; bit 1 = right button ; bit 2 = center button More...
struct  PanelData
struct  SoundSettings


Detailed Description

Definition at line 27 of file gameoptions.h.


Member Typedef Documentation

typedef map<ASCString, PanelData> CGameOptions::PanelDataContainer

Definition at line 217 of file gameoptions.h.

typedef map<ASCString,int> CGameOptions::DialogAnswers

Definition at line 251 of file gameoptions.h.


Constructor & Destructor Documentation

CGameOptions::CGameOptions (  ) 

Definition at line 255 of file gameoptions.cpp.

References setDefaults().


Member Function Documentation

CGameOptions * CGameOptions::Instance (  )  [static]

returns the only Instance

Definition at line 38 of file gameoptions.cpp.

References pStaticGameOptions.

Referenced by AmmoTransferWindow::AmmoTransferWindow(), ASC_MainScreenWidget::ASC_MainScreenWidget(), ASC_PG_App::ASC_PG_App(), authenticateUser(), ReplayGuiFunctions::ReplayFaster::available(), SoundSettings::buttonEvent(), tbi3preferences::buttonpressed(), ChangePasswordDialog::ChangePasswordDialog(), checkbi3dir(), checkFileLoadability(), checkUnitsForCrash(), choiceDialog(), trunreplay::displayActionCursor(), EditGameOptions::EditGameOptions(), enterpassword(), trunreplay::error(), LayoutablePanel::eventHide(), MapDisplayPG::eventMouseButtonDown(), StoringPosition::eventMouseButtonDown(), MapDisplayPG::eventMouseMotion(), LayoutablePanel::eventMoveWidget(), SoundSettings::eventScrollTrack(), LayoutablePanel::eventShow(), trunreplay::execnextreplaymove(), ReplayGuiFunctions::ReplaySlower::execute(), ReplayGuiFunctions::ReplayFaster::execute(), GuiFunctions::EndTurn::execute(), GuiFunctions::MovementBase::execute(), CargoGuiFunctions::MoveUnitIntoInnerContainer::execute(), CargoGuiFunctions::UnitProduction::execute(), executeUserAction(), filterQueuedZoomEvents(), getbi3path(), getbipath(), Locale::getLang(), ReplayMapDisplay::getUnitMovementDuration(), PG_MapDisplay::getUnitMovementDuration(), ImportBI3MapDialog::ImportBI3MapDialog(), initFileIO(), MapItemSelectionWindow::itemSelected(), loadStartupMap(), log(), MailOptionsDialog::MailOptionsDialog(), main(), MapDisplayPG::MapDisplayPG(), NewGuiHost::mapIconProcessing(), Vehicle::paint(), ReplayRecorder::pause(), SoundSettings::radioButtonEvent(), readgameoptions(), ReplayRecorder::ReplayRecorder(), ReplayRecorderDialog::ReplayRecorderDialog(), trunreplay::run(), AI::run(), MoveUnit::runAction(), savemap(), ScreenResolutionSetup::ScreenResolutionSetup(), FileTransfer::send(), MapDisplayPG::setNewZoom(), ASCGUI_Window::setup(), showAttackAnimation(), showSelectionWindow(), NewGuiHost::showSmallIcons(), SoundSettings::SoundSettings(), ASC_MainScreenWidget::spawnPanel(), ReplayRecorder::start(), StartMultiplayerGame::start(), startnextcampaignmap(), TransferHandler::TransferHandler(), VehicleProduction_SelectionWindow::VehicleProduction_SelectionWindow(), viewOwnReplay(), trunreplay::wait(), waitWithUpdate(), ConfigurationFileLocatorCore::writeDefaultPathsToOptions(), writegameoptions(), and TransferHandler::~TransferHandler().

void CGameOptions::setDefaults (  ) 

Definition at line 261 of file gameoptions.cpp.

References aircraftCrashWarningTime, attackspeed1, attackspeed2, attackspeed3, automaticTraining, autoproduceammunition, cacheASCGUI, CGameOptions::Mouse::centerbutton, debugReplay, CGameOptions::Mouse::dragndropbutton, endturnquestion, fastmove, CGameOptions::Mouse::fieldmarkbutton, forceWindowedMode, graphicsDriver, hardwareSurface, hideMouseOnScreenUpdates, logKillsToConsole, maped_modalSelectionWindow, mapeditor_xresolution, mapeditor_yresolution, mapeditWindowedMode, mapzoom, mapzoomeditor, mouse, movespeed, CGameOptions::SoundSettings::musicVolume, CGameOptions::SoundSettings::muteEffects, CGameOptions::SoundSettings::muteMusic, CGameOptions::SoundSettings::off, panelColumns, pbemServer, recordCampaignMaps, replayMoveSpeedFactor, replayMovieMode, replayspeed, saveEventMessagesExternal, setChanged(), setDefaultDirectories(), CGameOptions::Mouse::singleClickAction, sound, CGameOptions::SoundSettings::soundVolume, startupMap, unitProduction, units_gray_after_move, video, xresolution, yresolution, CGameOptions::Mouse::zoominbutton, and CGameOptions::Mouse::zoomoutbutton.

Referenced by CGameOptions().

void CGameOptions::setDefaultDirectories (  ) 

Definition at line 356 of file gameoptions.cpp.

References searchPath, and searchPathNum.

Referenced by setDefaults(), and ConfigurationFileLocatorCore::writeDefaultPathsToOptions().

void CGameOptions::runTextIO ( PropertyContainer pc  ) 

Definition at line 92 of file gameoptions.cpp.

References PropertyContainer::addBool(), PropertyContainer::addInteger(), PropertyContainer::addNamedInteger(), PropertyContainer::addString(), PropertyContainer::addStringArray(), aircraftCrashWarningTime, attackspeed1, attackspeed2, attackspeed3, automaticTraining, autoproduceammunition, BI3directory, cacheASCGUI, CGameOptions::Mouse::centerbutton, PropertyContainer::closeBracket(), debugReplay, defaultPassword, defaultSuperVisorPassword, dialogAnswers, CGameOptions::Mouse::dragndropbutton, endturnquestion, fastmove, CGameOptions::Mouse::fieldmarkbutton, PropertyContainer::find(), forceWindowedMode, graphicsDriver, hardwareSurface, hideMouseOnScreenUpdates, PropertyContainer::isReading(), languageOverride, logKillsToConsole, mailProgram, maped_modalSelectionWindow, mapeditor_xresolution, mapeditor_yresolution, mapeditWindowedMode, mapzoom, mapzoomeditor, min(), mouse, mouseButtonNum, mouseButtons, movespeed, CGameOptions::SoundSettings::musicVolume, CGameOptions::SoundSettings::muteEffects, CGameOptions::SoundSettings::muteMusic, CGameOptions::SoundSettings::off, PropertyContainer::openBracket(), panelColumns, panelData, pbemServer, recordCampaignMaps, replayMoveSpeedFactor, replayspeed, saveEventMessagesExternal, searchPath, searchPathNum, CGameOptions::Mouse::singleClickAction, sound, CGameOptions::SoundSettings::soundVolume, startupMap, strrr(), unitProduction, units_gray_after_move, video, visibleMapLayer, xresolution, yresolution, CGameOptions::Mouse::zoominbutton, and CGameOptions::Mouse::zoomoutbutton.

Referenced by load(), and save().

bool CGameOptions::isChanged (  )  [inline]

Definition at line 266 of file gameoptions.h.

void CGameOptions::setChanged ( bool  flag = true  )  [inline]

Definition at line 272 of file gameoptions.h.

Referenced by checkbi3dir(), checkFileLoadability(), choiceDialog(), SoundSettings::eventScrollTrack(), ReplayGuiFunctions::ReplaySlower::execute(), ReplayGuiFunctions::ReplayFaster::execute(), CargoGuiFunctions::UnitProduction::execute(), executeUserAction(), getbipath(), readgameoptions(), setDefaults(), MapDisplayPG::setNewZoom(), updatePanelData(), and TransferHandler::~TransferHandler().

void CGameOptions::load ( const ASCString filename  ) 

Definition at line 71 of file gameoptions.cpp.

References tnstream::reading, TextFormatParser::run(), and runTextIO().

Referenced by readgameoptions().

void CGameOptions::save ( const ASCString filename  ) 

Definition at line 83 of file gameoptions.cpp.

References runTextIO(), and tnstream::writing.

Referenced by writegameoptions().

int CGameOptions::getSearchPathNum (  ) 

Definition at line 386 of file gameoptions.cpp.

References searchPathNum.

Referenced by initFileIO().

void CGameOptions::setSearchPath ( int  i,
const ASCString path 
)

Definition at line 391 of file gameoptions.cpp.

References searchPath.

Referenced by addSearchPath().

void CGameOptions::addSearchPath ( const ASCString path  ) 

Definition at line 396 of file gameoptions.cpp.

References searchPathNum, and setSearchPath().

Referenced by ConfigurationFileLocatorCore::writeDefaultPathsToOptions().

ASCString CGameOptions::getSearchPath ( int  i  ) 

Definition at line 401 of file gameoptions.cpp.

References searchPath.

bool CGameOptions::getPanelData ( const ASCString name,
PanelData data 
)

Definition at line 433 of file gameoptions.cpp.

References panelData.

void CGameOptions::updatePanelData ( const ASCString name,
PanelData  data 
)

Definition at line 427 of file gameoptions.cpp.

References panelData, and setChanged().

Referenced by LayoutablePanel::eventHide(), LayoutablePanel::eventMoveWidget(), and LayoutablePanel::eventShow().

Password CGameOptions::getDefaultPassword (  ) 

Definition at line 408 of file gameoptions.cpp.

References defaultPassword, and Password::setEncoded().

Referenced by authenticateUser(), and enterpassword().

Password CGameOptions::getDefaultSupervisorPassword (  ) 

Definition at line 418 of file gameoptions.cpp.

References defaultSuperVisorPassword, and Password::setEncoded().


Member Data Documentation

int CGameOptions::version

Definition at line 57 of file gameoptions.h.

bool CGameOptions::fastmove

the number of steps to perform a move: 0 -> 3 step; != 0 -> 2 steps

Definition at line 60 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

int CGameOptions::movespeed

1/100 sec for a unit to move from one field to the next

Definition at line 63 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), ReplayMapDisplay::getUnitMovementDuration(), PG_MapDisplay::getUnitMovementDuration(), runTextIO(), and setDefaults().

int CGameOptions::replayMoveSpeedFactor

how much faster are unit going to move in replays (percent)

Definition at line 66 of file gameoptions.h.

Referenced by runTextIO(), and setDefaults().

bool CGameOptions::endturnquestion

question "do you want to end your turn"

Definition at line 69 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

bool CGameOptions::units_gray_after_move

are units that cannot move but shoot displayed in gray ?

Definition at line 72 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), executeUserAction(), Vehicle::paint(), runTextIO(), and setDefaults().

int CGameOptions::mapzoom

the zoom of the map display in ASC

Definition at line 75 of file gameoptions.h.

Referenced by runTextIO(), setDefaults(), and MapDisplayPG::setNewZoom().

int CGameOptions::mapzoomeditor

the zoom of the map display in the map editor

Definition at line 78 of file gameoptions.h.

Referenced by runTextIO(), and setDefaults().

int CGameOptions::attackspeed1

first delay of attack display

Definition at line 84 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), setDefaults(), and showAttackAnimation().

int CGameOptions::attackspeed2

speed of moving bars in attack display

Definition at line 87 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), setDefaults(), and showAttackAnimation().

int CGameOptions::attackspeed3

second delay in attack display

Definition at line 90 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), setDefaults(), and showAttackAnimation().

bool CGameOptions::forceWindowedMode

force ASC to run in windowed mode (and not fullscreen, which is default)

Definition at line 93 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

bool CGameOptions::hardwareSurface

use screen buffer on the graphics card instead of main memory

Definition at line 96 of file gameoptions.h.

Referenced by runTextIO(), and setDefaults().

bool CGameOptions::hideMouseOnScreenUpdates

hides the mouse cursor when screen updates are performed

Definition at line 99 of file gameoptions.h.

Referenced by runTextIO(), and setDefaults().

bool CGameOptions::debugReplay

enables the option to review your own replay to find replay bugs

Definition at line 102 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

bool CGameOptions::mapeditWindowedMode

force the mapeditor to run in fullscreen mode (and not windowed, which is default)

Definition at line 105 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), main(), runTextIO(), and setDefaults().

int CGameOptions::xresolution

the horizontal resolution ASC uses

Definition at line 108 of file gameoptions.h.

Referenced by runTextIO(), ScreenResolutionSetup::ScreenResolutionSetup(), and setDefaults().

int CGameOptions::yresolution

the vertical resolution ASC uses

Definition at line 111 of file gameoptions.h.

Referenced by runTextIO(), ScreenResolutionSetup::ScreenResolutionSetup(), and setDefaults().

int CGameOptions::mapeditor_xresolution

the horizontal resolution the mapeditor uses

Definition at line 114 of file gameoptions.h.

Referenced by main(), runTextIO(), and setDefaults().

int CGameOptions::mapeditor_yresolution

the vertical resolution the mapeditor uses

Definition at line 117 of file gameoptions.h.

Referenced by main(), runTextIO(), and setDefaults().

bool CGameOptions::maped_modalSelectionWindow

Definition at line 119 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

bool CGameOptions::automaticTraining

are units automatically trained in training centers

Definition at line 122 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

struct CGameOptions::Mouse CGameOptions::mouse

the mouse configuration. Mouse button are: bit 0 = left button ; bit 1 = right button ; bit 2 = center button

Referenced by EditGameOptions::EditGameOptions(), MapDisplayPG::eventMouseButtonDown(), StoringPosition::eventMouseButtonDown(), filterQueuedZoomEvents(), runTextIO(), and setDefaults().

struct CGameOptions::SoundSettings CGameOptions::sound

Referenced by SoundSettings::buttonEvent(), SoundSettings::eventScrollTrack(), main(), SoundSettings::radioButtonEvent(), runTextIO(), setDefaults(), and SoundSettings::SoundSettings().

bool CGameOptions::fillResources

Definition at line 186 of file gameoptions.h.

Referenced by CargoGuiFunctions::UnitProduction::execute().

bool CGameOptions::fillAmmo

Definition at line 187 of file gameoptions.h.

Referenced by CargoGuiFunctions::UnitProduction::execute(), and VehicleProduction_SelectionWindow::VehicleProduction_SelectionWindow().

struct { ... } CGameOptions::unitProduction

Referenced by CargoGuiFunctions::UnitProduction::execute(), runTextIO(), and setDefaults().

bool CGameOptions::autoproduceammunition

produce required ammo upon refuelling

Definition at line 191 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), setDefaults(), TransferHandler::TransferHandler(), and TransferHandler::~TransferHandler().

int CGameOptions::replayspeed

Definition at line 196 of file gameoptions.h.

Referenced by ReplayGuiFunctions::ReplaySlower::execute(), ReplayGuiFunctions::ReplayFaster::execute(), runTextIO(), and setDefaults().

int CGameOptions::panelColumns

Definition at line 199 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

bool CGameOptions::cacheASCGUI

Definition at line 201 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

bool CGameOptions::replayMovieMode

Definition at line 203 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), ReplayRecorder::pause(), ReplayRecorder::ReplayRecorder(), setDefaults(), and ReplayRecorder::start().

bool CGameOptions::recordCampaignMaps

Definition at line 204 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

vector<ASCString> CGameOptions::visibleMapLayer

Definition at line 206 of file gameoptions.h.

Referenced by ASC_MainScreenWidget::ASC_MainScreenWidget(), and runTextIO().

int CGameOptions::aircraftCrashWarningTime

the number of turns after which a unit will crash until the player is warned

Definition at line 209 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

PanelDataContainer CGameOptions::panelData

Definition at line 218 of file gameoptions.h.

Referenced by ASC_MainScreenWidget::ASC_MainScreenWidget(), getPanelData(), runTextIO(), and updatePanelData().

ASCString CGameOptions::BI3directory

Definition at line 223 of file gameoptions.h.

Referenced by checkbi3dir(), EditGameOptions::EditGameOptions(), getbi3path(), getbipath(), and runTextIO().

ASCString CGameOptions::hostname

Definition at line 226 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions().

int CGameOptions::port

Definition at line 227 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions().

ASCString CGameOptions::username

Definition at line 228 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions().

struct { ... } CGameOptions::pbemServer

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

ASCString CGameOptions::mailProgram

Definition at line 231 of file gameoptions.h.

Referenced by runTextIO(), and FileTransfer::send().

ASCString CGameOptions::graphicsDriver

Definition at line 233 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

ASCString CGameOptions::startupMap

Definition at line 235 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), loadStartupMap(), runTextIO(), and setDefaults().

ASCString CGameOptions::defaultPassword

Definition at line 236 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), getDefaultPassword(), and runTextIO().

ASCString CGameOptions::defaultSuperVisorPassword

Definition at line 237 of file gameoptions.h.

Referenced by getDefaultSupervisorPassword(), and runTextIO().

int CGameOptions::framerate

Definition at line 242 of file gameoptions.h.

Referenced by ReplayRecorderDialog::ReplayRecorderDialog().

int CGameOptions::ascframeratelimit

Definition at line 243 of file gameoptions.h.

Referenced by waitWithUpdate().

int CGameOptions::quality

Definition at line 244 of file gameoptions.h.

struct { ... } CGameOptions::video

Referenced by runTextIO(), setDefaults(), and waitWithUpdate().

const int CGameOptions::maxSearchPathNum [static]

Definition at line 247 of file gameoptions.h.

int CGameOptions::searchPathNum

Definition at line 248 of file gameoptions.h.

Referenced by addSearchPath(), getSearchPathNum(), runTextIO(), setDefaultDirectories(), and ConfigurationFileLocatorCore::writeDefaultPathsToOptions().

ASCString CGameOptions::searchPath[30]

Definition at line 249 of file gameoptions.h.

Referenced by getSearchPath(), runTextIO(), setDefaultDirectories(), and setSearchPath().

DialogAnswers CGameOptions::dialogAnswers

Definition at line 252 of file gameoptions.h.

Referenced by choiceDialog(), and runTextIO().

ASCString CGameOptions::languageOverride

Definition at line 254 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), Locale::getLang(), and runTextIO().

bool CGameOptions::saveEventMessagesExternal

will save all Immediate Game Event messages into a seperate file for doing translations

Definition at line 257 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().

bool CGameOptions::logKillsToConsole

Definition at line 259 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), and setDefaults().


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:46:28 2012 for Advanced Strategic Command by  doxygen 1.5.1