-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/discord
- Loading branch information
Showing
11 changed files
with
427 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Project-Aurora/Project-Aurora/Profiles/Terraria/Control_Terraria.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<UserControl x:Class="Aurora.Profiles.Terraria.Control_Terraria" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Aurora.Settings" | ||
xmlns:System="clr-namespace:System;assembly=mscorlib" | ||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="850" Height="Auto" Width="Auto"> | ||
|
||
<Grid> | ||
<TabControl> | ||
<TabItem Header="Overview for Terraria"> | ||
<StackPanel Margin="10"> | ||
<CheckBox x:Name="GameEnabled" Content="Enable Aurora to provide lighting effects with Terraria. Ensure you have read the below text." Checked="GameEnabled_Checked" Unchecked="GameEnabled_Checked" /> | ||
<TextBlock HorizontalAlignment="Left" Margin="0,10" TextWrapping="Wrap" MaxWidth="824"> | ||
<Run Text="Support for Terraria requires a mod so that Aurora is able to fetch the variables from the game. This mod requires TModLoader." /> | ||
<Run Text="These mods are not authored by the main Aurora developers and any issues with these mods should not be directed at them, but posted on the relevant Github site for the mod." /> | ||
<Run Text="You can also install the mod through the in-game Mod Browser"/> | ||
</TextBlock> | ||
<Button Content="TModLoader download" HorizontalAlignment="Left" Margin="0,0,0,0" Padding="10,2" Click="GoToTModLoaderPage_Click" Width="224" /> | ||
<Button Content="Aurora GSI Mod for Terraria download" HorizontalAlignment="Left" Margin="0,5,0,0" Padding="10,2" Click="GoToModDownloadPage_Click" /> | ||
</StackPanel> | ||
</TabItem> | ||
</TabControl> | ||
</Grid> | ||
</UserControl> |
61 changes: 61 additions & 0 deletions
61
Project-Aurora/Project-Aurora/Profiles/Terraria/Control_Terraria.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using Aurora.Profiles.Terraria.GSI; | ||
using Newtonsoft.Json.Linq; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
using Xceed.Wpf.Toolkit; | ||
|
||
namespace Aurora.Profiles.Terraria { | ||
public partial class Control_Terraria : UserControl | ||
{ | ||
private Application profile; | ||
|
||
public Control_Terraria(Application profile) | ||
{ | ||
this.profile = profile; | ||
|
||
InitializeComponent(); | ||
SetSettings(); | ||
|
||
profile.ProfileChanged += (sender, e) => SetSettings(); | ||
} | ||
|
||
private void SetSettings() | ||
{ | ||
GameEnabled.IsChecked = profile.Settings.IsEnabled; | ||
} | ||
|
||
private void GameEnabled_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
if (IsLoaded) | ||
{ | ||
profile.Settings.IsEnabled = GameEnabled.IsChecked ?? false; | ||
profile.SaveProfiles(); | ||
} | ||
} | ||
|
||
private void GoToTModLoaderPage_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Process.Start(@"https://tmodloader.net/"); | ||
} | ||
|
||
private void GoToModDownloadPage_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Process.Start(@"https://github.com/diogotr7/AuroraGSI-Terraria/releases"); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Project-Aurora/Project-Aurora/Profiles/Terraria/GSI/GameState_Terraria.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Aurora.Profiles.Terraria.GSI.Nodes; | ||
using Newtonsoft.Json.Linq; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Aurora.Profiles.Terraria.GSI { | ||
public class GameState_Terraria : GameState<GameState_Terraria> { | ||
private ProviderNode _Provider; | ||
private WorldNode _World; | ||
private PlayerNode _Player; | ||
|
||
public ProviderNode Provider => _Provider ?? (_Provider = new ProviderNode(_ParsedData["provider"]?.ToString() ?? "")); | ||
|
||
public WorldNode World => _World ?? (_World = new WorldNode(_ParsedData["world"]?.ToString() ?? "")); | ||
|
||
public PlayerNode Player => _Player ?? (_Player = new PlayerNode(_ParsedData["player"]?.ToString() ?? "")); | ||
|
||
public GameState_Terraria() : base() { } | ||
|
||
/// <summary> | ||
/// Creates a GameState_Terraria instance based on the passed JSON data. | ||
/// </summary> | ||
/// <param name="JSONstring"></param> | ||
public GameState_Terraria(string JSONstring) : base(JSONstring) { } | ||
|
||
/// <summary> | ||
/// Creates a GameState_Terraria instance based on the data from the passed GameState instance. | ||
/// </summary> | ||
public GameState_Terraria(IGameState other) : base(other) { } | ||
} | ||
} |
100 changes: 100 additions & 0 deletions
100
Project-Aurora/Project-Aurora/Profiles/Terraria/GSI/Nodes/PlayerNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Aurora.Profiles.Terraria.GSI.Nodes { | ||
public enum TerrariaBiome | ||
{ | ||
None = -1, | ||
Forest = 0, | ||
Beach = 1, | ||
Jungle = 2, | ||
Snow = 3, | ||
Desert = 4 | ||
} | ||
|
||
public enum TerrariaDepth | ||
{ | ||
None = -1, | ||
Underworld = 0, | ||
Cavern = 1, | ||
Underground = 2, | ||
Overworld = 3, | ||
Sky = 4 | ||
} | ||
|
||
public class PlayerNode : Node<PlayerNode> { | ||
public bool InGame; | ||
|
||
#region Stats | ||
public int Health; | ||
public int MaxHealth; | ||
public int Mana; | ||
public int MaxMana; | ||
public int Defense; | ||
#endregion | ||
|
||
#region Location | ||
public int Depth; | ||
public TerrariaDepth DepthLayer; | ||
public int MaxDepth; | ||
public TerrariaBiome Biome; | ||
#endregion | ||
|
||
#region Microbiomes | ||
public bool InGlowshroom; | ||
public bool InUndergroundDesert; | ||
public bool InSandstorm; | ||
public bool InMeteor; | ||
public bool InDungeon; | ||
#endregion | ||
|
||
#region Local Events | ||
public bool InTowerSolar; | ||
public bool InTowerVortex; | ||
public bool InTowerNebula; | ||
public bool InTowerStardust; | ||
public bool InOldOneArmy; | ||
#endregion | ||
|
||
#region Local Corruption Status | ||
public bool InCorruption; | ||
public bool InCrimson; | ||
public bool InHalllow; | ||
#endregion | ||
|
||
internal PlayerNode(string json) : base(json) | ||
{ | ||
InGame = GetBool("inGame"); | ||
|
||
Health = GetInt("health"); | ||
MaxHealth = GetInt("maxHealth"); | ||
Mana = GetInt("mana"); | ||
MaxMana = GetInt("maxMana"); | ||
Defense = GetInt("defense"); | ||
|
||
Depth = GetInt("depth"); | ||
DepthLayer = (TerrariaDepth)GetInt("depthLayer"); | ||
MaxDepth = GetInt("maxdepth"); | ||
Biome = (TerrariaBiome)GetInt("biome"); | ||
|
||
InGlowshroom = GetBool("zoneGlowshroom"); | ||
InUndergroundDesert = GetBool("zoneUndergroundDesert"); | ||
InSandstorm = GetBool("zoneSandstorm"); | ||
InMeteor = GetBool("zoneMeteor"); | ||
InDungeon = GetBool("zoneDungeon"); | ||
|
||
InTowerSolar = GetBool("zoneTowerSolar"); | ||
InTowerVortex = GetBool("zoneTowerVortex"); | ||
InTowerNebula = GetBool("zoneTowerNebula"); | ||
InTowerStardust = GetBool("zoneTowerStardust"); | ||
InOldOneArmy = GetBool("zoneOldOneArmy"); | ||
|
||
InCorruption = GetBool("zoneCorrupt"); | ||
InCrimson = GetBool("zoneCrimson"); | ||
InHalllow = GetBool("zoneHoly"); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Project-Aurora/Project-Aurora/Profiles/Terraria/GSI/Nodes/ProviderNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Aurora.Profiles.Terraria.GSI.Nodes { | ||
public class ProviderNode : Node<ProviderNode> { | ||
public string Name; | ||
public int AppID; | ||
|
||
internal ProviderNode(string json) : base(json) { | ||
Name = GetString("name"); | ||
AppID = GetInt("appid"); | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
Project-Aurora/Project-Aurora/Profiles/Terraria/GSI/Nodes/WorldNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Aurora.Profiles.Terraria.GSI.Nodes { | ||
public enum TerrariaBoss | ||
{ | ||
None = -1, | ||
KingSlime = 0, | ||
EyeOfCthulu = 1, | ||
EaterOfWorlds = 2, | ||
BrainOfCthulu = 3, | ||
QueenBee = 4, | ||
Skeletron = 5, | ||
WallOfFlesh = 6, | ||
Twins = 7, | ||
Destroyer = 8, | ||
SkeletronPrime = 9, | ||
Plantera = 10, | ||
Golem = 11, | ||
DukeFishron = 12, | ||
LunaticCultist = 13, | ||
MoonLord = 14 | ||
} | ||
|
||
public class WorldNode : Node<WorldNode> { | ||
public double Time; | ||
public bool Raining; | ||
public bool HardMode; | ||
public bool ExpertMode; | ||
public bool Eclipse; | ||
public bool BloodMoon; | ||
public bool PumpkinMoon; | ||
public bool SnowMoon; | ||
public bool SlimeRain; | ||
public TerrariaBoss Boss; | ||
|
||
internal WorldNode(string json) : base(json) { | ||
Eclipse = GetBool("eclipse"); | ||
HardMode = GetBool("hardMode"); | ||
ExpertMode = GetBool("expertMode"); | ||
Time = GetFloat("time"); | ||
BloodMoon = GetBool("bloodMoon"); | ||
PumpkinMoon = GetBool("pumpkinMoon"); | ||
SnowMoon = GetBool("snowMoon"); | ||
Raining = GetBool("raining"); | ||
SlimeRain = GetBool("slimeRain"); | ||
Boss = (TerrariaBoss)GetInt("boss"); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Project-Aurora/Project-Aurora/Profiles/Terraria/TerrariaApplication.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Aurora.Profiles.Terraria { | ||
public class Terraria : Application { | ||
public Terraria() : base(new LightEventConfig | ||
{ | ||
Name = "Terraria", | ||
ID = "terraria", | ||
AppID = "105600", | ||
ProcessNames = new[] { "Terraria.exe" }, | ||
ProfileType = typeof(TerrariaProfile), | ||
OverviewControlType = typeof(Control_Terraria), | ||
GameStateType = typeof(GSI.GameState_Terraria), | ||
Event = new GameEvent_Generic(), | ||
IconURI = "Resources/terraria_512x512.png" | ||
}) | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.