Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Subnautica Variables #1848

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void GameEnabled_Checked(object sender, RoutedEventArgs e)

private void GoToQModManagerPage_Click(object sender, RoutedEventArgs e)
{
Process.Start(@"https://www.nexusmods.com/subnautica/mods/16/");
Process.Start(@"https://www.nexusmods.com/subnautica/mods/201");
}

private void GoToModDownloadPage_Click(object sender, RoutedEventArgs e)
Expand All @@ -72,13 +72,11 @@ private void InGameCh_Checked(object sender, RoutedEventArgs e)
{
if ((sender as CheckBox).IsChecked == true)
{
State.GameState.GameState = 2;
State.GameState.InGame = true;
State.GameState.State = GSI.Nodes.GameState.Playing;
}
else
{
State.GameState.GameState = 0;
State.GameState.InGame = false;
State.GameState.State = GSI.Nodes.GameState.Menu;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class GameState_Subnautica : GameState<GameState_Subnautica> {
private NotificationNode _Notification;
private WorldNode _World;
private PlayerNode _Player;
private VehicleSubNode _VehicleSub;

/// <summary>
/// Provider node provides information about the data source so that Aurora can update the correct gamestate.
Expand Down Expand Up @@ -73,6 +74,19 @@ public PlayerNode Player {
}
}

/// <summary>
/// VehicleSub node provides information about the Vehicle (e.g. Power and light status).
/// </summary>
public VehicleSubNode VehicleSub
{
get
{
if (_VehicleSub == null)
_VehicleSub = new VehicleSubNode(_ParsedData["vehicle_sub"]?.ToString() ?? "");
return _VehicleSub;
}
}

/// <summary>
/// Creates a default GameState_Subnautica instance.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@
using System.Threading.Tasks;

namespace Aurora.Profiles.Subnautica.GSI.Nodes {
public enum GameState
{
Menu = 0,
Loading = 1,
Playing = 2,
Paused = 3
}

public class GameStateNode : Node<GameStateNode> {

public int GameState;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if removing these is a good idea, because it breaks old profiles.

/*
0 = Menu
1 = Loading
2 = Playing
*/
public bool InGame;
public bool InMenu;
public bool loading;
public GameState State;

internal GameStateNode(string json) : base(json) {

GameState = GetInt("game_state");
InGame = GameState == 2;
InMenu = GameState == 0;
loading = GameState == 1;
State = (GameState)GetInt("game_state");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.Subnautica.GSI.Nodes {
public enum PDAState
{
Opened = 0,
Closed = 1,
Opening = 2,
Closing = 3
}

public enum MotorMode
{
Walk = 0,
Dive = 1,
Seaglide = 2,
Vehicle = 3,
Mech = 4,
Run = 5
}

public enum Modes
{
Normal = 0,
Piloting = 1,
LockedPiloting = 2,
Sitting = 3
}

public enum GameModes
{
Survival = 0,
Freedom = 1,
Hardcore = 2,
Creative = 3,
None = 4
}

public class PlayerNode : Node<PlayerNode> {

public string Biom;
public bool InLifePod;

//public string type; //Base, Cyclops, Seamoth or Prawn
public string Type;
public bool InBase;
public bool InCyclops;
public bool InSeamoth;
public bool InPrawn;

//public int Depth;
//public int SurfaceDepth; //always 0?
public int DepthLevel;
Expand All @@ -29,53 +57,19 @@ public class PlayerNode : Node<PlayerNode> {
public int OxygenCapacity;
public int OxygenAvailable;

public int PDAState;
/*
Opened = 0
Closed = 1
Opening = 2
Closing = 3
*/
public bool PDAopened;
public bool PDAclosed;
public bool PDAopening;
public bool PDAclosing;

public bool IsSwimming; //Seagliding does also count :)

public int MotorMode;
/*
Walk = 0
Dive = 1
Seaglide = 2
Vehicle = 3
Mech = 4
Run = 5
*/
public bool IsSeagliding;

public int Mode;
/*
Normal = 0
Piloting = 1
LockedPiloting = 2
Sitting = 3
*/
public bool IsPiloting;
public PDAState PDAState;
public MotorMode MotorMode;
public Modes Mode;
public GameModes GameMode;

internal PlayerNode(string json) : base(json) {
internal PlayerNode(string json) : base(json)
{
Biom = GetString("biom");

InLifePod = Biom == "Lifepod";

//Base, Cyclops, Seamoth or Prawn
Type = GetString("type");

InBase = Type == "Base";
InCyclops = Type == "Cyclops";
InSeamoth = Type == "Seamoth";
InPrawn = Type == "Prawn";

//SurfaceDepth = GetInt("surface_depth");
DepthLevel = GetInt("depth_level");

Expand All @@ -94,21 +88,12 @@ internal PlayerNode(string json) : base(json) {

OxygenAvailable = GetInt("oxygen_available");

PDAState = GetInt("pda_state");

PDAopened = PDAState == 0;
PDAclosed = PDAState == 1;
PDAopening = PDAState == 2;
PDAclosing = PDAState == 3;

IsSwimming = GetBool("is_in_water_for_swimming");

MotorMode = GetInt("motor_mode");

IsSeagliding = MotorMode == 2;

Mode = GetInt("mode");
IsPiloting = Mode == 1 || Mode == 2; // Mode 1 = Piloting/Mode 2 = locked Piloting
PDAState = (PDAState)GetInt("pda_state");
MotorMode = (MotorMode)GetInt("motor_mode");
Mode = (Modes)GetInt("mode");
GameMode = (GameModes)GetInt("game_mode");
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.Subnautica.GSI.Nodes {
public enum VehicleSubs
{
None = -1,
Base = 0,
Cyclops = 1,
Seamoth = 2,
Prawn = 3
}
public enum LightingStates
{ //Meaning in Game:
OnNoDanger = 0, //Operational = 0
OnDanger = 1, //Danger = 1
Off = 2 //Damaged = 2
}
public enum CyclopsMotorModes
{
Slow = 0,
Standard = 1,
Flank = 2
}
public class VehicleSubNode : Node<VehicleSubNode> {
public VehicleSubs In;

public int Power;
public int MaxPower;

public bool FloodlightEnabled;

public int VehicleHealth;
public int VehicleMaxHealth;

public int CrushDepth;

public LightingStates LightState;

public bool CyclopsWarning;
public bool CyclopsFireSuppression;
public bool CyclopsSilentRunning;

public CyclopsMotorModes CyclopsMotorMode;

public bool CyclopsEngineOn;
public float CyclopsNoice;

public float PrawnThrust;

internal VehicleSubNode(string json) : base(json) {
In = (VehicleSubs)GetInt("type");

Power = GetInt("power");
MaxPower = GetInt("max_power");

FloodlightEnabled = GetBool("floodlight");

LightState = (LightingStates)GetInt("lightstate");

VehicleHealth = GetInt("vehicle_health");
VehicleMaxHealth = GetInt("vehicle_max_health");
CrushDepth = GetInt("crush_depth");

CyclopsWarning = GetBool("cyclops_warning");
CyclopsFireSuppression = GetBool("cyclops_fire_suppression_state");
CyclopsSilentRunning = GetBool("cyclops_silent_running");

CyclopsMotorMode = (CyclopsMotorModes)GetInt("cyclops_motor_mode");

CyclopsEngineOn = GetBool("cyclops_engine_on");
CyclopsNoice = GetFloat("cyclops_noice_percent");

PrawnThrust = GetFloat("thrust");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Aurora.Profiles.Subnautica.GSI.Nodes {
public class WorldNode : Node<WorldNode> {

public float DayScalar;
public float daylight_scaler;
//public bool IsDay;

internal WorldNode(string json) : base(json) {
Expand All @@ -17,6 +18,7 @@ internal WorldNode(string json) : base(json) {
else
IsDay = false;
*/
this.daylight_scaler = GetFloat("daylight_scaler");
}
}
}
Expand Down
Loading