From 2b68722708304cb084634208e1ddbe919ad91201 Mon Sep 17 00:00:00 2001
From: Archaegeo <30728822+Archaegeo@users.noreply.github.com>
Date: Fri, 4 Dec 2020 05:25:48 -0500
Subject: [PATCH] Copied the NoAP version file here to free up fork
---
ButtonHUD-NoAP.conf | 310 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 310 insertions(+)
create mode 100644 ButtonHUD-NoAP.conf
diff --git a/ButtonHUD-NoAP.conf b/ButtonHUD-NoAP.conf
new file mode 100644
index 0000000..38909c2
--- /dev/null
+++ b/ButtonHUD-NoAP.conf
@@ -0,0 +1,310 @@
+name: ButtonsHud - NoAutopilot - Dimencia and Archaegeo v1.03 (Minified)
+slots:
+ core:
+ class: CoreUnit
+ radar:
+ class: RadarPVPUnit
+ select: manual
+ antigrav:
+ class: AntiGravityGeneratorUnit
+ warpdrive:
+ class: WarpDriveUnit
+ gyro:
+ class: GyroUnit
+ weapon:
+ class: WeaponUnit
+ select: manual
+ dbHud:
+ class: databank
+ vBooster:
+ class: VerticalBooster
+ hover:
+ class: Hovercraft
+ door:
+ class: DoorUnit
+ select: manual
+ forcefield:
+ class: ForceFieldUnit
+ select: manual
+ atmofueltank:
+ class: AtmoFuelContainer
+ select: manual
+ spacefueltank:
+ class: SpaceFuelContainer
+ select: manual
+ rocketfueltank:
+ class: RocketFuelContainer
+ select: manual
+handlers:
+ unit:
+ start:
+ lua: |
+ -- error handling code added by wrap.lua
+ __wrap_lua__stopped = false
+ __wrap_lua__stopOnError = false
+ __wrap_lua__rethrowErrorAlways = false
+ __wrap_lua__rethrowErrorIfStopped = true
+ __wrap_lua__printError = true
+ __wrap_lua__showErrorOnScreens = true
+
+ function __wrap_lua__error (message)
+ if __wrap_lua__stopped then return end
+
+ -- make the traceback more readable and escape HTML syntax characters
+ message = tostring(message):gsub('"%-%- |STDERROR%-EVENTHANDLER[^"]*"', 'chunk'):gsub("&", "&"):gsub("<", "<"):gsub(">", ">")
+
+ local unit = unit or self or {}
+
+ if __wrap_lua__showErrorOnScreens then
+ for _, value in pairs(unit) do
+ if type(value) == "table" and value.setCenteredText and value.setHTML then -- value is a screen
+ if message:match("\n") then
+ value.setHTML([[
+
+ Error: ]] .. message .. [[
+
]])
+ else
+ value.setCenteredText(message)
+ end
+ end
+ end
+ end
+
+ if __wrap_lua__printError and system and system.print then
+ system.print("Error: " .. message:gsub("\n", " "))
+ end
+
+ if __wrap_lua__stopOnError then
+ __wrap_lua__stopped = true
+ end
+
+ if __wrap_lua__stopped and unit and unit.exit then
+ unit.exit()
+ end
+
+ if __wrap_lua__rethrowErrorAlways or (__wrap_lua__stopped and __wrap_lua__rethrowErrorIfStopped) then
+ error(message)
+ end
+ end
+
+ -- in case traceback is removed or renamed
+ __wrap_lua__traceback = traceback or (debug and debug.traceback) or function (arg1, arg2) return arg2 or arg1 end
+
+ local ok, message = xpcall(function ()
+
+ -- script code
+
+ useTheseSettings = false --export: Toggle on to use the below preferences. Toggle off to use saved preferences. Preferences will save regardless when exiting seat.
+ freeLookToggle = true --export: Set to false for default free look behavior.
+ BrakeToggleDefault = true --export: Whether your brake toggle is on/off by default. Can be adjusted in the button menu
+ RemoteFreeze = false --export: Whether or not to freeze you when using a remote controller. Breaks some things, only freeze on surfboards
+ RemoteHud = false --export: Whether you want full HUD while in remote mode
+ userControlScheme = "Virtual Joystick" --export: Set to "Virtual Joystick", "Mouse", or "Keyboard"
+ brightHud = false --export: Enable to prevent hud dimming when in freelook.
+ PrimaryR = 130 --export: Primary HUD color
+ PrimaryG = 224 --export: Primary HUD color
+ PrimaryB = 255 --export: Primary HUD color
+ centerX = 960 --export: X postion of Artifical Horizon (KSP Navball), also determines placement of throttle. (use 1920x1080, it will scale) Default 960. Use centerX=700 and centerY=980 for lower left placement.
+ centerY = 540 --export: Y postion of Artifical Horizon (KSP Navball), also determines placement of throttle. (use 1920x1080, it will scale) Default 540. Use centerX=700 and centerY=980 for lower left placement.
+ throtPosX = 1300 --export: X position of Throttle Indicator, default 1300 to put it to right of default AH centerX parameter.
+ throtPosY = 540 --export: Y position of Throttle indicator, default is 540 to place it centered on default AH centerY parameter.
+ vSpdMeterX = 1525 --export: X postion of Vertical Speed Meter. Default 1525 (use 1920x1080, it will scale)
+ vSpdMeterY = 250 --export: Y postion of Vertical Speed Meter. Default 250 (use 1920x1080, it will scale)
+ altMeterX = 550 --export: X postion of Altimeter. Default 550 (use 1920x1080, it will scale)
+ altMeterY = 540 --export: Y postion of Altimeter. Default 500 (use 1920x1080, it will scale)
+ fuelX = 100 --export: X position of fuel tanks, default is 100 for left side, set both fuelX and fuelY to 0 to hide fuel
+ fuelY = 350 --export: Y position of fuel tanks, default 350 for left side, set both fuelX and fuelY to 0 to hide fuel
+ circleRad = 400 --export: The size of the artifical horizon circle, set to 0 to remove.
+ DeadZone = 50 --export: Number of pixels of deadzone at the center of the screen
+ StallAngle = 35 --export: Determines how much Autopilot is allowed to make you yaw/pitch in atmosphere. Also gives a stall warning. (default 35, higher = more tolerance for yaw/pitch/roll)
+ showHud = true --export: Uncheck to hide the HUD and only use autopilot features via ALT+# keys.
+ hideHudOnToggleWidgets = true --export: Uncheck to keep showing HUD when you toggle on the widgets via ALT+3.
+ ShiftShowsRemoteButtons = true --export: Whether or not pressing Shift in remote controller mode shows you the buttons (otherwise no access to them)
+ speedChangeLarge = 5 --export: The speed change that occurs when you tap speed up/down, default is 5 (25% throttle change).
+ speedChangeSmall = 1 --export: the speed change that occurs while you hold speed up/down, default is 1 (5% throttle change).
+ TargetHoverHeight = 50 --export: Hover height when retracting landing gear
+ LandingGearGroundHeight = 0 --export: Set to hover height reported - 1 when you use alt-spacebar to just lift off ground from landed postion. 4 is M size landing gear,
+ MouseYSensitivity = 0.003 --export:1 For virtual joystick only
+ MouseXSensitivity = 0.003 --export: For virtual joystick only
+ pitchSpeedFactor = 0.8 --export: For keyboard control
+ yawSpeedFactor = 1 --export: For keyboard control
+ rollSpeedFactor = 1.5 --export: This factor will increase/decrease the player input along the roll axis (higher value may be unstable) Valid values: Superior or equal to 0.01
+ brakeSpeedFactor = 3 --export: When braking, this factor will increase the brake force by brakeSpeedFactor * velocity Valid values: Superior or equal to 0.01
+ brakeFlatFactor = 1 --export: When braking, this factor will increase the brake force by a flat brakeFlatFactor * velocity direction> (higher value may be unstable) Valid values: Superior or equal to 0.01
+ fuelTankHandlingAtmo = 0 --export: For accurate estimates, set this to the fuel tank handling level of the person who placed the element. Ignored for slotted tanks.
+ fuelTankHandlingSpace = 0 --export: For accurate estimates, set this to the fuel tank handling level of the person who placed the element. Ignored for slotted tanks.
+ fuelTankHandlingRocket = 0 --export: For accurate estimates, set this to the fuel tank handling level of the person who placed the element. Ignored for slotted tanks.
+ apTickRate = 0.0166667 --export: Set the Tick Rate for your HUD. 0.016667 is effectively 60 fps and the default value. 0.03333333 is 30 fps. The bigger the number the less often the autopilot and hud updates but may help peformance on slower machings.
+ script={}function script.onStart()SetupComplete=false;beginSetup=coroutine.create(function()Nav=Navigator.new(system,core,unit)Nav.axisCommandManager:setupCustomTargetSpeedRanges(axisCommandId.longitudinal,{1000,5000,10000,20000,30000})VERSION_NUMBER=1.03;local a=math.floor;local b=string.format;local c=json.decode;local d=json.encode;local e=core.getElementMaxHitPointsById;local f=unit.getAtmosphereDensity;local g=core.getElementHitPointsById;local h=core.getElementTypeById;local j=core.getElementMassById;local k=core.getConstructMass;local l=Nav.control.isRemoteControlled;SaveableVariables={"userControlScheme","apTickRate","freeLookToggle","PrimaryR","PrimaryG","PrimaryB","DeadZone","circleRad","MouseXSensitivity","MouseYSensitivity","MaxGameVelocity","showHud","pitchSpeedFactor","yawSpeedFactor","rollSpeedFactor","brakeSpeedFactor","brakeFlatFactor","torqueFactor","TargetHoverHeight","hideHudOnToggleWidgets","DampingMultiplier","fuelTankHandlingAtmo","fuelTankHandlingSpace","fuelTankHandlingRocket","RemoteFreeze","speedChangeLarge","speedChangeSmall","brightHud","MaxPitch","centerX","centerY","vSpdMeterX","vSpdMeterY","altMeterX","altMeterY","fuelX","fuelY","LandingGearGroundHeight","RemoteHud","StallAngle"}ToggleView=true;LastMaxBrake=0;LastMaxBrakeInAtmo=0;EmergencyWarp=false;ReentryMode=false;MousePitchFactor=1;MouseYawFactor=1;HasGear=false;PitchInput=0;PitchInput2=0;YawInput2=0;RollInput=0;YawInput=0;BrakeInput=0;RollInput2=0;HoldingCtrl=false;PrevViewLock=1;MsgText="empty"LastEccentricity=1;AntiGravButtonModifier=5;IsBoosting=false;HasSpaceRadar=false;HasAtmoRadar=false;TotalDistanceTravelled=0.0;TotalDistanceTrip=0;FlightTime=0;WipedDatabank=false;LocationIndex=0;UpAmount=0;BrakeIsOn=false;SimulatedX=0;SimulatedY=0;MsgTimer=3;TargetGroundAltitude=nil;GearExtended=nil;Distance=0;RadarMessage=""LastOdometerOutput=""Peris=0;CoreAltitude=core.getAltitude()AntigravTargetAltitude=CoreAltitude;ElementsID=core.getElementIdList()LastTravelTime=system.getTime()TotalFlightTime=0;HasGear=false;AutopilotPlanetGravity=0;DisplayOrbit=true;SavedLocations={}LandingGearGroundHeight=0;local m={}local n=""local o=true;local p={}local q=2560;local r=1440;local s=nil;local t=nil;local u=nil;local v=nil;local w=false;local x=false;local y=0;local z=nil;local A={}local B={}local C={}local D=0;local E=false;local F={}local G={}local H=a(1/apTickRate)*2;local I={}local J={}local K={}local L={}local M=false;local N=16;local O=0;AutoVariables={"brakeToggle","BrakeIsOn","DisplayOrbit","PrevViewLock","GearExtended","TargetGroundAltitude","TotalDistanceTravelled","TotalFlightTime","LastMaxBrake","LastMaxBrakeInAtmo","AntigravTargetAltitude"}if dbHud then local P=dbHud.hasKey;if not useTheseSettings then for Q,R in pairs(SaveableVariables)do if P(R)then local S=c(dbHud.getStringValue(R))if S~=nil then system.print(R.." "..dbHud.getStringValue(R))_G[R]=S;w=true end end end end;for Q,R in pairs(AutoVariables)do if P(R)then local S=c(dbHud.getStringValue(R))if S~=nil then system.print(R.." "..dbHud.getStringValue(R))_G[R]=S;w=true end end end;if useTheseSettings then MsgText="Updated user preferences used. Will be saved when you exit seat. Toggle off useTheseSettings to use saved values"elseif w then MsgText="Loaded Saved Variables (see Lua Chat Tab for list)"else MsgText="No Saved Variables Found - Stand up / leave remote to save settings"end else MsgText="No databank found, install one anywhere and rerun the autoconfigure to save variables"end;brakeToggle=BrakeToggleDefault;MinimumRateOfChange=math.cos(StallAngle*constants.deg2rad)if antigrav then if AntigravTargetAltitude==nil then AntigravTargetAltitude=CoreAltitude end;antigrav.setBaseAltitude(AntigravTargetAltitude)end;rgb=[[rgb(]]..a(PrimaryR+0.5)..","..a(PrimaryG+0.5)..","..a(PrimaryB+0.5)..[[)]]local T=[[rgb(]]..a(PrimaryR*0.9+0.5)..","..a(PrimaryG*0.9+0.5)..","..a(PrimaryB*0.9+0.5)..[[)]]coroutine.yield()for Q in pairs(ElementsID)do local U=h(ElementsID[Q])if U=="landing gear"then HasGear=true end;if U=="dynamic core"then local V=e(ElementsID[Q])if V>10000 then N=128 elseif V>1000 then N=64 elseif V>150 then N=32 end end;D=D+e(ElementsID[Q])if fuelX~=0 and fuelY~=0 then if U=="atmospheric fuel-tank"or U=="space fuel-tank"or U=="rocket fuel-tank"then local V=e(ElementsID[Q])local W=j(ElementsID[Q])local X=0;local Y=system.getTime()if U=="atmospheric fuel-tank"then local Z=400;local _=35.03;if V>10000 then Z=51200;_=5480 elseif V>1300 then Z=6400;_=988.67 elseif V>150 then Z=1600;_=182.67 end;X=W-_;if fuelTankHandlingAtmo>0 then Z=Z+Z*fuelTankHandlingAtmo*0.2 end;if X>Z then Z=X end;A[#A+1]={ElementsID[Q],core.getElementNameById(ElementsID[Q]),Z,_,X,Y}end;if U=="rocket fuel-tank"then local Z=320;local _=173.42;if V>65000 then Z=40000;_=25740 elseif V>6000 then Z=5120;_=4720 elseif V>700 then Z=640;_=886.72 end;X=W-_;if fuelTankHandlingRocket>0 then Z=Z+Z*fuelTankHandlingRocket*0.2 end;if X>Z then Z=X end;C[#C+1]={ElementsID[Q],core.getElementNameById(ElementsID[Q]),Z,_,X,Y}end;if U=="space fuel-tank"then local Z=2400;local _=182.67;if V>10000 then Z=76800;_=5480 elseif V>1300 then Z=9600;_=988.67 end;X=W-_;if fuelTankHandlingSpace>0 then Z=Z+Z*fuelTankHandlingSpace*0.2 end;if X>Z then Z=X end;B[#B+1]={ElementsID[Q],core.getElementNameById(ElementsID[Q]),Z,_,X,Y}end end end end;if gyro~=nil then GyroIsOn=gyro.getState()==1 end;if userControlScheme~="Keyboard"then system.lockView(1)else system.lockView(0)end;if f()>0 then BrakeIsOn=true end;if radar_1 then if h(radar_1.getId())=="Space Radar"then HasSpaceRadar=true else HasAtmoRadar=true end end;if door then for a0,R in pairs(door)do R.deactivate()end end;if forcefield then for a0,R in pairs(forcefield)do R.deactivate()end end;if antigrav~=nil then if antigrav.getState()==1 then antigrav.show()end end;if l()==1 and RemoteFreeze then system.freeze(1)else system.freeze(0)end;if HasGear then GearExtended=Nav.control.isAnyLandingGearExtended()==1;if GearExtended then Nav.control.extendLandingGears()else Nav.control.retractLandingGears()end end;if TargetGroundAltitude~=nil then Nav.axisCommandManager:setTargetGroundAltitude(TargetGroundAltitude)if TargetGroundAltitude==0 and not HasGear then GearExtended=true end else if GearExtended or not HasGear then Nav.axisCommandManager:setTargetGroundAltitude(LandingGearGroundHeight)GearExtended=true else Nav.axisCommandManager:setTargetGroundAltitude(TargetHoverHeight)end end;if f()>0 and not dbHud and(GearExtended or not HasGear)then BrakeIsOn=true end;WasInAtmo=f()>0;unit.hide()function refreshLastMaxBrake(a1,a2)if a1==nil then a1=core.g()end;a1=round(a1,5)if a2~=nil and a2 or(z==nil or z~=a1)then local a3=c(unit.getData()).maxBrake;if a3~=nil then LastMaxBrake=a3 end;if f()>0 then LastMaxBrakeInAtmo=a3 end;z=a1 end end;function MakeButton(a4,a5,a6,a7,a8,a9,aa,ab,ac)local ad={enableName=a4,disableName=a5,width=a6,height=a7,x=a8,y=a9,toggleVar=aa,toggleFunction=ab,drawCondition=ac,hovered=false}table.insert(p,ad)return ad end;function UpdateAtlasLocationsList()AtlasOrdered={}for Q,R in pairs(atlas[0])do table.insert(AtlasOrdered,{name=R.name,index=Q})end;local function ae(af,ag)return af.name]],DeadZone)end;function updateWeapons()if weapon then if WeaponPanelID==nil and(radarPanelID~=nil or GearExtended)then _autoconf.displayCategoryPanel(weapon,weapon_size,L_TEXT("ui_lua_widget_weapon", "Weapons"),"weapon",true)WeaponPanelID=_autoconf.panels[_autoconf.panels_size]elseif WeaponPanelID~=nil and radarPanelID==nil and not GearExtended then system.destroyWidgetPanel(WeaponPanelID)WeaponPanelID=nil end end end;function ToggleRadarPanel()if radarPanelID~=nil and Peris==0 then system.destroyWidgetPanel(radarPanelID)radarPanelID=nil;if perisPanelID~=nil then system.destroyWidgetPanel(perisPanelID)perisPanelID=nil end else if Peris==1 then system.destroyWidgetPanel(radarPanelID)radarPanelID=nil;_autoconf.displayCategoryPanel(radar,radar_size,L_TEXT("ui_lua_widget_periscope", "Periscope"),"periscope")perisPanelID=_autoconf.panels[_autoconf.panels_size]end;placeRadar=true;if radarPanelID==nil and placeRadar then _autoconf.displayCategoryPanel(radar,radar_size,L_TEXT("ui_lua_widget_radar", "Radar"),"radar")radarPanelID=_autoconf.panels[_autoconf.panels_size]placeRadar=false end;Peris=0 end end;function ToggleWidgets()if o then unit.show()core.show()if atmofueltank_size>0 then _autoconf.displayCategoryPanel(atmofueltank,atmofueltank_size,L_TEXT("ui_lua_widget_atmofuel", "Atmo Fuel"),"fuel_container")fuelPanelID=_autoconf.panels[_autoconf.panels_size]end;if spacefueltank_size>0 then _autoconf.displayCategoryPanel(spacefueltank,spacefueltank_size,L_TEXT("ui_lua_widget_spacefuel", "Space Fuel"),"fuel_container")spacefuelPanelID=_autoconf.panels[_autoconf.panels_size]end;if rocketfueltank_size>0 then _autoconf.displayCategoryPanel(rocketfueltank,rocketfueltank_size,L_TEXT("ui_lua_widget_rocketfuel", "Rocket Fuel"),"fuel_container")rocketfuelPanelID=_autoconf.panels[_autoconf.panels_size]end;o=false else unit.hide()core.hide()if fuelPanelID~=nil then system.destroyWidgetPanel(fuelPanelID)fuelPanelID=nil end;if spacefuelPanelID~=nil then system.destroyWidgetPanel(spacefuelPanelID)spacefuelPanelID=nil end;if rocketfuelPanelID~=nil then system.destroyWidgetPanel(rocketfuelPanelID)rocketfuelPanelID=nil end;o=true end end;function Contains(ai,aj,a8,a9,a6,a7)if ai>a8 and aia9 and aj0 and m[11]==ElementsID[Q]then for at in pairs(m)do core.deleteSticker(m[at])end;m={}end end;ak=a(am/al*100)if ak<100 then ah[#ah+1]=[[]]ap=a(ak*2.55)aq=b("rgb(%d,%d,%d)",255-ap,ap,0)if ak<100 then ah[#ah+1]=b([[Elemental Integrity: %i %%]],aq,ak)if ao>0 then ah[#ah+1]=b([[Disabled Modules: %i Damaged Modules: %i]],aq,ao,an)elseif an>0 then ah[#ah+1]=b([[Damaged Modules: %i]],aq,an)end end;ah[#ah+1]=[[<\g>]]end end;function DrawCursorLine(ah)local au=a(utils.clamp(Distance/(q/4)*255,0,255))ah[#ah+1]=b("",SimulatedX,SimulatedY,a(PrimaryR+0.5)+au,a(PrimaryG+0.5)-au,a(PrimaryB+0.5)-au)end;function getPitch(av,aw,ag)local ax=av:cross(ag):normalize_inplace()local ay=math.acos(utils.clamp(ax:dot(-aw),-1,1))*constants.rad2deg;if ax:cross(-aw):dot(ag)<0 then ay=-ay end;return ay end;function wipeSaveVariables()if not dbHud then MsgText="No Databank Found, unable to wipe. \nYou must have a Databank attached to ship prior to running the HUD autoconfigure"MsgTimer=5 else if x then for Q,R in pairs(SaveableVariables)do dbHud.setStringValue(R,d(nil))end;for Q,R in pairs(AutoVariables)do if R~="SavedLocations"then dbHud.setStringValue(R,d(nil))end end;MsgText="Databank wiped. New variables will save after re-enter seat and exit"MsgTimer=5;x=false;w=false;WipedDatabank=true else MsgText="Press ALT-7 again to confirm wipe of ALL data"x=true end end end;function CheckButtons()for a0,R in pairs(p)do if R.hovered then if not R.drawCondition or R.drawCondition()then R.toggleFunction()end;R.hovered=false end end end;function SetButtonContains()local a8=SimulatedX+q/2;local a9=SimulatedY+r/2;for a0,R in pairs(p)do R.hovered=Contains(a8,a9,R.x,R.y,R.width,R.height)end end;function DrawButton(ah,az,hover,a8,a9,aA,aB,aC,aD,aE,aF)if type(aE)=="function"then aE=aE()end;if type(aF)=="function"then aF=aF()end;ah[#ah+1]=b(""ah[#ah+1]=b(""if az then ah[#ah+1]=b("%s",aE)else ah[#ah+1]=b("%s",aF)end end;function DrawButtons(ah)local aG="rgb(50,50,50)'"local aH="rgb(210,200,200)"local aI=DrawButton;for a0,R in pairs(p)do local a5=R.disableName;local a4=R.enableName;if type(a5)=="function"then a5=a5()end;if type(a4)=="function"then a4=a4()end;if not R.drawCondition or R.drawCondition()then aI(ah,R.toggleVar(),R.hovered,R.x,R.y,R.width,R.height,aH,aG,a5,a4)end end end;function DrawTank(ah,M,a8,aJ,aK,aL,aM,aN)local aO=1;local aP=2;local aQ=3;local aR=4;local aS=5;local aT=6;local aU=""local aV=0;local aW=fuelY;local aX=fuelY+10;if l()==1 and not RemoteHud then aW=aW-50;aX=aX-50 end;ah[#ah+1]=[[]]if aK=="ATMO"then aU="atmofueltank"elseif aK=="SPACE"then aU="spacefueltank"else aU="rocketfueltank"end;aV=_G[aU.."_size"]if#aL>0 then for i=1,#aL do local U=string.sub(aL[i][aP],1,12)local aY=0;for at=1,aV do if aL[i][aP]==json.decode(unit[aU.."_"..at].getData()).name then aY=at;break end end;if M or aM[i]==nil or aN[i]==nil then local aZ=0;local a_=0;local b0=0;local b1=0;local Y=system.getTime()if aY~=0 then aN[i]=json.decode(unit[aU.."_"..aY].getData()).percentage;aM[i]=json.decode(unit[aU.."_"..aY].getData()).timeLeft;if aM[i]=="n/a"then aM[i]=0 end else b0=j(aL[i][aO])-aL[i][aR]aZ=aL[i][aQ]aN[i]=a(0.5+b0*100/aZ)a_=aL[i][aS]b1=aL[i][aT]if a_<=b0 then aM[i]=0 else aM[i]=a(0.5+b0/((a_-b0)/(Y-b1)))end;aL[i][aS]=b0;aL[i][aT]=Y end end;if U==aJ then U=b("%s %d",aK,i)end;if aY==0 then U=U.." *"end;local b2;if aM[i]==0 then b2="n/a"else b2=FormatTimeString(aM[i])end;if aN[i]~=nil then local ap=a(aN[i]*2.55)local aq=b("rgb(%d,%d,%d)",255-ap,ap,0)local b3=""if b2~="n/a"and aM[i]<120 or aN[i]<5 then if M then b3=[[class="red"]]end end;ah[#ah+1]=b([[
+ %s
+ %d%% %s
+ ]],a8,aW,b3,U,a8,aX,aq,aN[i],b2)aW=aW+30;aX=aX+30 end end end;ah[#ah+1]=""end;system.showScreen(1)function getRelativePitch(velocity)velocity=vec3(velocity)local ay=-math.deg(math.atan(velocity.y,velocity.z))+180;ay=ay-90;if ay<0 then ay=360+ay end;if ay>180 then ay=-180+ay-180 end;return-ay end;function getRelativeYaw(velocity)velocity=vec3(velocity)local b4=math.deg(math.atan(velocity.y,velocity.x))-90;if b4<-180 then b4=360+b4 end;return b4 end;function ToggleAntigrav()if antigrav then if antigrav.getState()==1 then antigrav.deactivate()antigrav.hide()else if AntigravTargetAltitude==nil then AntigravTargetAltitude=CoreAltitude end;if AntigravTargetAltitude<1000 then AntigravTargetAltitude=1000 end;antigrav.activate()antigrav.show()end end end;local b5=50;local b6=260;MakeButton("Enable Brake Toggle","Disable Brake Toggle",b6,b5,q/2-b6/2,r/2+350,function()return brakeToggle end,function()brakeToggle=not brakeToggle;if brakeToggle then MsgText="Brakes in Toggle Mode"else MsgText="Brakes in Default Mode"end end)b5=60;b6=300;local a8=10;local a9=r/2-300;a9=a9+b5+20;MakeButton("Show Orbit Display","Hide Orbit Display",b6,b5,a8,a9,function()return DisplayOrbit end,function()DisplayOrbit=not DisplayOrbit;if DisplayOrbit then MsgText="Orbit Display Enabled"else MsgText="Orbit Display Disabled"end end)a9=a9+b5+20;MakeButton("Enable Repair Arrows","Disable Repair Arrows",b6,b5,a8+b6+20,a9,function()return E end,function()E=not E;if E then MsgText="Repair Arrows Enabled"else MsgText="Repair Arrows Diabled"end end,function()return l()==1 end)a9=a9+b5+20;MakeButton("Enable AGG","Disable AGG",b6,b5,a8,a9,function()return antigrav.getState()==1 end,ToggleAntigrav,function()return antigrav~=nil end)a9=a9+b5+20;MakeButton(function()return string.format("Toggle Control Scheme - Current: %s",userControlScheme)end,function()return string.format("Control Scheme: %s",userControlScheme)end,b6*2,b5,a8,a9,function()return false end,function()if userControlScheme=="Keyboard"then userControlScheme="Mouse"elseif userControlScheme=="Mouse"then userControlScheme="Virtual Joystick"else userControlScheme="Keyboard"end end)coroutine.yield()function updateHud(ah)local b7=CoreAltitude;local velocity=core.getVelocity()local b8=vec3(velocity):len()local b9=vec3(core.getWorldVertical())local ba=vec3(core.getConstructWorldOrientationForward())local bb=vec3(core.getConstructWorldOrientationRight())local ay=getPitch(b9,ba,bb)local bc=getRoll(b9,ba,bb)local bd=bc;local be=ay;local bf=f()local bg=a(unit.getThrottle())local bh=b8*3.6;local bi=unit.getAxisCommandValue(0)local bj=GetFlightStyle()local bk="ROLL"local bl=unit.getClosestPlanetInfluence()>0;if bg==nil then bg=0 end;if not bl then if b8>5 then ay=getRelativePitch(velocity)bc=getRelativeYaw(velocity)else ay=0;bc=0 end;bk="YAW"end;ah[#ah+1]=LastOdometerOutput;ah[#ah+1]=n;ah[#ah+1]=RadarMessage;if O%H==0 then M=true end;if fuelX~=0 and fuelY~=0 then DrawTank(ah,M,fuelX,"Atmospheric ","ATMO",A,K,L)DrawTank(ah,M,fuelX+100,"Space fuel t","SPACE",B,I,J)DrawTank(ah,M,fuelX+200,"Rocket fuel ","ROCKET",C,F,G)end;if M then M=false;O=0 end;O=O+1;DrawVerticalSpeed(ah,b7,bf)if l()==0 or RemoteHud then if not IsInFreeLook()or brightHud then if bl then DrawRollLines(ah,centerX,centerY,bd,bk,bl)DrawArtificialHorizon(ah,be,bd,bf,centerX,centerY,bl)DrawAltitudeDisplay(ah,b7,bf)else DrawRollLines(ah,centerX,centerY,bc,bk,bl)DrawArtificialHorizon(ah,ay,bc,bf,centerX,centerY,bl)end;DrawPrograde(ah,bf,velocity,b8,centerX,centerY)end end;DrawThrottle(ah,bj,bg,bi)DrawSpeed(ah,bh)DrawWarnings(ah)DisplayOrbitScreen(ah)if screen_2 then local bm=vec3(core.getConstructWorldPos())local a8=960+bm.x/MapXRatio;local a9=450+bm.y/MapYRatio;screen_2.moveContent(YouAreHere,(a8-80)/19.2,(a9-80)/10.8)end end;function IsInFreeLook()return system.isViewLocked()==0 and userControlScheme~="Keyboard"and l()==0 end;function HUDPrologue(ah)local bn=rgb;local bo=T;local bp=rgb;local bq=T;if IsInFreeLook()and not brightHud then bn=[[rgb(]]..a(PrimaryR*0.4+0.5)..","..a(PrimaryG*0.4+0.5)..","..a(PrimaryB*0.3+0.5)..[[)]]bo=[[rgb(]]..a(PrimaryR*0.3+0.5)..","..a(PrimaryG*0.3+0.5)..","..a(PrimaryB*0.2+0.5)..[[)]]end;ah[#ah+1]=b([[
+
+
+
+
+ "end;function DrawSpeed(ah,bh)local br=throtPosY-10;local bs=throtPosX+10;ah[#ah+1]=[[]]if l()==1 and not RemoteHud then br=75 end;ah[#ah+1]=b([[
+
+ %d km/h
+
+ ]],bs,br,a(bh))end;function DrawOdometer(ah,TotalDistanceTrip,TotalDistanceTravelled,bj,bt)local bu=1240;local bv=55;local bw=65;local bf=f()local a1=core.g()local bx=0;local by=0;refreshLastMaxBrake(a1)maxThrust=Nav:maxForceForward()y=k()local bz=vec3(core.getWorldAcceleration()):len()/9.80665;if a1>0.1 then by=y*a1;bx=maxThrust/a1 end;ah[#ah+1]=[[]]if l()==1 and not RemoteHud then bu=1120;bv=55;bw=65 elseif bf>0 then ah[#ah+1]=b([[
+ ATMOSPHERE
+ %.2f
+ ]],bf)end;ah[#ah+1]=b([[
+
+
+ GRAVITY
+ %.2f g
+ ACCEL
+ %.2f g
+ ]],bu,bv,bu,bw,a1/9.80665,bu,bv+20,bu,bw+20,bz)ah[#ah+1]=[[
+ ]]if l()==0 or RemoteHud then ah[#ah+1]=b([[
+ Trip: %.2f km
+ Lifetime: %.2f Mm
+ Trip Time: %s
+ Total Time: %s
+ Mass: %.2f Tons
+ Max Brake: %.2f kN
+ Max Thrust: %.2f kN
+ %s
+ ]],TotalDistanceTrip,TotalDistanceTravelled/1000,FormatTimeString(bt),FormatTimeString(TotalFlightTime),y/1000,LastMaxBrake/1000,maxThrust/1000,bj)if a1>0.1 then ah[#ah+1]=b([[
+ Max Mass: %.2f Tons
+ Req Thrust: %.2f kN
+ ]],bx/1000,by/1000)else ah[#ah+1]=[[
+ Max Mass: n/a
+ Req Thrust: n/a
+ ]]end else ah[#ah+1]=b([[%s]],bj)end;ah[#ah+1]=""end;function DrawThrottle(ah,bj,bg,bi)local aW=throtPosY+10;local aX=throtPosY+20;if l()==1 and not RemoteHud then aW=55;aX=65 end;local bA="CRUISE"local unit="km/h"local bB=bi;if bj=="TRAVEL"or bj=="AUTOPILOT"then bA="THROT"unit="%"bB=bg;local bC="dim"if bg<0 then bC="red"end;ah[#ah+1]=b([[
+
+
+
+ ]],bC,throtPosX-7,throtPosY-50,throtPosX,throtPosY-50,throtPosX,throtPosY+50,throtPosX-7,throtPosY+50,1-math.abs(bg),throtPosX-10,throtPosY+50,throtPosX-15,throtPosY+53,throtPosX-15,throtPosY+47)end;ah[#ah+1]=b([[
+
+ %s
+ %d %s
+
+ ]],throtPosX+10,aW,bA,throtPosX+10,aX,bB,unit)end;function DrawVerticalSpeed(ah,b7,bf)if b7<200000 and bf==0 or b7 and bf>0 then local velocity=vec3(core.getWorldVelocity())local bD=vec3(core.getWorldVertical())*-1;local bE=velocity.x*bD.x+velocity.y*bD.y+velocity.z*bD.z;local bF=0;if math.abs(bE)>1 then bF=45*math.log(math.abs(bE),10)if bE<0 then bF=-bF end end;ah[#ah+1]=b([[
+
+ 1000
+ 100
+ 10
+ O
+ -10
+ -100
+ -1000
+ %d m/s
+
+
+
+
+
+
+ ]],vSpdMeterX,vSpdMeterY,a(bE),a(bF))end end;function getHeading(aw)local bD=-vec3(core.getWorldVertical())aw=aw-aw:project_on(bD)local bG=vec3(0,0,1)bG=bG-bG:project_on(bD)local bH=bG:cross(bD)local bF=bG:angle_between(aw)*constants.rad2deg;if aw:dot(bH)<0 then bF=360-bF end;return bF end;function DrawRollLines(ah,centerX,centerY,bd,bk,bl)local bI=circleRad;local bJ=20;bJ=math.floor(bJ)local bK=a(bd)if bl then for i=-45,45,5 do local bL=i;ah[#ah+1]=b([[]],bL,centerX,centerY)len=5;if i%15==0 then len=15 elseif i%10==0 then len=10 end;ah[#ah+1]=b([[]],centerX,centerY+bI+bJ-len,centerX,centerY+bI+bJ)end;ah[#ah+1]=b([["
+
+ %s
+ %d deg
+
+ ]],centerX,centerY+bI+bJ-35,bk,centerX,centerY+bI+bJ-25,bK)ah[#ah+1]=b([[]],-bd,centerX,centerY)ah[#ah+1]=b([[<]],centerX-5,centerY+bI+bJ-20,centerX+5,centerY+bI+bJ-20,centerX,centerY+bI+bJ-15)ah[#ah+1]=""end;local b4=bK;if bl then b4=getHeading(vec3(core.getConstructWorldOrientationForward()))end;local bM=20;local bN=a(b4)local bO=0;local bP=centerY+bI+bJ+20;local bQ=centerX;if bk~="YAW"then bP=130;bQ=960 end;local bR=[[%d]],a8+5,bP-12,bS)elseif i%5==0 then bO=5 end;if bO==10 then bR=b([[%s M %f %f v %d]],bR,a8,bP-5,bO)else bR=b([[%s M %f %f v %d]],bR,a8,bP-2.5,bO)end end;ah[#ah+1]=bR..[["/>]]ah[#ah+1]=b([[<]],bQ-5,bP+10,bQ+5,bP+10,bQ,bP+5)if bl then bk="HDG"end;ah[#ah+1]=b([["
+
+ %d deg
+ %s
+
+ ]],bQ,bP+25,bN,bQ,bP+35,bk)end;function DrawArtificialHorizon(ah,be,bd,bf,centerX,centerY,bl)local bI=circleRad;local bT=math.floor(bI*3/5)if bI>0 then local bU=a(be)local len=0;local bR=b([[]],bI-1,centerX,centerY)ah[#ah+1]=[[]]for i=a(bU-30-bU%5+0.5),a(bU+30+bU%5+0.5),5 do if i%10==0 then len=30 elseif i%5==0 then len=20 end;local a9=centerY+-i*5+be*5;if len==30 then bR=b([[%s M %d %f h %d]],bR,centerX-bT-len,a9,len)if bf>0 then ah[#ah+1]=b([[%d]],-1*bd,centerX,centerY,centerX-bT+10,a9,i)ah[#ah+1]=b([[%d]],-1*bd,centerX,centerY,centerX+bT-10,a9,i)if i==0 or i==180 or i==-180 then ah[#ah+1]=b([[]],-1*bd,centerX,centerY,centerX-bT+10,a9,bT*2-20)end else ah[#ah+1]=b([[%d]],centerX-bT+10,a9,i)ah[#ah+1]=b([[%d]],centerX+bT-10,a9,i)end;bR=b([[%s M %d %f h %d]],bR,centerX+bT,a9,len)else bR=b([[%s M %d %f h %d]],bR,centerX-bT-len,a9,len)bR=b([[%s M %d %f h %d]],bR,centerX+bT,a9,len)end end;ah[#ah+1]=bR..[["/>]]local bV="PITCH"if not bl then bV="REL PITCH"end;if be>90 and bf==0 then be=90-(be-90)elseif be<-90 and bf==0 then be=-90-(be+90)end;if bI>200 then if bf>0 then ah[#ah+1]=b([[]],-bd,centerX,centerY)else ah[#ah+1]=b([[]],centerX,centerY)end;ah[#ah+1]=b([[< class="pdim txtend">%d]],centerX-bT+25,centerY-5,centerX-bT+20,centerY,centerX-bT+25,centerY+5,centerX-bT+50,centerY+4,bU)ah[#ah+1]=b([[< class="pdim txtend">%d]],centerX+bT-25,centerY-5,centerX+bT-20,centerY,centerX+bT-25,centerY+5,centerX+bT-30,centerY+4,bU)ah[#ah+1]=""end;ah[#ah+1]=b([[]],centerX-50,centerY)if bf==0 and bl then ah[#ah+1]=b([[]],-1*bd,centerX,centerY,centerX-bT+10,centerY,bT*2-20)end;ah[#ah+1]=""if bI<200 then ah[#ah+1]=b([["
+
+ %s
+ %d deg
+
+ ]],centerX,centerY-bI,bV,centerX,centerY-bI+10,bU)end end end;function DrawAltitudeDisplay(ah,b7,bf)if b7<200000 and bf==0 or b7 and bf>0 then local bW=altMeterX;local bX=altMeterY;local bY=78;local bZ=19;table.insert(ah,b([[
+
+
+
+ ]],bW-1,bX-4,bY+2,bZ+6,bW+1,bX-1,bY-4,bZ))local b_=0;local c0=1;local c1=0;local c2=b7<0;local c3=9;if c2 then c3=0 end;local b7=math.abs(b7)while b_<6 do local c4=11;local c5=16;local c6=9;local c7=14;local b3="altsm"if b_>2 then c5=c5+3;c4=c4+2;c7=c7+2;c6=c6-6;b3="altbig"end;if c2 then b3=b3 .." red"end;local c8=b7/c0%10;local c9=a(c8)local ca=a((c9+1)%10)local cb=c1;if b_==0 then cb=c8-c9;if c2 then cb=1-cb end end;if c2 and(b_==0 or c1~=0)then local cc=ca;ca=c9;c9=cc end;local cd=c5*(cb-1)local ce=cd+c5;local a8=bW+c6+(6-b_)*c4;local a9=bX+c7;table.insert(ah,b([[
+
+ %d
+ %d
+
+ ]],b3,a8,a9+cd,ca,a8,a9+ce,c9))b_=b_+1;c0=c0*10;if c9==c3 then c1=cb else c1=0 end end;table.insert(ah,[[]])end end;function DrawPrograde(ah,bf,velocity,b8,centerX,centerY)if b8>5 and bf==0 then local bI=circleRad;local cf=20;local cg=20;local ch=vec3(velocity)local ci=getRelativePitch(ch)local cj=getRelativeYaw(ch)local ck=-cj/cg*bI;local cl=ci/cf*bI;local a8=centerX+ck;local a9=centerY+cl;local cm=math.sqrt(ck^2+cl^2)if cm',a8,a9)else local bF=math.atan(cl,ck)local cn=centerX+bI*math.cos(bF)local co=centerY+bI*math.sin(bF)ah[#ah+1]=b('',cn,co)end;ci=getRelativePitch(-ch)cj=getRelativeYaw(-ch)ck=-cj/cg*bI;cl=ci/cf*bI;a8=centerX+ck;a9=centerY+cl;cm=math.sqrt(ck^2+cl^2)if bf==0 then if cm',a8,a9)else local bF=math.atan(cl,ck)local cn=centerX+bI*math.cos(bF)local co=centerY+bI*math.sin(bF)ah[#ah+1]=b('',cn,co)end end end end;function DrawWarnings(ah)ah[#ah+1]=b([[DU Hud Version: %.3f]],VERSION_NUMBER)ah[#ah+1]=[[]]if unit.isMouseControlActivated()==1 then ah[#ah+1]=[[Warning: Invalid Control Scheme Detected]]ah[#ah+1]=[[Keyboard Scheme must be selected]]ah[#ah+1]=[[Set your preferred scheme in Lua Parameters instead]]end;local cp=960;local cq=860;local cr=880;local cs=900;local ct=960;local cu=200;local cv=960;if l()==1 and not RemoteHud then cq=135;cr=155;cs=175;cu=115;turnBurnY=95 end;if BrakeIsOn then ah[#ah+1]=b([[Brake Engaged]],cp,cq)end;if GyroIsOn then ah[#ah+1]=b([[Gyro Enabled]],cp,cv)end;if f()~=0 and RateOfChange40 then ah[#ah+1]=b([[** STALL WARNING **]],cp,cu+25)end;if GearExtended then if HasGear then ah[#ah+1]=b([[Gear Extended]],cp,cr)else ah[#ah+1]=b([[Landed (G: Takeoff)]],cp,cr)end;ah[#ah+1]=b([[Hover Height: %s]],cp,cs,getDistanceDisplayString(Nav:getTargetGroundAltitude()))end;if IsBoosting then ah[#ah+1]=b([[ROCKET BOOST ENABLED]],cp,ct+20)end;if antigrav and antigrav.getState()==1 and AntigravTargetAltitude~=nil then if math.abs(CoreAltitude-antigrav.getBaseAltitude())<501 then ah[#ah+1]=b([[AGG On - Target Altitude: %d Singluarity Altitude: %d]],cp,cu+20,a(AntigravTargetAltitude),a(antigrav.getBaseAltitude()))else ah[#ah+1]=b([[AGG On - Target Altitude: %d Singluarity Altitude: %d]],cp,cu+20,a(AntigravTargetAltitude),a(antigrav.getBaseAltitude()))end end;ah[#ah+1]=""end;function DisplayOrbitScreen(ah)if orbit~=nil and unit.getAtmosphereDensity()<0.2 and planet~=nil and orbit.apoapsis~=nil and orbit.periapsis~=nil and orbit.period~=nil and orbit.apoapsis.speed>5 and DisplayOrbit then local cw=75;local cx=0;local cy=250;local cz=4;cx=cx+cz;local cA=15;local a8=cw+cy+cw/2+cz;local a9=cx+cy/2+5+cz;local cB,cC,cD,cE;cB=cy/4;cE=0;ah[#ah+1]=[[]]ah[#ah+1]=b('',cy+cw*2,cy+cx,cz,cz)if orbit.periapsis~=nil and orbit.apoapsis~=nil then cD=(orbit.apoapsis.altitude+orbit.periapsis.altitude+planet.radius*2)/(cB*2)cC=(planet.radius+orbit.periapsis.altitude+(orbit.apoapsis.altitude-orbit.periapsis.altitude)/2)/cD*(1-orbit.eccentricity)cE=cB-orbit.periapsis.altitude/cD-planet.radius/cD;local cF=""if orbit.periapsis.altitude<=0 then cF='redout'end;ah[#ah+1]=b([[]],cF,cw+cy/2+cE+cz,cx+cy/2+cz,cB,cC)ah[#ah+1]=b('',cw+cy/2+cz,cx+cy/2+cz,planet.radius/cD)end;if orbit.apoapsis~=nil and orbit.apoapsis.speed<8333.33 and orbit.apoapsis.speed>1 then ah[#ah+1]=b([[]],a8-35,a9-5,cw+cy/2+cB+cE,a9-5)ah[#ah+1]=b([[Apoapsis]],a8,a9)a9=a9+cA;ah[#ah+1]=b([[%s]],a8,a9,getDistanceDisplayString(orbit.apoapsis.altitude))a9=a9+cA;ah[#ah+1]=b([[%s]],a8,a9,FormatTimeString(orbit.timeToApoapsis))a9=a9+cA;ah[#ah+1]=b([[%s]],a8,a9,getSpeedDisplayString(orbit.apoapsis.speed))end;a9=cx+cy/2+5+cz;a8=cw-cw/2+10+cz;if orbit.periapsis~=nil and orbit.periapsis.speed<8333.33 and orbit.periapsis.speed>1 then ah[#ah+1]=b([[]],a8+35,a9-5,cw+cy/2-cB+cE,a9-5)ah[#ah+1]=b([[Periapsis]],a8,a9)a9=a9+cA;ah[#ah+1]=b([[%s]],a8,a9,getDistanceDisplayString(orbit.periapsis.altitude))a9=a9+cA;ah[#ah+1]=b([[%s]],a8,a9,FormatTimeString(orbit.timeToPeriapsis))a9=a9+cA;ah[#ah+1]=b([[%s]],a8,a9,getSpeedDisplayString(orbit.periapsis.speed))end;ah[#ah+1]=b([[%s]],cw+cy/2+cz,20+cz,planet.name)if orbit.period~=nil and orbit.periapsis~=nil and orbit.apoapsis~=nil and orbit.apoapsis.speed>1 then local cG=orbit.timeToApoapsis/orbit.period*2*math.pi;local cH=cB*math.cos(cG)local cI=cC*math.sin(cG)ah[#ah+1]=b('',cw+cy/2+cH+cE+cz,cx+cy/2+cI+cz)end;ah[#ah+1]=[[]]end end;function Atlas()return{[0]={[1]={GM=6930729684,bodyId=1,center={x=17465536.000,y=22665536.000,z=-34464.000},name='Madis',planetarySystemId=0,radius=44300,atmos=true,gravity=0.36},[2]={GM=157470826617,bodyId=2,center={x=-8.000,y=-8.000,z=-126303.000},name='Alioth',planetarySystemId=0,radius=126068,atmos=true,gravity=1.01},[3]={GM=11776905000,bodyId=3,center={x=29165536.000,y=10865536.000,z=65536.000},name='Thades',planetarySystemId=0,radius=49000,atmos=true,gravity=0.50},[4]={GM=14893847582,bodyId=4,center={x=-13234464.000,y=55765536.000,z=465536.000},name='Talemai',planetarySystemId=0,radius=57450,atmos=true,gravity=0.46},[5]={GM=16951680000,bodyId=5,center={x=-43534464.000,y=22565536.000,z=-48934464.000},name='Feli',planetarySystemId=0,radius=60000,atmos=true,gravity=0.48},[6]={GM=10502547741,bodyId=6,center={x=52765536.000,y=27165538.000,z=52065535.000},name='Sicari',planetarySystemId=0,radius=51100,atmos=true,gravity=0.41},[7]={GM=13033380591,bodyId=7,center={x=58665538.000,y=29665535.000,z=58165535.000},name='Sinnen',planetarySystemId=0,radius=54950,atmos=true,gravity=0.44},[8]={GM=18477723600,bodyId=8,center={x=80865538.000,y=54665536.000,z=-934463.940},name='Teoma',planetarySystemId=0,radius=62000,atmos=true,gravity=0.49},[9]={GM=18606274330,bodyId=9,center={x=-94134462.000,y=12765534.000,z=-3634464.000},name='Jago',planetarySystemId=0,radius=61590,atmos=true,gravity=0.50},[10]={GM=78480000,bodyId=10,center={x=17448118.224,y=22966846.286,z=143078.820},name='Madis Moon 1',planetarySystemId=0,radius=10000,atmos=false,gravity=0.08},[11]={GM=237402000,bodyId=11,center={x=17194626.000,y=22243633.880,z=-214962.810},name='Madis Moon 2',planetarySystemId=0,radius=11000,atmos=false,gravity=0.10},[12]={GM=265046609,bodyId=12,center={x=17520614.000,y=22184730.000,z=-309989.990},name='Madis Moon 3',planetarySystemId=0,radius=15005,atmos=false,gravity=0.12},[21]={GM=2118960000,bodyId=21,center={x=457933.000,y=-1509011.000,z=115524.000},name='Alioth Moon 1',planetarySystemId=0,radius=30000,atmos=false,gravity=0.24},[22]={GM=2165833514,bodyId=22,center={x=-1692694.000,y=729681.000,z=-411464.000},name='Alioth Moon 4',planetarySystemId=0,radius=30330,atmos=false,gravity=0.24},[26]={GM=68234043600,bodyId=26,center={x=-1404835.000,y=562655.000,z=-285074.000},name='Sanctuary',planetarySystemId=0,radius=83400,atmos=true,gravity=1.00},[30]={GM=211564034,bodyId=30,center={x=29214402.000,y=10907080.695,z=433858.200},name='Thades Moon 1',planetarySystemId=0,radius=14002,atmos=false,gravity=0.11},[31]={GM=264870000,bodyId=31,center={x=29404193.000,y=10432768.000,z=19554.131},name='Thades Moon 2',planetarySystemId=0,radius=15000,atmos=false,gravity=0.12},[40]={GM=141264000,bodyId=40,center={x=-13503090.000,y=55594325.000,z=769838.640},name='Talemai Moon 2',planetarySystemId=0,radius=12000,atmos=false,gravity=0.10},[41]={GM=106830900,bodyId=41,center={x=-12800515.000,y=55700259.000,z=325207.840},name='Talemai Moon 3',planetarySystemId=0,radius=11000,atmos=false,gravity=0.09},[42]={GM=264870000,bodyId=42,center={x=-13058408.000,y=55781856.000,z=740177.760},name='Talemai Moon 1',planetarySystemId=0,radius=15000,atmos=false,gravity=0.12},[50]={GM=499917600,bodyId=50,center={x=-43902841.780,y=22261034.700,z=-48862386.000},name='Feli Moon 1',planetarySystemId=0,radius=14000,atmos=false,gravity=0.11},[70]={GM=396912600,bodyId=70,center={x=58969616.000,y=29797945.000,z=57969449.000},name='Sinnen Moon 1',planetarySystemId=0,radius=17000,atmos=false,gravity=0.14},[100]={GM=13975172474,bodyId=100,center={x=98865536.000,y=-13534464.000,z=-934461.990},name='Lacobus',planetarySystemId=0,radius=55650,atmos=true,gravity=0.46},[101]={GM=264870000,bodyId=101,center={x=98905288.170,y=-13950921.100,z=-647589.530},name='Lacobus Moon 3',planetarySystemId=0,radius=15000,atmos=false,gravity=0.12},[102]={GM=444981600,bodyId=102,center={x=99180968.000,y=-13783862.000,z=-926156.400},name='Lacobus Moon 1',planetarySystemId=0,radius=18000,atmos=false,gravity=0.14},[103]={GM=211503600,bodyId=103,center={x=99250052.000,y=-13629215.000,z=-1059341.400},name='Lacobus Moon 2',planetarySystemId=0,radius=14000,atmos=false,gravity=0.11},[110]={GM=9204742375,bodyId=110,center={x=14165536.000,y=-85634465.000,z=-934464.300},name='Symeon',planetarySystemId=0,radius=49050,atmos=true,gravity=0.39},[120]={GM=7135606629,bodyId=120,center={x=2865536.700,y=-99034464.000,z=-934462.020},name='Ion',planetarySystemId=0,radius=44950,atmos=true,gravity=0.36},[121]={GM=106830900,bodyId=121,center={x=2472916.800,y=-99133747.000,z=-1133582.800},name='Ion Moon 1',planetarySystemId=0,radius=11000,atmos=false,gravity=0.09},[122]={GM=176580000,bodyId=122,center={x=2995424.500,y=-99275010.000,z=-1378480.700},name='Ion Moon 2',planetarySystemId=0,radius=15000,atmos=false,gravity=0.12}}}end;atlas=Atlas()for Q,R in pairs(atlas[0])do if s==nil or R.center.xt then t=R.center.x end;if u==nil or R.center.yv then v=R.center.y end end;GalaxyMapHTML=""local cJ=1.1*(t-s)/1920;local cK=1.4*(v-u)/1080;for Q,R in pairs(atlas[0])do local a8=960+R.center.x/cJ;local a9=540+R.center.y/cK;GalaxyMapHTML=GalaxyMapHTML..''if not string.match(R.name,"Moon")and not string.match(R.name,"Sanctuary")then GalaxyMapHTML=GalaxyMapHTML..""..R.name..""end end;local bm=vec3(core.getConstructWorldPos())local a8=960+bm.x/cJ;local a9=540+bm.y/cK;GalaxyMapHTML=GalaxyMapHTML..''GalaxyMapHTML=GalaxyMapHTML.."You Are Here"GalaxyMapHTML=GalaxyMapHTML..[[]]MapXRatio=cJ;MapYRatio=cK;if screen_2 then screen_2.setHTML('