Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Protected Attributes | Properties | List of all members
KerbNet.KerbNetMode Class Referenceabstract
Inheritance diagram for KerbNet.KerbNetMode:
KerbNet.KerbNetModeBiome KerbNet.KerbNetModeResource KerbNet.KerbNetModeTerrain

Public Member Functions

virtual bool AutoGenerateMode ()
 Whether the mode should be caught in the assembly pass, or if we're doing something else with it. More...
 
virtual void CustomPass (Texture2D tex)
 Custom pass - runs last and allows any change to the texture. No need to call Apply on the texture. More...
 
virtual Color GetBackgroundColor (int x, int y)
 Return the background color at a specific point on the texture. More...
 
virtual Color GetCoordinateColor (Vessel vessel, double latitude, double longitude)
 Return the color displayed for the coordinate pass. More...
 
virtual string GetErrorState ()
 Gets whether or not there is an error with this mode, and a description of said error. More...
 
virtual string GetModeCaption ()
 Gets a caption for the mode button, space for two characters only. More...
 
virtual Color GetModeColorTint ()
 Gets the color you want to tint the mode button. More...
 
ColorBlock GetModeColorTintBlock ()
 Necessary to colorize the button and have it highlight properly. More...
 
virtual void GetTerrainContourColors (Vessel vessel, out Color lowColor, out Color highColor)
 Return the color used when contouring the lowest terrain. More...
 
void Init ()
 Initializes stuff the base class needs, then initializes stuff any derived classes need. More...
 
virtual void InterpolateContourTexture (Texture2D tex)
 Interpolate after the terrain contours if they are enabled. Does not happen if they are disabled. More...
 
virtual void InterpolateMainTexture (Texture2D tex)
 Interpolate after the main texture is generated, whether or not the coordinate pass is enabled. More...
 
virtual bool isModeActive (Vessel vessel)
 Called on KerbNet window opening to check if this mode should be added to the currently available modes. More...
 
virtual string LocalCoordinateInfo (Vessel vessel, double centerLatitude, double centerLongitude, double waypointLatitude, double waypointLongitude, bool waypointInSpace)
 The string displayed for the info text. More...
 
virtual void OnActivated ()
 Called when a mode is brought up within KerbNet, either by opening the dialog or switching modes. More...
 
virtual void OnDeactivated ()
 Called when the mode is switched away from a mode, or KerbNet is closed. More...
 
abstract void OnInit ()
 Called to initialize the class. Should be used to set buttonSprite (20x20 Sprite). More...
 
virtual void OnPrecache (Vessel vessel)
 Runs before any passes, lets us precache things that do not need to be calculated every single pixel. More...
 
void Precache (Vessel vessel)
 Precaches stuff the base class needs, then precaches stuff any derived classes need. More...
 

Public Attributes

Sprite buttonSprite
 The displayed button sprite. More...
 
UnityAction customButtonCallback = null
 If non-null, creates a custom button on the dialog that, when clicked, fires the callback. More...
 
string customButtonCaption = "Custom"
 If using the custom button, this allows you to customize its caption. More...
 
string customButtonTooltip = string.Empty
 If using the custom button, this allows you to customize its tooltip. More...
 
string displayName = "ModeName"
 The displayed - Localized mode name More...
 
bool doAnomaliesPass = false
 Should anomalies display pass (third) be called . More...
 
bool doCoordinatePass = false
 Should the coordinate based pass (first) be called in this mode. More...
 
bool doCustomPass = false
 Should the the custom pass (last) be called. More...
 
bool doTerrainContourPass = false
 Should the terrain contour pass (second) called. More...
 
string localCoordinateInfoLabel = "N/A"
 The string displayed as the center coordinate title instead of the default "Biome". More...
 
string name = "ModeName"
 The internal mode name. More...
 
float terrainContourThreshold = 1f
 Clamps the ceiling a bit on terrain contours, to brighten the peaks. More...
 

Protected Attributes

KSPRandom backgroundGenerator
 A random generator that is seeded before every pass, used for the background. More...
 
KSPRandom foregroundGenerator
 A random generator that is seeded before every pass, used for the foreground. More...
 

Properties

static ColorHSV hsv [get]
 General use ColorHSV. More...
 

Member Function Documentation

virtual bool KerbNet.KerbNetMode.AutoGenerateMode ( )
inlinevirtual

Whether the mode should be caught in the assembly pass, or if we're doing something else with it.

Returns
If the mode should be generated automatically.

Reimplemented in KerbNet.KerbNetModeResource.

virtual void KerbNet.KerbNetMode.CustomPass ( Texture2D  tex)
inlinevirtual

Custom pass - runs last and allows any change to the texture. No need to call Apply on the texture.

Parameters
texThe texture to do a custom pass on.
virtual Color KerbNet.KerbNetMode.GetBackgroundColor ( int  x,
int  y 
)
inlinevirtual

Return the background color at a specific point on the texture.

Parameters
xThe x position the map is considering.
yThe y position the map is considering.
Returns
The background color at that position if land is not present.
virtual Color KerbNet.KerbNetMode.GetCoordinateColor ( Vessel  vessel,
double  latitude,
double  longitude 
)
inlinevirtual

Return the color displayed for the coordinate pass.

Parameters
vesselThe vessel to check.
latitudeThe latitude of the coordinate.
longitudeThe longitude of the coordinate.
Returns
The color for this mode at that coordinate.

Reimplemented in KerbNet.KerbNetModeResource, and KerbNet.KerbNetModeBiome.

virtual string KerbNet.KerbNetMode.GetErrorState ( )
inlinevirtual

Gets whether or not there is an error with this mode, and a description of said error.

Returns
An error description or null if no error.

Reimplemented in KerbNet.KerbNetModeResource.

