Advanced Strategic Command
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
CGameOptions Class Reference

#include <gameoptions.h>

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
 

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 More...
 

Public Attributes

int version
 
bool fastmove
 the number of steps to perform a move: 0 -> 3 step; != 0 -> 2 steps More...
 
int movespeed
 1/100 sec for a unit to move from one field to the next More...
 
int replayMoveSpeedFactor
 how much faster are unit going to move in replays (percent) More...
 
bool endturnquestion
 question "do you want to end your turn" More...
 
bool units_gray_after_move
 are units that cannot move but shoot displayed in gray ? More...
 
int mapzoom
 the zoom of the map display in ASC More...
 
int mapzoomeditor
 the zoom of the map display in the map editor More...
 
int attackspeed1
 are fields marked that a unit could move to if there was no other unit standing More...
 
int attackspeed2
 speed of moving bars in attack display More...
 
int attackspeed3
 second delay in attack display More...
 
bool forceWindowedMode
 force ASC to run in windowed mode (and not fullscreen, which is default) More...
 
bool hardwareSurface
 use screen buffer on the graphics card instead of main memory More...
 
bool hideMouseOnScreenUpdates
 hides the mouse cursor when screen updates are performed More...
 
bool debugReplay
 enables the option to review your own replay to find replay bugs More...
 
bool mapeditWindowedMode
 force the mapeditor to run in fullscreen mode (and not windowed, which is default) More...
 
int xresolution
 the horizontal resolution ASC uses More...
 
int yresolution
 the vertical resolution ASC uses More...
 
int mapeditor_xresolution
 the horizontal resolution the mapeditor uses More...
 
int mapeditor_yresolution
 the vertical resolution the mapeditor uses More...
 
bool maped_modalSelectionWindow
 
bool automaticTraining
 are units automatically trained in training centers More...
 
struct CGameOptions::Mouse mouse
 
struct CGameOptions::SoundSettings sound
 
struct {
   bool   fillResources
 
   bool   fillAmmo
 
unitProduction
 
bool autoproduceammunition
 produce required ammo upon refuelling More...
 
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 More...
 
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 More...
 
bool logKillsToConsole
 

Static Public Attributes

static const int maxSearchPathNum = 30
 

Detailed Description

Definition at line 27 of file gameoptions.h.

Member Typedef Documentation

Definition at line 251 of file gameoptions.h.

Definition at line 217 of file gameoptions.h.

Constructor & Destructor Documentation

CGameOptions::CGameOptions ( )

Definition at line 255 of file gameoptions.cpp.

References setDefaults().

Referenced by Instance().

Member Function Documentation

void CGameOptions::addSearchPath ( const ASCString path)
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().

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

Definition at line 433 of file gameoptions.cpp.

References panelData.

ASCString CGameOptions::getSearchPath ( int  i)

Definition at line 401 of file gameoptions.cpp.

References searchPath.

Referenced by initFileIO().

int CGameOptions::getSearchPathNum ( void  )

Definition at line 386 of file gameoptions.cpp.

References searchPathNum.

Referenced by initFileIO().

CGameOptions * CGameOptions::Instance ( )
static

returns the only Instance

Definition at line 38 of file gameoptions.cpp.

References CGameOptions(), and 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(), StoringPosition::eventMouseButtonDown(), MapDisplayPG::eventMouseButtonDown(), MapDisplayPG::eventMouseMotion(), LayoutablePanel::eventMoveWidget(), SoundSettings::eventScrollTrack_music(), SoundSettings::eventScrollTrack_sound(), LayoutablePanel::eventShow(), trunreplay::execnextreplaymove(), GuiFunctions::MovementBase::execute(), CargoGuiFunctions::UnitProduction::execute(), CargoGuiFunctions::MoveUnitIntoInnerContainer::execute(), ReplayGuiFunctions::ReplayFaster::execute(), ReplayGuiFunctions::ReplaySlower::execute(), GuiFunctions::EndTurn::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(), 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(), SoundSettings::toggleMusic(), SoundSettings::toggleSound(), TransferHandler::TransferHandler(), VehicleProduction_SelectionWindow::VehicleProduction_SelectionWindow(), viewOwnReplay(), trunreplay::wait(), waitWithUpdate(), ConfigurationFileLocatorCore::writeDefaultPathsToOptions(), writegameoptions(), and TransferHandler::~TransferHandler().

bool CGameOptions::isChanged ( )
inline

Definition at line 266 of file gameoptions.h.

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::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, CGameOptions::PanelData::visible, visibleMapLayer, CGameOptions::PanelData::x, xresolution, CGameOptions::PanelData::y, yresolution, CGameOptions::Mouse::zoominbutton, and CGameOptions::Mouse::zoomoutbutton.

Referenced by load(), and save().

void CGameOptions::save ( const ASCString filename)

Definition at line 83 of file gameoptions.cpp.

References runTextIO(), and tnstream::writing.

Referenced by writegameoptions().

void CGameOptions::setChanged ( bool  flag = true)
inline
void CGameOptions::setDefaultDirectories ( )
void CGameOptions::setDefaults ( void  )
void CGameOptions::setSearchPath ( int  i,
const ASCString path 
)

Definition at line 391 of file gameoptions.cpp.

References searchPath.

Referenced by addSearchPath().

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

Member Data Documentation

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().

int CGameOptions::ascframeratelimit

Definition at line 243 of file gameoptions.h.

Referenced by ReplayRecorderDialog::ReplayRecorderDialog(), and waitWithUpdate().

int CGameOptions::attackspeed1

are fields marked that a unit could move to if there was no other unit standing

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::automaticTraining

are units automatically trained in training centers

Definition at line 122 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), 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().

