diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj
index 00dba2b00..492b5f6c4 100644
--- a/Artemis/Artemis/Artemis.csproj
+++ b/Artemis/Artemis/Artemis.csproj
@@ -384,6 +384,13 @@
AssettoCorsaView.xaml
+
+
+
+
+ TerrariaView.xaml
+
+
@@ -856,6 +863,10 @@
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/Artemis/Artemis/DeviceProviders/Corsair/CorsairKeyboard.cs b/Artemis/Artemis/DeviceProviders/Corsair/CorsairKeyboard.cs
index ef5adc1ab..4468016b9 100644
--- a/Artemis/Artemis/DeviceProviders/Corsair/CorsairKeyboard.cs
+++ b/Artemis/Artemis/DeviceProviders/Corsair/CorsairKeyboard.cs
@@ -88,11 +88,6 @@ namespace Artemis.DeviceProviders.Corsair
break;
}
- Height = 8;
- Width = 22;
- Slug = "corsair-strafe-rgb";
- PreviewSettings = new PreviewSettings(new Rect(23, 12, 937, 324), Resources.strafe);
-
Logger.Debug("Corsair SDK reported device as: {0}", _keyboard.DeviceInfo.Model);
_keyboard.Brush = _keyboardBrush ?? (_keyboardBrush = new ImageBrush());
}
diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
index e46759d75..a1f168377 100644
--- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
+++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
@@ -36,7 +36,7 @@ namespace Artemis.Modules.Games.RocketLeague
{
if (!SettingsProvider.Load().EnablePointersUpdate)
{
- VersionText = "You disabled pointer updates, this could result in the Rocket League effect not working after a game update.";
+ VersionText = "You disabled pointer updates, this could result in the Rocket League module not working after a game update.";
return;
}
diff --git a/Artemis/Artemis/Modules/Games/Terraria/TerrariaDataModel.cs b/Artemis/Artemis/Modules/Games/Terraria/TerrariaDataModel.cs
new file mode 100644
index 000000000..ce01c1f18
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/Terraria/TerrariaDataModel.cs
@@ -0,0 +1,18 @@
+using Artemis.Modules.Abstract;
+using MoonSharp.Interpreter;
+
+namespace Artemis.Modules.Games.Terraria
+{
+ [MoonSharpUserData]
+ public class TerrariaDataModel : ModuleDataModel
+ {
+ public int Hp { get; set; }
+ public int MaxHp { get; set; }
+ public int Mana { get; set; }
+ public int MaxMana { get; set; }
+ public int Breath { get; set; }
+ public int MaxBreath { get; set; }
+ public bool InWater { get; set; }
+ public bool InLava { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Terraria/TerrariaModel.cs b/Artemis/Artemis/Modules/Games/Terraria/TerrariaModel.cs
new file mode 100644
index 000000000..c7f3c0c8c
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/Terraria/TerrariaModel.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Linq;
+using Artemis.DAL;
+using Artemis.Managers;
+using Artemis.Modules.Abstract;
+using Artemis.Settings;
+using Artemis.Utilities;
+using Artemis.Utilities.Memory;
+
+namespace Artemis.Modules.Games.Terraria
+{
+ public class TerrariaModel : ModuleModel
+ {
+ private Memory _memory;
+ private GamePointersCollection _pointer;
+
+ public TerrariaModel(DeviceManager deviceManager, LuaManager luaManager) : base(deviceManager, luaManager)
+ {
+ Settings = SettingsProvider.Load();
+ DataModel = new TerrariaDataModel();
+ ProcessNames.Add("Terraria");
+
+ // Generate a new offset when the game is updated
+ //_pointer = new GamePointersCollection
+ //{
+ // Game = "Terraria",
+ // GameVersion = "1.3.4.4",
+ // GameAddresses = new List
+ // {
+ // new GamePointer
+ // {
+ // Description = "PlayerBase",
+ // BasePointer = new IntPtr(0x0039C078),
+ // Offsets = new[] {0x280, 0x6C0, 0x674, 0x3C}
+ // }
+ // }
+ //};
+ //var res = JsonConvert.SerializeObject(_pointer, Formatting.Indented);
+ }
+
+ public override string Name => "Terraria";
+ public override bool IsOverlay => false;
+ public override bool IsBoundToProcess => true;
+
+ public override void Dispose()
+ {
+ base.Dispose();
+
+ _memory?.Dispose();
+ _memory = null;
+ }
+
+ public override void Enable()
+ {
+ Updater.GetPointers();
+ _pointer = SettingsProvider.Load().Terraria;
+
+ base.Enable();
+ }
+
+ public override void Update()
+ {
+ if (_memory == null)
+ {
+ var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessNames[0]);
+ if (tempProcess == null)
+ return;
+
+ _memory = new Memory(tempProcess);
+ }
+
+ if (ProfileModel == null || DataModel == null || _memory == null)
+ return;
+
+ var offsets = _pointer.GameAddresses.First(ga => ga.Description == "PlayerBase").ToString();
+ var baseAddress = _memory.GetAddress("\"Terraria.exe\"" + offsets);
+ var basePointer = new IntPtr(_memory.ReadInt32(baseAddress));
+ var playerPointer = new IntPtr(_memory.ReadInt32(basePointer + 0x18));
+
+ var dataModel = (TerrariaDataModel) DataModel;
+ dataModel.Hp = _memory.ReadInt32(playerPointer + 0x340);
+ dataModel.MaxHp = _memory.ReadInt32(playerPointer + 0x338);
+ dataModel.Mana = _memory.ReadInt32(playerPointer + 0x344);
+ dataModel.MaxMana = _memory.ReadInt32(playerPointer + 0x348);
+ dataModel.Breath = _memory.ReadInt32(playerPointer + 0x2B4);
+ dataModel.MaxBreath = _memory.ReadInt32(playerPointer + 0x2B0);
+ dataModel.InWater = Convert.ToBoolean(_memory.ReadInt32(playerPointer + 0x1D));
+ dataModel.InLava = Convert.ToBoolean(_memory.ReadInt32(playerPointer + 0x20));
+ }
+ }
+}
diff --git a/Artemis/Artemis/Modules/Games/Terraria/TerrariaSettings.cs b/Artemis/Artemis/Modules/Games/Terraria/TerrariaSettings.cs
new file mode 100644
index 000000000..c155ff365
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/Terraria/TerrariaSettings.cs
@@ -0,0 +1,8 @@
+using Artemis.Modules.Abstract;
+
+namespace Artemis.Modules.Games.Terraria
+{
+ public class TerrariaSettings : ModuleSettings
+ {
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Terraria/TerrariaView.xaml b/Artemis/Artemis/Modules/Games/Terraria/TerrariaView.xaml
new file mode 100644
index 000000000..f5cf0d7e4
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/Terraria/TerrariaView.xaml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Terraria/TerrariaView.xaml.cs b/Artemis/Artemis/Modules/Games/Terraria/TerrariaView.xaml.cs
new file mode 100644
index 000000000..74e35cfb8
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/Terraria/TerrariaView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+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;
+
+namespace Artemis.Modules.Games.Terraria
+{
+ ///
+ /// Interaction logic for TerrariaView.xaml
+ ///
+ public partial class TerrariaView : UserControl
+ {
+ public TerrariaView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Artemis/Artemis/Modules/Games/Terraria/TerrariaViewModel.cs b/Artemis/Artemis/Modules/Games/Terraria/TerrariaViewModel.cs
new file mode 100644
index 000000000..709d7e748
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/Terraria/TerrariaViewModel.cs
@@ -0,0 +1,47 @@
+using Artemis.DAL;
+using Artemis.Managers;
+using Artemis.Modules.Abstract;
+using Artemis.Settings;
+using Artemis.Utilities;
+using Ninject;
+
+namespace Artemis.Modules.Games.Terraria
+{
+ public sealed class TerrariaViewModel : ModuleViewModel
+ {
+ private string _versionText;
+
+
+ public TerrariaViewModel(MainManager mainManager, [Named(nameof(TerrariaModel))] ModuleModel moduleModel, IKernel kernel) : base(mainManager, moduleModel, kernel)
+ {
+ DisplayName = "Terraria";
+ SetVersionText();
+ }
+
+ public override bool UsesProfileEditor => true;
+
+ public string VersionText
+ {
+ get { return _versionText; }
+ set
+ {
+ if (value == _versionText) return;
+ _versionText = value;
+ NotifyOfPropertyChange(() => VersionText);
+ }
+ }
+
+ private void SetVersionText()
+ {
+ if (!SettingsProvider.Load().EnablePointersUpdate)
+ {
+ VersionText = "You disabled pointer updates, this could result in the Terraria module not working after a game update.";
+ return;
+ }
+
+ Updater.GetPointers();
+ var version = SettingsProvider.Load().Terraria?.GameVersion;
+ VersionText = $"Requires patch {version}. When a new patch is released Artemis downloads new pointers for the latest version (unless disabled in settings).";
+ }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Settings/OffsetSettings.cs b/Artemis/Artemis/Settings/OffsetSettings.cs
index 14a63bee0..ddc3bbf5d 100644
--- a/Artemis/Artemis/Settings/OffsetSettings.cs
+++ b/Artemis/Artemis/Settings/OffsetSettings.cs
@@ -8,6 +8,7 @@ namespace Artemis.Settings
{
public GamePointersCollection RocketLeague { get; set; }
public GamePointersCollection WorldOfWarcraft { get; set; }
+ public GamePointersCollection Terraria { get; set; }
public void Save()
{
diff --git a/Artemis/Artemis/Utilities/Updater.cs b/Artemis/Artemis/Utilities/Updater.cs
index 115919d14..5e863e721 100644
--- a/Artemis/Artemis/Utilities/Updater.cs
+++ b/Artemis/Artemis/Utilities/Updater.cs
@@ -148,6 +148,8 @@ namespace Artemis.Utilities
offsetSettings.RocketLeague = pointers.FirstOrDefault(p => p.Game == "RocketLeague");
if (pointers.FirstOrDefault(p => p.Game == "WorldOfWarcraft") != null)
offsetSettings.WorldOfWarcraft = pointers.FirstOrDefault(p => p.Game == "WorldOfWarcraft");
+ if (pointers.FirstOrDefault(p => p.Game == "Terraria") != null)
+ offsetSettings.Terraria = pointers.FirstOrDefault(p => p.Game == "Terraria");
offsetSettings.Save();
}
diff --git a/Artemis/LightFX2Artemis/LightFX2Artemis.vcxproj b/Artemis/LightFX2Artemis/LightFX2Artemis.vcxproj
index 69d2d3d31..bf7f37fc3 100644
--- a/Artemis/LightFX2Artemis/LightFX2Artemis.vcxproj
+++ b/Artemis/LightFX2Artemis/LightFX2Artemis.vcxproj
@@ -22,7 +22,7 @@
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}
Win32Proj
LightFX2Artemis
- 8.1
+ 10.0.14393.0
diff --git a/Artemis/LogiLed2Artemis/LogiLed2Artemis.vcxproj b/Artemis/LogiLed2Artemis/LogiLed2Artemis.vcxproj
index e41b51302..203df9c55 100644
--- a/Artemis/LogiLed2Artemis/LogiLed2Artemis.vcxproj
+++ b/Artemis/LogiLed2Artemis/LogiLed2Artemis.vcxproj
@@ -23,6 +23,7 @@
Win32Proj
LogiLed2Artemis
LogiLed2Artemis
+ 10.0.14393.0
diff --git a/Artemis/Razer2Artemis/Razer2Artemis.vcxproj b/Artemis/Razer2Artemis/Razer2Artemis.vcxproj
index 320fd6888..8669c2925 100644
--- a/Artemis/Razer2Artemis/Razer2Artemis.vcxproj
+++ b/Artemis/Razer2Artemis/Razer2Artemis.vcxproj
@@ -21,7 +21,7 @@
{39711909-C1D5-46CE-A9EA-2D561692EA47}
Razer2Artemis
- 8.1
+ 10.0.14393.0