C# Class RemoteTech.Settings

Show file Open project: RemoteTechnologiesGroup/RemoteTech Class Usage Examples

Public Properties

Property Type Description
FirstStart bool
SavedWindowPositions Rect>.Dictionary
SettingsLoaded bool

Private Properties

Property Type Description
SearchAndPreparePresets void

Public Methods

Method Description
AddGroundStation ( string name, double latitude, double longitude, double height, int body ) : System.Guid

Adds a new ground station to the list.

Load ( ) : Settings

Utilise KSP's GameDatabase to get a list of cfgs, included our Default_Settings.cfg, contained the 'RemoteTechSettings' node and process each cfg accordingly NOTE: Please do not use the static 'Default_Settings.cfg' file directly because we want third-party modders to apply ModuleManager patches of their tweaks, like no signal delay, to our default-settings cfg that will be used when a player starts a new game. (refer to our online manual for more details)

LoadPreset ( Settings previousSettings, string presetCfgUrl ) : Settings

Load a preset configuration into the RemoteTech settings object.

RemoveGroundStation ( System.Guid stationid ) : bool

Removes a ground station from the list by its unique stationid.

Save ( ) : void

Saves the current RTSettings object to the RemoteTech_Settings.cfg

Private Methods

Method Description
SearchAndPreparePresets ( Settings settings ) : void

Method Details

AddGroundStation() public method

Adds a new ground station to the list.
public AddGroundStation ( string name, double latitude, double longitude, double height, int body ) : System.Guid
name string Name of the ground station
latitude double Latitude position
longitude double Longitude position
height double Height above sea level
body int Reference body 1=Kerbin etc...
return System.Guid

Load() public static method

Utilise KSP's GameDatabase to get a list of cfgs, included our Default_Settings.cfg, contained the 'RemoteTechSettings' node and process each cfg accordingly NOTE: Please do not use the static 'Default_Settings.cfg' file directly because we want third-party modders to apply ModuleManager patches of their tweaks, like no signal delay, to our default-settings cfg that will be used when a player starts a new game. (refer to our online manual for more details)
public static Load ( ) : Settings
return Settings

LoadPreset() public static method

Load a preset configuration into the RemoteTech settings object.
public static LoadPreset ( Settings previousSettings, string presetCfgUrl ) : Settings
previousSettings Settings
presetCfgUrl string
return Settings

RemoveGroundStation() public method

Removes a ground station from the list by its unique stationid.
public RemoveGroundStation ( System.Guid stationid ) : bool
stationid System.Guid Unique ground station id
return bool

Save() public method

Saves the current RTSettings object to the RemoteTech_Settings.cfg
public Save ( ) : void
return void

Property Details

FirstStart public property

True if its the first start of RemoteTech for this save, false otherwise.
public bool FirstStart
return bool

SavedWindowPositions public property

Temp Variable for all the Window Positions for each instance.
public Dictionary SavedWindowPositions
return Rect>.Dictionary

SettingsLoaded public property

Trigger to force a reloading of the settings if a selected save is running.
public bool SettingsLoaded
return bool