virtual string KerbNet.KerbNetMode.GetModeCaption ( )
inlinevirtual

Gets a caption for the mode button, space for two characters only.

Returns
The caption of the mode button.

Reimplemented in KerbNet.KerbNetModeResource.

virtual Color KerbNet.KerbNetMode.GetModeColorTint ( )
inlinevirtual

Gets the color you want to tint the mode button.

Returns
The color of the mode button.

Reimplemented in KerbNet.KerbNetModeResource.

ColorBlock KerbNet.KerbNetMode.GetModeColorTintBlock ( )
inline

Necessary to colorize the button and have it highlight properly.

Returns
The color block for the mode button.
virtual void KerbNet.KerbNetMode.GetTerrainContourColors ( Vessel  vessel,
out Color  lowColor,
out Color  highColor 
)
inlinevirtual

Return the color used when contouring the lowest terrain.

Parameters
vesselThe vessel to check.
lowColorThe color at minimum terrain height.
highColorThe color at maximum terrain height.
Returns
The color for this mode at minimum terrain height.

Reimplemented in KerbNet.KerbNetModeTerrain.

void KerbNet.KerbNetMode.Init ( )
inline

Initializes stuff the base class needs, then initializes stuff any derived classes need.

virtual void KerbNet.KerbNetMode.InterpolateContourTexture ( Texture2D  tex)
inlinevirtual

Interpolate after the terrain contours if they are enabled. Does not happen if they are disabled.

Parameters
texThe texture to interpolate.
virtual void KerbNet.KerbNetMode.InterpolateMainTexture ( Texture2D  tex)
inlinevirtual

Interpolate after the main texture is generated, whether or not the coordinate pass is enabled.

Parameters
texThe texture to interpolate.
virtual bool KerbNet.KerbNetMode.isModeActive ( Vessel  vessel)
inlinevirtual

Called on KerbNet window opening to check if this mode should be added to the currently available modes.

Parameters
vesselThe vessel to check.
Returns
If the mode is active.
virtual string KerbNet.KerbNetMode.LocalCoordinateInfo ( Vessel  vessel,
double  centerLatitude,
double  centerLongitude,
double  waypointLatitude,
double  waypointLongitude,
bool  waypointInSpace 
)
inlinevirtual

The string displayed for the info text.

Parameters
vesselThe vessel to check.
centerLatitudeThe latitude of the center.
centerLongitudeThe longitude of the center.
waypointLatitudeThe latitude of the waypoint.
waypointLongitudeThe longitude of the waypoint.
Returns
The string to display for those coordinates.

Reimplemented in KerbNet.KerbNetModeResource, KerbNet.KerbNetModeBiome, and KerbNet.KerbNetModeTerrain.

virtual void KerbNet.KerbNetMode.OnActivated ( )
inlinevirtual

Called when a mode is brought up within KerbNet, either by opening the dialog or switching modes.

Reimplemented in KerbNet.KerbNetModeResource.

virtual void KerbNet.KerbNetMode.OnDeactivated ( )
inlinevirtual

Called when the mode is switched away from a mode, or KerbNet is closed.

Reimplemented in KerbNet.KerbNetModeResource.

abstract void KerbNet.KerbNetMode.OnInit ( )
pure virtual

Called to initialize the class. Should be used to set buttonSprite (20x20 Sprite).

Implemented in KerbNet.KerbNetModeResource, KerbNet.KerbNetModeBiome, and KerbNet.KerbNetModeTerrain.

virtual void KerbNet.KerbNetMode.OnPrecache ( Vessel  vessel)
inlinevirtual

Runs before any passes, lets us precache things that do not need to be calculated every single pixel.

Parameters
vesselThe vessel to check.

Reimplemented in KerbNet.KerbNetModeResource, and KerbNet.KerbNetModeBiome.

void KerbNet.KerbNetMode.Precache ( Vessel  vessel)
inline

Precaches stuff the base class needs, then precaches stuff any derived classes need.

Member Data Documentation

KSPRandom KerbNet.KerbNetMode.backgroundGenerator
protected

A random generator that is seeded before every pass, used for the background.

Sprite KerbNet.KerbNetMode.buttonSprite

The displayed button sprite.

UnityAction KerbNet.KerbNetMode.customButtonCallback = null

If non-null, creates a custom button on the dialog that, when clicked, fires the callback.

string KerbNet.KerbNetMode.customButtonCaption = "Custom"

If using the custom button, this allows you to customize its caption.

string KerbNet.KerbNetMode.customButtonTooltip = string.Empty

If using the custom button, this allows you to customize its tooltip.

string KerbNet.KerbNetMode.displayName = "ModeName"

The displayed - Localized mode name

bool KerbNet.KerbNetMode.doAnomaliesPass = false

Should anomalies display pass (third) be called .

bool KerbNet.KerbNetMode.doCoordinatePass = false

Should the coordinate based pass (first) be called in this mode.

bool KerbNet.KerbNetMode.doCustomPass = false

Should the the custom pass (last) be called.

bool KerbNet.KerbNetMode.doTerrainContourPass = false

Should the terrain contour pass (second) called.

KSPRandom KerbNet.KerbNetMode.foregroundGenerator
protected

A random generator that is seeded before every pass, used for the foreground.

string KerbNet.KerbNetMode.localCoordinateInfoLabel = "N/A"

The string displayed as the center coordinate title instead of the default "Biome".

string KerbNet.KerbNetMode.name = "ModeName"

The internal mode name.

float KerbNet.KerbNetMode.terrainContourThreshold = 1f

Clamps the ceiling a bit on terrain contours, to brighten the peaks.

Property Documentation

ColorHSV KerbNet.KerbNetMode.hsv
staticgetprotected

General use ColorHSV.


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