Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyBodyPage(page *mfd.Page, header string, systemAddress int64, bodyID int64, ...)
- func ApplySystemPage(page *mfd.Page, header, systemname string, systemaddress int64, ...)
- func ExtractFleetCarrierNameID(full string) (string, string)
- func GetEDSMBodies(systemaddress int64) (*edsm.System, error)
- func GetEDSMSystemValue(systemaddress int64) (*edsm.System, error)
- func GetLastFleetCarrierName(id string) string
- func ModulesInfoCargoCapacity() int
- func ParseJournalLine(line []byte, state *Journalstate)
- func PrefetchStations(systemAddress int64)
- func RenderCargoPage(page *mfd.Page, _ Journalstate)
- func RenderDestinationPage(page *mfd.Page, state Journalstate)
- func RenderFleetCarrierPage(page *mfd.Page, header, fcID, fcName string, systemAddress int64)
- func RenderLocationPage(page *mfd.Page, state Journalstate)
- func RenderStationPage(page *mfd.Page, header string, st edsm.Station)
- func SaveFleetCarrierReceiveText(from string)
- func SetFirstEnabledPageKey(cfg map[string]bool)
- func Start(cfg conf.Conf)
- func Stop()
- type Cargo
- type CargoLine
- type Destination
- type EDSMTarget
- type Journalstate
- type Location
- type LocationType
- type ModulesInfo
- type ModulesLine
- type PageDef
- type PageKey
- type StarTypeData
Constants ¶
const FileCargo = "Cargo.json"
const FileModulesInfo = "ModulesInfo.json"
Variables ¶
Mfd is the MFD display structure to be used by this module.
var PageRegistry = []PageDef{ { Key: PageDestination, DisplayName: "Destination", Render: RenderDestinationPage, }, { Key: PageLocation, DisplayName: "Location", Render: RenderLocationPage, }, { Key: PageCargo, DisplayName: "Cargo", Render: RenderCargoPage, }, }
Registry of all possible pages
Functions ¶
func ApplyBodyPage ¶
func ApplySystemPage ¶
func ApplySystemPage(page *mfd.Page, header, systemname string, systemaddress int64, state *Journalstate)
Page assembly functions for MFD
func ExtractFleetCarrierNameID ¶
ExtractFleetCarrierNameID splits a string like "Stormcrow VZY-8XQ" into ("Stormcrow", "VZY-8XQ"). Returns ("", "") if not a FC.
func GetEDSMBodies ¶
Gets system body information from EDSM
func GetEDSMSystemValue ¶
Gets system monetary values from EDSM
func GetLastFleetCarrierName ¶
GetLastFleetCarrierName returns the last seen FC name for a given ID, or "".
func ModulesInfoCargoCapacity ¶
func ModulesInfoCargoCapacity() int
func ParseJournalLine ¶
func ParseJournalLine(line []byte, state *Journalstate)
ParseJournalLine parses a single line of the journal and returns the new state after parsing.
func PrefetchStations ¶
func PrefetchStations(systemAddress int64)
Prefetches station info for a system and caches it
func RenderCargoPage ¶
func RenderCargoPage(page *mfd.Page, _ Journalstate)
func RenderDestinationPage ¶
func RenderDestinationPage(page *mfd.Page, state Journalstate)
func RenderFleetCarrierPage ¶
Helper to render a Fleet Carrier page
func RenderLocationPage ¶
func RenderLocationPage(page *mfd.Page, state Journalstate)
Page rendering functions for MFD
func RenderStationPage ¶
Helper to render a station page
func SaveFleetCarrierReceiveText ¶
func SaveFleetCarrierReceiveText(from string)
SaveFleetCarrierReceiveText remembers the last FC name for a given ID.
func SetFirstEnabledPageKey ¶
Call this at startup after loading config, e.g. in main or Start()
Types ¶
type Destination ¶
Destination holds the current destination info from Status.json
type EDSMTarget ¶
type EDSMTarget struct { Name string SystemAddress int64 RemainingJumpsInRoute int // NEW: for FSD Target jumps }
EDSMTarget indicates a system targeted by the FSD drive for a jump
type Journalstate ¶
type Journalstate struct { Location EDSMTarget Destination ArrivedAtFSDTarget bool ArrivedAtFSDTargetTime time.Time LastFSDTargetSystem string LastFSDTargetAddress int64 ShowSplashScreen bool // NEW: splash flag SplashScreenStartTime time.Time // NEW: splash start time }
Journalstate encapsulates the player state baed on the journal
type Location ¶
type Location struct { Type LocationType SystemAddress int64 StarSystem string Body string BodyID int64 BodyType string Latitude float64 Longitude float64 }
Location indicates the players current location in the game
type LocationType ¶
type LocationType int
LocationType indicates where in a system the player is
const ( // LocationSystem means the player is somewhere in the system, not close to a body LocationSystem LocationType = iota // LocationPlanet means the player is close to a planetary body LocationPlanet // LocationLanded indicates the player has touched down LocationLanded // LocationDocked indicates the player has docked at a station (or outpost) LocationDocked )
type ModulesInfo ¶
type ModulesInfo struct {
Modules []ModulesLine
}
ModulesInfo struct to load the ModulesInfo file saved by ED
type ModulesLine ¶
ModulesLine struct to load individual module in the ModuleInfo
type PageDef ¶
type PageDef struct { Key PageKey DisplayName string Render func(*mfd.Page, Journalstate) }
PageDef describes a page and how to render it
type StarTypeData ¶
func ParseStarTypeString ¶
func ParseStarTypeString(starType string) StarTypeData