Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | List of all members
KerbNet.KerbNetModeResource Class Reference

Unlike the other modes, we will instantiate multiple resource modes for each resource, name and many other things will change. More...

Inheritance diagram for KerbNet.KerbNetModeResource:
KerbNet.KerbNetMode

Public Member Functions

override bool AutoGenerateMode ()
 Whether the mode should be caught in the assembly pass, or if we're doing something else with it. More...
 
void CheckScannedBody ()
 
override Color GetCoordinateColor (Vessel vessel, double currentLatitude, double currentLongitude)
 Return the color displayed for the coordinate pass. More...
 
override string GetErrorState ()
 Gets whether or not there is an error with this mode, and a description of said error. More...
 
override string GetModeCaption ()
 Gets a caption for the mode button, space for two characters only. More...
 
override Color GetModeColorTint ()
 Gets the color you want to tint the mode button. More...
 
 KerbNetModeResource ()
 
 KerbNetModeResource (string resource)
 
override string LocalCoordinateInfo (Vessel vessel, double centerLatitude, double centerLongitude, double waypointLatitude, double waypointLongitude, bool waypointInSpace)
 The string displayed for the info text. More...
 
override void OnActivated ()
 Called when a mode is brought up within KerbNet, either by opening the dialog or switching modes. More...
 
override void OnDeactivated ()
 Called when the mode is switched away from a mode, or KerbNet is closed. More...
 
override void OnInit ()
 Called to initialize the class. Should be used to set buttonSprite (20x20 Sprite). More...
 
override void OnPrecache (Vessel vessel)
 Runs before any passes, lets us precache things that do not need to be calculated every single pixel. More...
 
- Public Member Functions inherited from KerbNet.KerbNetMode
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...
 
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...
 
void Precache (Vessel vessel)
 Precaches stuff the base class needs, then precaches stuff any derived classes need. More...
 

Public Attributes

MapDisplayTypes displayMode
 
bool scannedBody = false
 
- Public Attributes inherited from KerbNet.KerbNetMode
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...
 

Additional Inherited Members

- Protected Attributes inherited from KerbNet.KerbNetMode
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 inherited from KerbNet.KerbNetMode
static ColorHSV hsv [get]
 General use ColorHSV. More...
 

Detailed Description

Unlike the other modes, we will instantiate multiple resource modes for each resource, name and many other things will change.

Constructor & Destructor Documentation

KerbNet.KerbNetModeResource.KerbNetModeResource ( )
inline
KerbNet.KerbNetModeResource.KerbNetModeResource ( string  resource)
inline

Member Function Documentation

override bool KerbNet.KerbNetModeResource.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 from KerbNet.KerbNetMode.

void KerbNet.KerbNetModeResource.CheckScannedBody ( )
inline
override Color KerbNet.KerbNetModeResource.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 from KerbNet.KerbNetMode.

override string KerbNet.KerbNetModeResource.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 from KerbNet.KerbNetMode.

override string KerbNet.KerbNetModeResource.GetModeCaption ( )
inlinevirtual

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

Returns
The caption of the mode button.

Reimplemented from KerbNet.KerbNetMode.

override Color KerbNet.KerbNetModeResource.GetModeColorTint ( )
inlinevirtual

Gets the color you want to tint the mode button.

Returns
The color of the mode button.

Reimplemented from KerbNet.KerbNetMode.

override string KerbNet.KerbNetModeResource.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 from KerbNet.KerbNetMode.

override void KerbNet.KerbNetModeResource.OnActivated ( )
inlinevirtual

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

Reimplemented from KerbNet.KerbNetMode.

override void KerbNet.KerbNetModeResource.OnDeactivated ( )
inlinevirtual

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

Reimplemented from KerbNet.KerbNetMode.

override void KerbNet.KerbNetModeResource.OnInit ( )
inlinevirtual

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

Implements KerbNet.KerbNetMode.

override void KerbNet.KerbNetModeResource.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 from KerbNet.KerbNetMode.

Member Data Documentation

MapDisplayTypes KerbNet.KerbNetModeResource.displayMode
bool KerbNet.KerbNetModeResource.scannedBody = false

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