Add dashboard constants

This commit is contained in:
Jonathan Harris committed 2018-02-27 19:47:54 +00:00
1 parent 9c8c9e8e83
commit 0b0ac162e1
2 files changed
+44 -2

No files matched your search

+4 -2
View File
@@ -133,9 +133,11 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
This gets called when something on the player's cockpit display changes - typically about once a second when in orbital flight
```python
import plug
def dashboard_entry(cmdr, is_beta, entry):
deployed = entry['Flags'] & 1<<6
sys.stderr.write("Hardpoints {}\n", deployed and "deployed" or "stowed")
is_deployed = entry['Flags'] & plug.FlagsHardpointsDeployed
sys.stderr.write("Hardpoints {}\n", is_deployed and "deployed" or "stowed")
```
### Getting Commander Data
+40
View File
@@ -14,6 +14,46 @@ import myNotebook as nb
from config import config
# Dashboard Flags constants
FlagsDocked = 1<<0 # on a landing pad
FlagsLanded = 1<<1 # on planet surface
FlagsLandingGearDown = 1<<2
FlagsShieldsUp = 1<<3
FlagsSupercruise = 1<<4
FlagsFlightAssistOff = 1<<5
FlagsHardpointsDeployed = 1<<6
FlagsInWing = 1<<7
FlagsLightsOn = 1<<8
FlagsCargoScoopDeployed = 1<<9
FlagsSilentRunning = 1<<10
FlagsScoopingFuel = 1<<11
FlagsSrvHandbrake = 1<<12
FlagsSrvTurret = 1<<13
FlagsSrvUnderShip = 1<<14
FlagsSrvDriveAssist = 1<<15
FlagsFsdMassLocked = 1<<16
FlagsFsdCharging = 1<<17
FlagsFsdCooldown = 1<<18
FlagsLowFuel = 1<<19 # <25%
FlagsOverHeating = 1<<20 # > 100%
FlagsHasLatLong = 1<<21
FlagsIsInDanger = 1<<22
FlagsBeingInterdicted = 1<<23
FlagsInMainShip = 1<<24
FlagsInFighter = 1<<25
FlagsInSRV = 1<<26
# Dashboard GuiFocus constants
GuiFocusNoFocus = 0
GuiFocusInternalPanel = 1 # right hand side
GuiFocusExternalPanel = 2 # left hand side
GuiFocusCommsPanel = 3 # top
GuiFocusRolePanel = 4 # bottom
GuiFocusStationServices = 5
GuiFocusGalaxyMap = 6
GuiFocusSystemMap = 7
# List of loaded Plugins
PLUGINS = []