ASCString CGameOptions::BI3directory
bool CGameOptions::cacheASCGUI

Definition at line 201 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), 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().

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().

DialogAnswers CGameOptions::dialogAnswers

Definition at line 252 of file gameoptions.h.

Referenced by choiceDialog(), and runTextIO().

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::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().

bool CGameOptions::fillAmmo
bool CGameOptions::fillResources
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(), ScreenResolutionSetup::ScreenResolutionSetup(), and setDefaults().

int CGameOptions::framerate

Definition at line 242 of file gameoptions.h.

Referenced by ReplayRecorderDialog::ReplayRecorderDialog().

ASCString CGameOptions::graphicsDriver

Definition at line 233 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().

ASCString CGameOptions::hostname

Definition at line 226 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions().

ASCString CGameOptions::languageOverride

Definition at line 254 of file gameoptions.h.

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

bool CGameOptions::logKillsToConsole

Definition at line 259 of file gameoptions.h.

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

ASCString CGameOptions::mailProgram

Definition at line 231 of file gameoptions.h.

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

bool CGameOptions::maped_modalSelectionWindow

Definition at line 119 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), runTextIO(), 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::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::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().

const int CGameOptions::maxSearchPathNum = 30
static

Definition at line 247 of file gameoptions.h.

struct CGameOptions::Mouse CGameOptions::mouse
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::panelColumns

Definition at line 199 of file gameoptions.h.

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

PanelDataContainer CGameOptions::panelData
struct { ... } CGameOptions::pbemServer
int CGameOptions::port

Definition at line 227 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions().

int CGameOptions::quality

Definition at line 244 of file gameoptions.h.

Referenced by ReplayRecorderDialog::ReplayRecorderDialog().

bool CGameOptions::recordCampaignMaps

Definition at line 204 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions(), 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::replayMovieMode
int CGameOptions::replayspeed
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().

ASCString CGameOptions::searchPath[30]

Definition at line 249 of file gameoptions.h.

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

int CGameOptions::searchPathNum
struct CGameOptions::SoundSettings CGameOptions::sound
ASCString CGameOptions::startupMap
struct { ... } CGameOptions::unitProduction
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().

ASCString CGameOptions::username

Definition at line 228 of file gameoptions.h.

Referenced by EditGameOptions::EditGameOptions().

int CGameOptions::version

Definition at line 57 of file gameoptions.h.

struct { ... } CGameOptions::video
vector<ASCString> CGameOptions::visibleMapLayer

Definition at line 206 of file gameoptions.h.

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

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().


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