From 3f462a6e827b43a4274e497f373241cce7124b08 Mon Sep 17 00:00:00 2001 From: gitmacer Date: Mon, 23 Dec 2019 03:59:41 +0100 Subject: [PATCH 1/8] Subnautica var update --- .../Subnautica/GSI/GameState_Subnautica.cs | 14 ++++ .../Subnautica/GSI/Nodes/PlayerNode.cs | 31 ++++++++- .../Subnautica/GSI/Nodes/VehicleSubNode.cs | 66 +++++++++++++++++++ .../Subnautica/GSI/Nodes/WorldNode.cs | 2 + .../Project-Aurora/Project-Aurora.csproj | 3 +- 5 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/GameState_Subnautica.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/GameState_Subnautica.cs index d81eaf5ed..7848a38c9 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/GameState_Subnautica.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/GameState_Subnautica.cs @@ -15,6 +15,7 @@ public class GameState_Subnautica : GameState { private NotificationNode _Notification; private WorldNode _World; private PlayerNode _Player; + private VehicleSubNode _VehicleSub; /// /// Provider node provides information about the data source so that Aurora can update the correct gamestate. @@ -73,6 +74,19 @@ public PlayerNode Player { } } + /// + /// VehicleSub node provides information about the Vehicle (e.g. Power and light status). + /// + public VehicleSubNode VehicleSub + { + get + { + if (_VehicleSub == null) + _VehicleSub = new VehicleSubNode(_ParsedData["vehicle_sub"]?.ToString() ?? ""); + return _VehicleSub; + } + } + /// /// Creates a default GameState_Subnautica instance. /// diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/PlayerNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/PlayerNode.cs index 9fdb69a2a..2da2fc5c0 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/PlayerNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/PlayerNode.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -63,7 +63,21 @@ public class PlayerNode : Node { */ public bool IsPiloting; - internal PlayerNode(string json) : base(json) { + public int GameMode; + /* + Survival = 0, + Freedom = 1, + Hardcore = 2, + Creative = 3, + None = 4 + */ + public bool InSurvivalMode; + public bool InFreedomMode; + public bool InHardcoreMode; + public bool InCreativeMode; + + internal PlayerNode(string json) : base(json) + { Biom = GetString("biom"); InLifePod = Biom == "Lifepod"; @@ -109,6 +123,19 @@ internal PlayerNode(string json) : base(json) { Mode = GetInt("mode"); IsPiloting = Mode == 1 || Mode == 2; // Mode 1 = Piloting/Mode 2 = locked Piloting + + GameMode = GetInt("game_mode"); + InSurvivalMode = GameMode == 0; + InFreedomMode = GameMode == 1; + InHardcoreMode = GameMode == 2; + InCreativeMode = GameMode == 3; + /* + Survival = 0, + Freedom = 1, + Hardcore = 2, + Creative = 3, + None = 4 + */ } } diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs new file mode 100644 index 000000000..7d0a9ae78 --- /dev/null +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Aurora.Profiles.Subnautica.GSI.Nodes { + public class VehicleSubNode : Node { + + public int Power; + public int MaxPower; + + public bool FloodlightEnabled; + + public int VehicleHealth; + public int VehicleMaxHealth; + + public int CrushDepth; + + public int LightState; + public bool LightOn; + public bool LightDanger; + public bool LightOff; + // On = 0, On with Danger = 1, Off = 2 + + public bool CyclopsWarning; + public bool CyclopsFireSuppression; + public bool CyclopsSilentRunning; + + public int CyclopsMotorMode; + public bool CyclopsSlowMode; + public bool CyclopsStandardMode; + public bool CyclopsFlankMode; + + public bool CyclopsEngineOn; + public float CyclopsNoice; + + internal VehicleSubNode(string json) : base(json) { + + Power = GetInt("power"); + MaxPower = GetInt("max_power"); + + FloodlightEnabled = GetBool("floodlight"); + // On = 0, On with Danger = 1, Off = 2 + LightState = GetInt("lightstate"); + LightOn = LightState == 0 || LightState == 1; + LightDanger = LightState == 1; + LightOff = LightState == 2; + + VehicleHealth = GetInt("vehicle_health"); + VehicleMaxHealth = GetInt("vehicle_max_health"); + CrushDepth = GetInt("crushDepth"); + + CyclopsWarning = GetBool("cyclops_warning"); + CyclopsFireSuppression = GetBool("cyclops_fire_suppression_state"); + CyclopsSilentRunning = GetBool("cyclops_silent_running"); + CyclopsMotorMode = GetInt("cyclops_motor_mode"); + CyclopsSlowMode = CyclopsMotorMode == 0; + CyclopsStandardMode = CyclopsMotorMode == 1; + CyclopsFlankMode = CyclopsMotorMode == 2; + CyclopsEngineOn = GetBool("cyclops_engine_on"); + CyclopsNoice = GetFloat("cyclops_noice_percent"); + + } + } +} diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/WorldNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/WorldNode.cs index c4362dec2..8a0c0785c 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/WorldNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/WorldNode.cs @@ -8,6 +8,7 @@ namespace Aurora.Profiles.Subnautica.GSI.Nodes { public class WorldNode : Node { public float DayScalar; + public float daylight_scaler; //public bool IsDay; internal WorldNode(string json) : base(json) { @@ -17,6 +18,7 @@ internal WorldNode(string json) : base(json) { else IsDay = false; */ + this.daylight_scaler = GetFloat("daylight_scaler"); } } } diff --git a/Project-Aurora/Project-Aurora/Project-Aurora.csproj b/Project-Aurora/Project-Aurora/Project-Aurora.csproj index 9d5bee45e..7cc5141f6 100644 --- a/Project-Aurora/Project-Aurora/Project-Aurora.csproj +++ b/Project-Aurora/Project-Aurora/Project-Aurora.csproj @@ -1,4 +1,4 @@ - + @@ -397,6 +397,7 @@ + From f38cd910e5318d1e91b47a9edc08fc8e3c93d6cf Mon Sep 17 00:00:00 2001 From: gitmacer Date: Mon, 23 Dec 2019 04:12:04 +0100 Subject: [PATCH 2/8] forgot the paused gamestate --- .../Profiles/Subnautica/GSI/Nodes/GameStateNode.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/GameStateNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/GameStateNode.cs index 0cf2eab17..698f9331d 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/GameStateNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/GameStateNode.cs @@ -12,17 +12,21 @@ public class GameStateNode : Node { 0 = Menu 1 = Loading 2 = Playing + 3 = Paused */ - public bool InGame; + public bool InMenu; public bool loading; + public bool InGame; + public bool Paused; internal GameStateNode(string json) : base(json) { GameState = GetInt("game_state"); - InGame = GameState == 2; InMenu = GameState == 0; loading = GameState == 1; + InGame = GameState == 2 || GameState == 3; + Paused = GameState == 3; } } } From ac816b0da6a827d7252fd858a1576b4685f17f88 Mon Sep 17 00:00:00 2001 From: gitmacer Date: Tue, 24 Dec 2019 01:53:14 +0100 Subject: [PATCH 3/8] Use Enum --- .../Subnautica/Control_Subnautica.xaml.cs | 6 +- .../Subnautica/GSI/Nodes/GameStateNode.cs | 28 ++-- .../Subnautica/GSI/Nodes/PlayerNode.cs | 128 ++++++------------ .../Subnautica/GSI/Nodes/VehicleSubNode.cs | 50 ++++--- 4 files changed, 87 insertions(+), 125 deletions(-) diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/Control_Subnautica.xaml.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/Control_Subnautica.xaml.cs index 4caa0df11..74d87ae6f 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/Control_Subnautica.xaml.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/Control_Subnautica.xaml.cs @@ -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; } } diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/GameStateNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/GameStateNode.cs index 698f9331d..09eeb27b1 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/GameStateNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/GameStateNode.cs @@ -5,28 +5,20 @@ using System.Threading.Tasks; namespace Aurora.Profiles.Subnautica.GSI.Nodes { - public class GameStateNode : Node { + public enum GameState + { + Menu = 0, + Loading = 1, + Playing = 2, + Paused = 3 + } - public int GameState; - /* - 0 = Menu - 1 = Loading - 2 = Playing - 3 = Paused - */ + public class GameStateNode : Node { - public bool InMenu; - public bool loading; - public bool InGame; - public bool Paused; + public GameState State; internal GameStateNode(string json) : base(json) { - - GameState = GetInt("game_state"); - InMenu = GameState == 0; - loading = GameState == 1; - InGame = GameState == 2 || GameState == 3; - Paused = GameState == 3; + State = (GameState)GetInt("game_state"); } } } diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/PlayerNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/PlayerNode.cs index 2da2fc5c0..6018b16a7 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/PlayerNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/PlayerNode.cs @@ -5,18 +5,46 @@ 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 { 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; @@ -29,52 +57,12 @@ public class PlayerNode : Node { 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 int GameMode; - /* - Survival = 0, - Freedom = 1, - Hardcore = 2, - Creative = 3, - None = 4 - */ - public bool InSurvivalMode; - public bool InFreedomMode; - public bool InHardcoreMode; - public bool InCreativeMode; + public PDAState PDAState; + public MotorMode MotorMode; + public Modes Mode; + public GameModes GameMode; internal PlayerNode(string json) : base(json) { @@ -82,14 +70,6 @@ internal PlayerNode(string json) : base(json) 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"); @@ -108,34 +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 - - GameMode = GetInt("game_mode"); - InSurvivalMode = GameMode == 0; - InFreedomMode = GameMode == 1; - InHardcoreMode = GameMode == 2; - InCreativeMode = GameMode == 3; - /* - Survival = 0, - Freedom = 1, - Hardcore = 2, - Creative = 3, - None = 4 - */ + PDAState = (PDAState)GetInt("pda_state"); + MotorMode = (MotorMode)GetInt("motor_mode"); + Mode = (Modes)GetInt("mode"); + GameMode = (GameModes)GetInt("game_mode"); } } diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs index 7d0a9ae78..f886782db 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs @@ -5,7 +5,25 @@ using System.Threading.Tasks; namespace Aurora.Profiles.Subnautica.GSI.Nodes { + 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 { + //Base, Cyclops, Seamoth or Prawn //Change to Enum + public string Type; + public bool InBase; + public bool InCyclops; + public bool InSeamoth; + public bool InPrawn; public int Power; public int MaxPower; @@ -17,35 +35,32 @@ public class VehicleSubNode : Node { public int CrushDepth; - public int LightState; - public bool LightOn; - public bool LightDanger; - public bool LightOff; - // On = 0, On with Danger = 1, Off = 2 + public LightingStates LightState; public bool CyclopsWarning; public bool CyclopsFireSuppression; public bool CyclopsSilentRunning; - public int CyclopsMotorMode; - public bool CyclopsSlowMode; - public bool CyclopsStandardMode; - public bool CyclopsFlankMode; + public CyclopsMotorModes CyclopsMotorMode; public bool CyclopsEngineOn; public float CyclopsNoice; internal VehicleSubNode(string json) : base(json) { + //Base, Cyclops, Seamoth or Prawn + Type = GetString("type"); + + InBase = Type == "Base"; + InCyclops = Type == "Cyclops"; + InSeamoth = Type == "Seamoth"; + InPrawn = Type == "Prawn"; Power = GetInt("power"); MaxPower = GetInt("max_power"); FloodlightEnabled = GetBool("floodlight"); - // On = 0, On with Danger = 1, Off = 2 - LightState = GetInt("lightstate"); - LightOn = LightState == 0 || LightState == 1; - LightDanger = LightState == 1; - LightOff = LightState == 2; + + LightState = (LightingStates)GetInt("lightstate"); VehicleHealth = GetInt("vehicle_health"); VehicleMaxHealth = GetInt("vehicle_max_health"); @@ -54,10 +69,9 @@ internal VehicleSubNode(string json) : base(json) { CyclopsWarning = GetBool("cyclops_warning"); CyclopsFireSuppression = GetBool("cyclops_fire_suppression_state"); CyclopsSilentRunning = GetBool("cyclops_silent_running"); - CyclopsMotorMode = GetInt("cyclops_motor_mode"); - CyclopsSlowMode = CyclopsMotorMode == 0; - CyclopsStandardMode = CyclopsMotorMode == 1; - CyclopsFlankMode = CyclopsMotorMode == 2; + + CyclopsMotorMode = (CyclopsMotorModes)GetInt("cyclops_motor_mode"); + CyclopsEngineOn = GetBool("cyclops_engine_on"); CyclopsNoice = GetFloat("cyclops_noice_percent"); From fc3542416bafd5e605feb8801dfa7c5acda1e34e Mon Sep 17 00:00:00 2001 From: gitmacer Date: Tue, 24 Dec 2019 02:27:33 +0100 Subject: [PATCH 4/8] Use Enum for the Sub/Vehicle Type --- .../Subnautica/GSI/Nodes/VehicleSubNode.cs | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs index f886782db..aeb26a7e1 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs @@ -5,6 +5,14 @@ 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 @@ -18,12 +26,7 @@ public enum CyclopsMotorModes Flank = 2 } public class VehicleSubNode : Node { - //Base, Cyclops, Seamoth or Prawn //Change to Enum - public string Type; - public bool InBase; - public bool InCyclops; - public bool InSeamoth; - public bool InPrawn; + public VehicleSubs In; public int Power; public int MaxPower; @@ -47,13 +50,7 @@ public class VehicleSubNode : Node { public float CyclopsNoice; internal VehicleSubNode(string json) : base(json) { - //Base, Cyclops, Seamoth or Prawn - Type = GetString("type"); - - InBase = Type == "Base"; - InCyclops = Type == "Cyclops"; - InSeamoth = Type == "Seamoth"; - InPrawn = Type == "Prawn"; + In = (VehicleSubs)GetInt("type"); Power = GetInt("power"); MaxPower = GetInt("max_power"); From 193a012cecfc34980728284b27ccd1f537adcd52 Mon Sep 17 00:00:00 2001 From: gitmacer Date: Wed, 25 Dec 2019 23:11:53 +0100 Subject: [PATCH 5/8] Update QModManager Link --- .../Profiles/Subnautica/Control_Subnautica.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/Control_Subnautica.xaml.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/Control_Subnautica.xaml.cs index 74d87ae6f..f635d36f4 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/Control_Subnautica.xaml.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/Control_Subnautica.xaml.cs @@ -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) From 99e92f0d1800a13f3e91adb6e7789d266cc78851 Mon Sep 17 00:00:00 2001 From: gitmacer Date: Thu, 26 Dec 2019 00:39:35 +0100 Subject: [PATCH 6/8] Update Default profile to use Enums --- .../Profiles/Subnautica/SubnauticaProfile.cs | 97 ++++++++++++------- 1 file changed, 63 insertions(+), 34 deletions(-) diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs index 001832f69..45bd40a70 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs @@ -3,6 +3,9 @@ //using Aurora.Profiles.Subnautica.Layers; using Aurora.Settings; using Aurora.Settings.Layers; +using Aurora.Settings.Overrides; +using Aurora.Settings.Overrides.Logic; +using Aurora.Settings.Overrides.Logic.Builder; using System; using System.Collections.Generic; using System.Drawing; @@ -11,61 +14,78 @@ using System.Threading.Tasks; using DK = Aurora.Devices.DeviceKeys; -namespace Aurora.Profiles.Subnautica { +namespace Aurora.Profiles.Subnautica +{ - public class SubnauticaProfile : ApplicationProfile { + public class SubnauticaProfile : ApplicationProfile + { public SubnauticaProfile() : base() { } - - public override void Reset() { + + public override void Reset() + { base.Reset(); Layers = new System.Collections.ObjectModel.ObservableCollection() { - new Layer("PDA Open", new ConditionalLayerHandler{ - Properties = new ConditionalLayerProperties + new Layer("PDA Open", new SolidFillLayerHandler + { + Properties = new SolidFillLayerHandlerProperties { - _ConditionPath = "Player/PDAopened", - _PrimaryColor = Color.FromArgb(170,0,0,0), - _SecondaryColor = Color.FromArgb(0,0,0,0), - _Sequence = new KeySequence(new FreeFormObject(0, -50, 980, 280)) + _PrimaryColor = Color.FromArgb(170,0,0,0) } - } + }, + new OverrideLogicBuilder() + .SetLookupTable("_Enabled", new OverrideLookupTableBuilder() + .AddEntry(false, new BooleanNot(new BooleanGSIEnum("Player/PDAState", GSI.Nodes.PDAState.Opened))) + ) ), - new Layer("PDA Close Animation", new AnimationLayerHandler { - Properties = new AnimationLayerHandlerProperties { + + new Layer("PDA Close Animation", new AnimationLayerHandler + { + Properties = new AnimationLayerHandlerProperties + { _AnimationDuration = .5f, _AnimationRepeat = 1, - _AnimationMix = new EffectsEngine.Animations.AnimationMix(new []{ + _AnimationMix = new EffectsEngine.Animations.AnimationMix(new[]{ new EffectsEngine.Animations.AnimationTrack("Rectangle", 1) .SetFrame(0, new EffectsEngine.Animations.AnimationFilledRectangle(new Rectangle(0, 0, 1000, 60), Color.FromArgb(170, 0, 0, 0))) .SetFrame(.5f, new EffectsEngine.Animations.AnimationFilledRectangle(new Rectangle(0, 70, 1000, 60), Color.FromArgb(170, 0, 0, 0))) - }), - _TriggerMode = AnimationTriggerMode.OnTrue, - _TriggerPath = "Player/PDAclosing", + }), + _TriggerMode = AnimationTriggerMode.OnEvaluatableTrue, + _EvaluatableTrigger = new BooleanGSIEnum("Player/PDAState", GSI.Nodes.PDAState.Closing), _StackMode = AnimationStackMode.Ignore, _Sequence = new KeySequence(new FreeFormObject(0, -50, 980, 280)) } }), - new Layer("PDA Open Animation", new AnimationLayerHandler { - Properties = new AnimationLayerHandlerProperties { + new Layer("PDA Open Animation", new AnimationLayerHandler + { + Properties = new AnimationLayerHandlerProperties + { _AnimationDuration = .5f, _AnimationRepeat = 1, - _AnimationMix = new EffectsEngine.Animations.AnimationMix(new []{ + _AnimationMix = new EffectsEngine.Animations.AnimationMix(new[]{ new EffectsEngine.Animations.AnimationTrack("Rectangle", 1) .SetFrame(0, new EffectsEngine.Animations.AnimationFilledRectangle(new Rectangle(0, 70, 1000, 60), Color.FromArgb(170, 0, 0, 0))) .SetFrame(.5f, new EffectsEngine.Animations.AnimationFilledRectangle(new Rectangle(0, 0, 1000, 60), Color.FromArgb(170, 0, 0, 0))) }), _TriggerMode = AnimationTriggerMode.OnTrue, - _TriggerPath = "Player/PDAopening", + _EvaluatableTrigger = new BooleanGSIEnum("Player/PDAState", GSI.Nodes.PDAState.Opening), _StackMode = AnimationStackMode.Ignore, _Sequence = new KeySequence(new FreeFormObject(0, -50, 980, 280)) } - }), + }, + new OverrideLogicBuilder() + .SetLookupTable("_Enabled", new OverrideLookupTableBuilder() + .AddEntry(false, new BooleanGSIEnum("Player/PDAState", GSI.Nodes.PDAState.Opened)) + ) + ), - new Layer("Health", new PercentLayerHandler() { - Properties = new PercentLayerHandlerProperties() { + new Layer("Health", new PercentLayerHandler() + { + Properties = new PercentLayerHandlerProperties() + { _VariablePath = "Player/Health", _MaxVariablePath = "100", _PrimaryColor = Color.FromArgb(255, 0, 0), @@ -77,8 +97,10 @@ public override void Reset() { } }), - new Layer("Food", new PercentLayerHandler() { - Properties = new PercentLayerHandlerProperties() { + new Layer("Food", new PercentLayerHandler() + { + Properties = new PercentLayerHandlerProperties() + { _VariablePath = "Player/Food", _MaxVariablePath = "100", _PrimaryColor = Color.FromArgb(139, 69, 19), @@ -90,8 +112,10 @@ public override void Reset() { } }), - new Layer("Water", new PercentLayerHandler() { - Properties = new PercentLayerHandlerProperties() { + new Layer("Water", new PercentLayerHandler() + { + Properties = new PercentLayerHandlerProperties() + { _VariablePath = "Player/Water", _MaxVariablePath = "100", _PrimaryColor = Color.FromArgb(0, 0, 255), @@ -103,8 +127,10 @@ public override void Reset() { } }), - new Layer("Oxygen", new PercentLayerHandler() { - Properties = new PercentLayerHandlerProperties() { + new Layer("Oxygen", new PercentLayerHandler() + { + Properties = new PercentLayerHandlerProperties() + { _VariablePath = "Player/OxygenAvailable", _MaxVariablePath = "Player/OxygenCapacity", _PrimaryColor = Color.FromArgb(0, 170, 65), @@ -116,9 +142,12 @@ public override void Reset() { } }), - new Layer("Background", new PercentGradientLayerHandler() { - Properties = new PercentGradientLayerHandlerProperties { - _Gradient = new EffectBrush() { + new Layer("Background", new PercentGradientLayerHandler() + { + Properties = new PercentGradientLayerHandlerProperties + { + _Gradient = new EffectBrush() + { type = EffectBrush.BrushType.Linear, start = new PointF(0, 0), end = new PointF(1, 0), @@ -138,6 +167,6 @@ public override void Reset() { }; } - + } } From 29ad5e34d91d0672c004dd8008caf8dcdcd1fc3f Mon Sep 17 00:00:00 2001 From: gitmacer Date: Thu, 26 Dec 2019 15:04:43 +0100 Subject: [PATCH 7/8] Addd support for Prawn Thrust --- .../Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs index aeb26a7e1..76bc7d3bf 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/GSI/Nodes/VehicleSubNode.cs @@ -49,6 +49,8 @@ public class VehicleSubNode : Node { public bool CyclopsEngineOn; public float CyclopsNoice; + public float PrawnThrust; + internal VehicleSubNode(string json) : base(json) { In = (VehicleSubs)GetInt("type"); @@ -61,7 +63,7 @@ internal VehicleSubNode(string json) : base(json) { VehicleHealth = GetInt("vehicle_health"); VehicleMaxHealth = GetInt("vehicle_max_health"); - CrushDepth = GetInt("crushDepth"); + CrushDepth = GetInt("crush_depth"); CyclopsWarning = GetBool("cyclops_warning"); CyclopsFireSuppression = GetBool("cyclops_fire_suppression_state"); @@ -72,6 +74,7 @@ internal VehicleSubNode(string json) : base(json) { CyclopsEngineOn = GetBool("cyclops_engine_on"); CyclopsNoice = GetFloat("cyclops_noice_percent"); + PrawnThrust = GetFloat("thrust"); } } } From a59760837a41b4dd741fe06904c702bbe9bd0b1e Mon Sep 17 00:00:00 2001 From: gitmacer Date: Thu, 26 Dec 2019 18:49:47 +0100 Subject: [PATCH 8/8] corrected default profile (TriggerMode) --- .../Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project-Aurora/Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs b/Project-Aurora/Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs index 45bd40a70..1d27d6481 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Subnautica/SubnauticaProfile.cs @@ -70,7 +70,7 @@ public override void Reset() .SetFrame(0, new EffectsEngine.Animations.AnimationFilledRectangle(new Rectangle(0, 70, 1000, 60), Color.FromArgb(170, 0, 0, 0))) .SetFrame(.5f, new EffectsEngine.Animations.AnimationFilledRectangle(new Rectangle(0, 0, 1000, 60), Color.FromArgb(170, 0, 0, 0))) }), - _TriggerMode = AnimationTriggerMode.OnTrue, + _TriggerMode = AnimationTriggerMode.OnEvaluatableTrue, _EvaluatableTrigger = new BooleanGSIEnum("Player/PDAState", GSI.Nodes.PDAState.Opening), _StackMode = AnimationStackMode.Ignore, _Sequence = new KeySequence(new FreeFormObject(0, -50, 980, 280))