diff --git a/LarkatorGUI/ArkReader.cs b/LarkatorGUI/ArkReader.cs index 6cce9c8..ee7232a 100644 --- a/LarkatorGUI/ArkReader.cs +++ b/LarkatorGUI/ArkReader.cs @@ -21,6 +21,8 @@ public class ArkReader public int NumberOfSpecies { get { return ClassMapping.Count; } } public bool Tamed { get; private set; } + public bool ForceNextConversion { get; set; } + Dictionary ClassMapping = new Dictionary(); private bool executing; private string outputDir; @@ -35,13 +37,14 @@ private void EnsureDirectory(string outputDir) if (!Directory.Exists(outputDir)) Directory.CreateDirectory(outputDir); } - public async Task PerformConversion(bool force = false) + public async Task PerformConversion(bool force, string dirName) { - outputDir = Path.Combine(Properties.Settings.Default.OutputDir, Tamed ? "tamed" : "wild"); + outputDir = Path.Combine(Properties.Settings.Default.OutputDir, dirName, Tamed ? "tamed" : "wild"); EnsureDirectory(outputDir); - if (force || IsConversionRequired()) + if (force || ForceNextConversion || IsConversionRequired()) { + ForceNextConversion = false; await RunArkTools(); } @@ -116,8 +119,10 @@ private async Task LoadClassesJson() .Where(m => !m.Cls.Contains("BP_Ocean_C")) .ToDictionary(m => m.Name, m => m.Cls); +#if WARN_ON_EMPTY_CLASSES if (ClassMapping.Count <= 0) throw new ExternalToolsException("ARK Tools produced no classes output"); +#endif } private async Task LoadSpecies(string speciesName) diff --git a/LarkatorGUI/CalibrationWindow.xaml b/LarkatorGUI/CalibrationWindow.xaml new file mode 100644 index 0000000..31e858c --- /dev/null +++ b/LarkatorGUI/CalibrationWindow.xaml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LarkatorGUI/CalibrationWindow.xaml.cs b/LarkatorGUI/CalibrationWindow.xaml.cs new file mode 100644 index 0000000..448377c --- /dev/null +++ b/LarkatorGUI/CalibrationWindow.xaml.cs @@ -0,0 +1,219 @@ +using Newtonsoft.Json; +using System; +using System.Diagnostics; +using System.Runtime.Serialization; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; + +namespace LarkatorGUI +{ + /// + /// Interaction logic for CalibrationWindow.xaml + /// + public partial class CalibrationWindow : Window + { + private bool dragging; + private Bounds boundsMult; + private Calibration calibration; + + public CalibrationWindow(Calibration calibration) + { + DataContext = calibration; + this.calibration = calibration; + + InitializeComponent(); + } + + private void Image_MouseDown(object sender, MouseButtonEventArgs e) + { + var img = (Image)sender; + var pos = Mouse.GetPosition(img); + pos.X /= img.ActualWidth; + pos.Y /= img.ActualHeight; + + dragging = true; + boundsMult = new Bounds + { + X1 = pos.X < 0.5 ? 1 : 0, + X2 = pos.X > 0.5 ? 1 : 0, + Y1 = pos.Y < 0.5 ? 1 : 0, + Y2 = pos.Y > 0.5 ? 1 : 0 + }; + + img.CaptureMouse(); + } + + private void Image_MouseUp(object sender, MouseButtonEventArgs e) + { + if (!dragging) return; + var img = (Image)sender; + img.ReleaseMouseCapture(); + dragging = false; + } + + private void Image_MouseMove(object sender, MouseEventArgs e) + { + if (!dragging) return; + + var img = (Image)sender; + var pos = Mouse.GetPosition(img); + + calibration.Bounds.X1 = UpdateBound(calibration.Bounds.X1, boundsMult.X1, pos.X); + calibration.Bounds.X2 = UpdateBound(calibration.Bounds.X2, boundsMult.X2, pos.X); + calibration.Bounds.Y1 = UpdateBound(calibration.Bounds.Y1, boundsMult.Y1, pos.Y); + calibration.Bounds.Y2 = UpdateBound(calibration.Bounds.Y2, boundsMult.Y2, pos.Y); + + calibration.Recalculate(); + } + + private double UpdateBound(double cal, double mult, double x) + { + return cal * (1 - mult) + x * mult; + } + } + + public class ExampleCalibration : Calibration + { + public ExampleCalibration() + { + Bounds = new Bounds { X1 = 100, X2 = 800, Y1 = 150, Y2 = 750 }; + } + } + + [DataContract] + public class Calibration : DependencyObject + { + [JsonIgnore] + public Bounds Bounds + { + get { return (Bounds)GetValue(BoundsProperty); } + set { SetValue(BoundsProperty, value); } + } + + [DataMember] + public string Filename + { + get { return (string)GetValue(FilenameProperty); } + set { SetValue(FilenameProperty, value); } + } + + [DataMember] + public double OffsetX + { + get { return (double)GetValue(OffsetXProperty); } + set { SetValue(OffsetXProperty, value); } + } + + [DataMember] + public double OffsetY + { + get { return (double)GetValue(OffsetYProperty); } + set { SetValue(OffsetYProperty, value); } + } + + [DataMember] + public double ScaleX + { + get { return (double)GetValue(ScaleXProperty); } + set { SetValue(ScaleXProperty, value); } + } + + [DataMember] + public double ScaleY + { + get { return (double)GetValue(ScaleYProperty); } + set { SetValue(ScaleYProperty, value); } + } + + [JsonIgnore] + public string Output + { + get { return (string)GetValue(OutputProperty); } + set { SetValue(OutputProperty, value); } + } + + public static readonly DependencyProperty OutputProperty = + DependencyProperty.Register("Output", typeof(string), typeof(Calibration), new PropertyMetadata("")); + + public static readonly DependencyProperty ScaleYProperty = + DependencyProperty.Register("ScaleY", typeof(double), typeof(Calibration), new PropertyMetadata(0.0)); + + public static readonly DependencyProperty ScaleXProperty = + DependencyProperty.Register("ScaleX", typeof(double), typeof(Calibration), new PropertyMetadata(0.0)); + + public static readonly DependencyProperty OffsetYProperty = + DependencyProperty.Register("OffsetY", typeof(double), typeof(Calibration), new PropertyMetadata(0.0)); + + public static readonly DependencyProperty OffsetXProperty = + DependencyProperty.Register("OffsetX", typeof(double), typeof(Calibration), new PropertyMetadata(0.0)); + + public static readonly DependencyProperty ImageProperty = + DependencyProperty.Register("Image", typeof(string), typeof(Calibration), new PropertyMetadata("")); + + public static readonly DependencyProperty FilenameProperty = + DependencyProperty.Register("Filename", typeof(string), typeof(Calibration), new PropertyMetadata("")); + + public static readonly DependencyProperty BoundsProperty = + DependencyProperty.Register("Bounds", typeof(Bounds), typeof(Calibration), new PropertyMetadata(null)); + + public void Recalculate() + { + if (Bounds == null) return; + + var minX = Math.Min(Bounds.X1, Bounds.X2); + var minY = Math.Min(Bounds.Y1, Bounds.Y2); + var maxX = Math.Max(Bounds.X1, Bounds.X2); + var maxY = Math.Max(Bounds.Y1, Bounds.Y2); + + ScaleX = (maxX - minX) / 80.0; + ScaleY = (maxY - minY) / 80.0; + + OffsetX = minX - ScaleX * 10; + OffsetY = minY - ScaleY * 10; + + Output = JsonConvert.SerializeObject(this, Formatting.Indented); + } + } + + [DebuggerDisplay("X={X1}-{X2}, Y={Y1}-{Y2}")] + public class Bounds : DependencyObject + { + public double X1 + { + get { return (double)GetValue(X1Property); } + set { SetValue(X1Property, value); } + } + + public double X2 + { + get { return (double)GetValue(X2Property); } + set { SetValue(X2Property, value); } + } + + public double Y1 + { + get { return (double)GetValue(Y1Property); } + set { SetValue(Y1Property, value); } + } + + public double Y2 + { + get { return (double)GetValue(Y2Property); } + set { SetValue(Y2Property, value); } + } + + public static readonly DependencyProperty Y2Property = + DependencyProperty.Register("Y2", typeof(double), typeof(Bounds), new PropertyMetadata(0.0)); + + public static readonly DependencyProperty Y1Property = + DependencyProperty.Register("Y1", typeof(double), typeof(Bounds), new PropertyMetadata(0.0)); + + public static readonly DependencyProperty X2Property = + DependencyProperty.Register("X2", typeof(double), typeof(Bounds), new PropertyMetadata(0.0)); + + public static readonly DependencyProperty X1Property = + DependencyProperty.Register("X1", typeof(double), typeof(Bounds), new PropertyMetadata(0.0)); + } + +} diff --git a/LarkatorGUI/LarkatorGUI.csproj b/LarkatorGUI/LarkatorGUI.csproj index 18c226d..c5cb21d 100644 --- a/LarkatorGUI/LarkatorGUI.csproj +++ b/LarkatorGUI/LarkatorGUI.csproj @@ -97,6 +97,11 @@ + + + False + ..\..\..\..\program files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Serialization.Primitives.dll + @@ -116,6 +121,9 @@ Designer + + CalibrationWindow.xaml + @@ -129,6 +137,7 @@ MainWindow.xaml + NumericEntryControl.xaml @@ -143,6 +152,10 @@ Code + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -189,6 +202,7 @@ Designer + Designer @@ -215,9 +229,6 @@ - - - @@ -233,5 +244,12 @@ false + + + + + + + \ No newline at end of file diff --git a/LarkatorGUI/MainWindow.xaml b/LarkatorGUI/MainWindow.xaml index 16d68e1..d4f5b4d 100644 --- a/LarkatorGUI/MainWindow.xaml +++ b/LarkatorGUI/MainWindow.xaml @@ -9,11 +9,11 @@ xmlns:fa="http://schemas.fontawesome.io/icons/" xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop" xmlns:sysCol="clr-namespace:System.Collections;assembly=mscorlib" + xmlns:sys="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" - x:Name="root" SourceInitialized="Window_SourceInitialized" Loaded="Window_Loaded" Title="{Binding WindowTitle}" Background="{DynamicResource WindowBackgroundBrush}" - MaxHeight="800" MinHeight="240" + MaxHeight="1000" MinHeight="240" Left="{Binding Source={StaticResource Settings}, Path=Default.MainWindowLeft, Mode=TwoWay}" Top="{Binding Source={StaticResource Settings}, Path=Default.MainWindowTop, Mode=TwoWay}" Width="{Binding Source={StaticResource Settings}, Path=Default.MainWindowWidth, Mode=TwoWay}" @@ -129,8 +129,8 @@ - + @@ -142,7 +142,7 @@ - + @@ -352,9 +352,9 @@ - + - + @@ -366,7 +366,13 @@ - + + + + + + + diff --git a/LarkatorGUI/MainWindow.xaml.cs b/LarkatorGUI/MainWindow.xaml.cs index dd955eb..e96e153 100644 --- a/LarkatorGUI/MainWindow.xaml.cs +++ b/LarkatorGUI/MainWindow.xaml.cs @@ -14,6 +14,7 @@ using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; +using System.Windows.Media; using System.Windows.Threading; namespace LarkatorGUI @@ -43,6 +44,8 @@ public string ApplicationVersion } public string WindowTitle { get { return $"{Properties.Resources.ProgramName} {ApplicationVersion}"; } } + public MapCalibration MapCalibration { get; private set; } + public ImageSource MapImage { get; private set; } public bool IsLoading { @@ -92,6 +95,15 @@ public bool ShowTames set { SetValue(ShowTamesProperty, value); } } + public ImageSource ImageSource + { + get { return (ImageSource)GetValue(ImageSourceProperty); } + set { SetValue(ImageSourceProperty, value); } + } + + public static readonly DependencyProperty ImageSourceProperty = + DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(MainWindow), new PropertyMetadata(null)); + public static readonly DependencyProperty ShowTamesProperty = DependencyProperty.Register("ShowTames", typeof(bool), typeof(MainWindow), new PropertyMetadata(false)); @@ -121,7 +133,7 @@ public bool ShowTames ArkReader arkReaderTamed; FileSystemWatcher fileWatcher; DispatcherTimer reloadTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(2) }; - + private List mapCalibrations; readonly List nullableBoolValues = new List { null, false, true }; public MainWindow() @@ -131,19 +143,19 @@ public MainWindow() arkReaderWild = new ArkReader(true); arkReaderTamed = new ArkReader(false); + LoadCalibrations(); + DiscoverCalibration(); + DataContext = this; InitializeComponent(); + devButtons.Visibility = (ApplicationVersion == "DEVELOPMENT") ? Visibility.Visible : Visibility.Collapsed; + LoadSavedSearches(); EnsureOutputDirectory(); - - // Setup file watcher - fileWatcher = new FileSystemWatcher(Path.GetDirectoryName(Properties.Settings.Default.SaveFile)); - fileWatcher.Renamed += FileWatcher_Changed; - fileWatcher.EnableRaisingEvents = true; - reloadTimer.Interval = TimeSpan.FromMilliseconds(Properties.Settings.Default.ConvertDelay); - reloadTimer.Tick += ReloadTimer_Tick; + SetupFileWatcher(); + CheckIfArkChanged(false); // Sort the results resultsList.Items.SortDescriptions.Add(new SortDescription("Dino.BaseLevel", ListSortDirection.Descending)); @@ -157,6 +169,41 @@ public MainWindow() view.GroupDescriptions.Add(new PropertyGroupDescription("Group")); } + private void SetupFileWatcher() + { + if (fileWatcher != null) fileWatcher.EnableRaisingEvents = false; + fileWatcher = new FileSystemWatcher(Path.GetDirectoryName(Properties.Settings.Default.SaveFile)); + fileWatcher.Renamed += FileWatcher_Changed; + fileWatcher.EnableRaisingEvents = true; + reloadTimer.Interval = TimeSpan.FromMilliseconds(Properties.Settings.Default.ConvertDelay); + reloadTimer.Tick += ReloadTimer_Tick; + } + + private void LoadCalibrations() + { + mapCalibrations = JsonConvert.DeserializeObject>(Properties.Resources.calibrationsJson); + } + + private void DiscoverCalibration() + { + var filename = Properties.Settings.Default.SaveFile; + filename = Path.GetFileNameWithoutExtension(filename); + var best = mapCalibrations.FirstOrDefault(cal => filename.StartsWith(cal.Filename)); + if (best == null) + { + StatusText = "Warning: Unable to determine map from filename - defaulting to The Island"; + MapCalibration = mapCalibrations.Single(cal => cal.Filename == "TheIsland"); + } + else + { + MapCalibration = best; + } + + var imgFilename = $"pack://application:,,,/imgs/map_{MapCalibration.Filename}.jpg"; + MapImage = (new ImageSourceConverter()).ConvertFromString(imgFilename) as ImageSource; + if (image != null) image.Source = MapImage; + } + private void ValidateWindowPositionAndSize() { var settings = Properties.Settings.Default; @@ -187,11 +234,49 @@ private void EnsureOutputDirectory() } } + private void CheckIfArkChanged(bool reconvert = true) + { + var arkChanged = false; + try + { + var lastArk = File.ReadAllText(Path.Combine(Properties.Settings.Default.OutputDir, Properties.Resources.LastArkFile)); + if (lastArk != Properties.Settings.Default.SaveFile) arkChanged = true; + } + catch + { + arkChanged = true; + } + + if (arkChanged) + { + arkReaderTamed.ForceNextConversion = true; + arkReaderWild.ForceNextConversion = true; + + if (reconvert) + { + NotifyArkChanged(); + } + } + } + + private void NotifyArkChanged() + { + // Cause a fresh conversion of the new ark + Dispatcher.Invoke(() => ReReadArk(force: true), DispatcherPriority.Background); + + // Ensure the file watcher is watching the right directory + fileWatcher.Path = Path.GetDirectoryName(Properties.Settings.Default.SaveFile); + } + private void FileWatcher_Changed(object sender, FileSystemEventArgs e) { if (!String.Equals(e.FullPath, Properties.Settings.Default.SaveFile)) return; - Dispatcher.Invoke(() => StatusText = "Detected change to saved ARK..."); + Dispatcher.Invoke(() => + { + StatusText = "Detected change to saved ARK..."; + StatusDetailText = "...waiting"; + }); // Cancel any existing timer to ensure we're not called multiple times if (reloadTimer.IsEnabled) reloadTimer.Stop(); @@ -245,6 +330,36 @@ private void CreateSearch_Click(object sender, RoutedEventArgs e) groupsCombo.ItemsSource = ListSearches.Select(sc => sc.Group).Distinct().OrderBy(g => g).ToArray(); } + private void Calibration_Click(object sender, MouseButtonEventArgs e) + { + var win = new CalibrationWindow(new Calibration { Bounds = new Bounds() }); + win.ShowDialog(); + } + + private void DummyData_Click(object sender, MouseButtonEventArgs e) + { + ListResults.Clear(); + + var dummyData = new Dino[] { + new Dino { Location=new Position{ Lat=10,Lon=10 }, Type="Testificate", Name="10,10" }, + new Dino { Location=new Position{ Lat=90,Lon=10 }, Type="Testificate", Name="90,10" }, + new Dino { Location=new Position{ Lat=10,Lon=90 }, Type="Testificate", Name="10,90" }, + new Dino { Location=new Position{ Lat=90,Lon=90 }, Type="Testificate", Name="90,90" }, + new Dino { Location=new Position{ Lat=50,Lon=50 }, Type="Testificate", Name="50,50" }, + }; + + var rnd = new Random(); + foreach (var result in dummyData) + { + result.Id = (ulong)rnd.Next(); + DinoViewModel vm = new DinoViewModel(result) { Color = Colors.Green }; + ListResults.Add(vm); + } + + var cv = (CollectionView)CollectionViewSource.GetDefaultView(ListResults); + cv.Refresh(); + } + private async void SaveSearch_Click(object sender, RoutedEventArgs e) { if (String.IsNullOrWhiteSpace(NewSearch.Species)) return; @@ -253,10 +368,20 @@ private async void SaveSearch_Click(object sender, RoutedEventArgs e) { NewSearch.Order = ListSearches.Where(sc => sc.Group == NewSearch.Group).Max(sc => sc.Order) + 100; } - catch (InvalidOperationException) + catch (InvalidOperationException) // no entries for .Max - ignore { } - await arkReaderWild.EnsureSpeciesIsLoaded(NewSearch.Species); + IsLoading = true; + try + { + StatusText = $"Loading {NewSearch.Species}..."; + await arkReaderWild.EnsureSpeciesIsLoaded(NewSearch.Species); + StatusText = $"Ready"; + } + finally + { + IsLoading = false; + } ListSearches.Add(NewSearch); NewSearch = null; @@ -389,13 +514,29 @@ private async Task ReReadArk(bool force = false) private async Task LoadSearchSpecies() { - var species = arkReaderWild.AllSpecies.Distinct(); - foreach (var speciesName in species) - await arkReaderWild.EnsureSpeciesIsLoaded(speciesName); + IsLoading = true; + try + { + var species = arkReaderWild.AllSpecies.Distinct(); + foreach (var speciesName in species) + { + StatusText = $"Loading {speciesName}..."; + await arkReaderWild.EnsureSpeciesIsLoaded(speciesName); + } - species = arkReaderTamed.AllSpecies.Distinct(); - foreach (var speciesName in species) - await arkReaderTamed.EnsureSpeciesIsLoaded(speciesName); + species = arkReaderTamed.AllSpecies.Distinct(); + foreach (var speciesName in species) + { + StatusText = $"Loading {speciesName}..."; + await arkReaderTamed.EnsureSpeciesIsLoaded(speciesName); + } + + StatusText = "Ready"; + } + finally + { + IsLoading = false; + } } private void UpdateSearchResults(IList searches) @@ -437,15 +578,21 @@ private void UpdateSearchResults(IList searches) private async Task PerformConversion(bool force) { + string arkDirName = Path.GetFileNameWithoutExtension(Properties.Settings.Default.SaveFile); + IsLoading = true; try { + StatusDetailText = "...converting"; StatusText = "Processing saved ARK : Wild"; - await arkReaderWild.PerformConversion(force); + await arkReaderWild.PerformConversion(force, arkDirName); StatusText = "Processing saved ARK : Tamed"; - await arkReaderTamed.PerformConversion(force); + await arkReaderTamed.PerformConversion(force, arkDirName); StatusText = "ARK processing completed"; StatusDetailText = $"{arkReaderWild.NumberOfSpecies} wild and {arkReaderTamed.NumberOfSpecies} species located"; + + // Write path to last ark into the output folder so we can check when we change ARKs + File.WriteAllText(Path.Combine(Properties.Settings.Default.OutputDir, Properties.Resources.LastArkFile), Properties.Settings.Default.SaveFile); } catch (Exception ex) { @@ -568,7 +715,10 @@ private void Settings_Click(object sender, MouseButtonEventArgs e) private void OnSettingsChanged() { + DiscoverCalibration(); EnsureOutputDirectory(); + CheckIfArkChanged(); + UpdateCurrentSearch(); reloadTimer.Interval = TimeSpan.FromMilliseconds(Properties.Settings.Default.ConvertDelay); } diff --git a/LarkatorGUI/MapPositionConverter.cs b/LarkatorGUI/MapPositionConverter.cs new file mode 100644 index 0000000..de95384 --- /dev/null +++ b/LarkatorGUI/MapPositionConverter.cs @@ -0,0 +1,70 @@ +using Larkator.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media; + +namespace LarkatorGUI +{ + public class MapPositionConverter : DependencyObject + { + + public static MapCalibration GetCalibration(DependencyObject obj) + { + return (MapCalibration)obj.GetValue(CalibrationProperty); + } + + public static void SetCalibration(DependencyObject obj, MapCalibration value) + { + obj.SetValue(CalibrationProperty, value); + } + + public static Position GetPosition(DependencyObject obj) + { + return (Position)obj.GetValue(PositionProperty); + } + + public static void SetPosition(DependencyObject obj, Position value) + { + obj.SetValue(PositionProperty, value); + } + + public static readonly DependencyProperty PositionProperty = + DependencyProperty.RegisterAttached("Position", typeof(Position), typeof(MapPositionConverter), new PropertyMetadata(null, OnChanged)); + + public static readonly DependencyProperty CalibrationProperty = + DependencyProperty.RegisterAttached("Calibration", typeof(MapCalibration), typeof(MapPositionConverter), new PropertyMetadata(null, OnChanged)); + + + public static void OnChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is TranslateTransform tx) + { + var cal = GetCalibration(d); + var pos = GetPosition(d); + if (cal == null || pos == null) return; + + tx.X = pos.Lon * cal.ScaleX + cal.OffsetX; + tx.Y = pos.Lat * cal.ScaleY + cal.OffsetY; + } + else + { + throw new InvalidOperationException("MapPositionConverter should only be attached to a TranslateTransform"); + } + } + } + + public class MapCalibration + { + public string Filename { get; set; } + + public double OffsetX { get; set; } + public double OffsetY { get; set; } + + public double ScaleX { get; set; } + public double ScaleY { get; set; } + } +} diff --git a/LarkatorGUI/Properties/Resources.Designer.cs b/LarkatorGUI/Properties/Resources.Designer.cs index 6a569d4..912dc09 100644 --- a/LarkatorGUI/Properties/Resources.Designer.cs +++ b/LarkatorGUI/Properties/Resources.Designer.cs @@ -69,6 +69,46 @@ internal static string ArkToolsExe { } } + /// + /// Looks up a localized string similar to [ + /// { + /// "Filename": "TheIsland", + /// "OffsetX": 13.75, + /// "OffsetY": 23.75, + /// "ScaleX": 9.8875, + /// "ScaleY": 9.625 + /// }, + /// { + /// "Filename": "TheCenter", + /// "OffsetX": 14.0, + /// "OffsetY": 23.75, + /// "ScaleX": 9.9, + /// "ScaleY": 9.625 + /// }, + /// { + /// "Filename": "Aberration", + /// "OffsetX": 15.125, + /// "OffsetY": 19.0, + /// "ScaleX": 9.8875, + /// "ScaleY": 9.7 + /// }, + /// { + /// "Filename": "Ragnarok", + /// "OffsetX": 15.125, + /// "OffsetY": 18.875, + /// "ScaleX": 9.8875, + /// "ScaleY": 9.7125 + /// }, + /// { + /// "Filename": "ScorchedEarth", + /// [rest of string was truncated]";. + /// + internal static string calibrationsJson { + get { + return ResourceManager.GetString("calibrationsJson", resourceCulture); + } + } + /// /// Looks up a localized string similar to classes.json. /// @@ -78,6 +118,15 @@ internal static string ClassesJson { } } + /// + /// Looks up a localized string similar to last_ark.txt. + /// + internal static string LastArkFile { + get { + return ResourceManager.GetString("LastArkFile", resourceCulture); + } + } + /// /// Looks up a localized string similar to Larkator. /// diff --git a/LarkatorGUI/Properties/Resources.resx b/LarkatorGUI/Properties/Resources.resx index 18b54ee..e07f72d 100644 --- a/LarkatorGUI/Properties/Resources.resx +++ b/LarkatorGUI/Properties/Resources.resx @@ -120,9 +120,16 @@ ark-tools.exe + + + ..\calibrations.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + classes.json + + last_ark.txt + Larkator diff --git a/LarkatorGUI/calibrations.json b/LarkatorGUI/calibrations.json new file mode 100644 index 0000000..c900182 --- /dev/null +++ b/LarkatorGUI/calibrations.json @@ -0,0 +1,37 @@ +[ + { + "Filename": "TheIsland", + "OffsetX": 13.75, + "OffsetY": 23.75, + "ScaleX": 9.8875, + "ScaleY": 9.625 + }, + { + "Filename": "TheCenter", + "OffsetX": 14.0, + "OffsetY": 23.75, + "ScaleX": 9.9, + "ScaleY": 9.625 + }, + { + "Filename": "Aberration", + "OffsetX": 15.125, + "OffsetY": 19.0, + "ScaleX": 9.8875, + "ScaleY": 9.7 + }, + { + "Filename": "Ragnarok", + "OffsetX": 15.125, + "OffsetY": 18.875, + "ScaleX": 9.8875, + "ScaleY": 9.7125 + }, + { + "Filename": "ScorchedEarth", + "OffsetX": 13.875, + "OffsetY": 21.125, + "ScaleX": 9.9125, + "ScaleY": 9.6875 + } +] \ No newline at end of file diff --git a/LarkatorGUI/imgs/hires_map.png b/LarkatorGUI/imgs/hires_map.png deleted file mode 100644 index 4273855..0000000 Binary files a/LarkatorGUI/imgs/hires_map.png and /dev/null differ diff --git a/LarkatorGUI/imgs/map_Aberration.jpg b/LarkatorGUI/imgs/map_Aberration.jpg new file mode 100644 index 0000000..7e04c88 Binary files /dev/null and b/LarkatorGUI/imgs/map_Aberration.jpg differ diff --git a/LarkatorGUI/imgs/map_Ragnarok.jpg b/LarkatorGUI/imgs/map_Ragnarok.jpg new file mode 100644 index 0000000..73d5cdf Binary files /dev/null and b/LarkatorGUI/imgs/map_Ragnarok.jpg differ diff --git a/LarkatorGUI/imgs/map_ScorchedEarth.jpg b/LarkatorGUI/imgs/map_ScorchedEarth.jpg new file mode 100644 index 0000000..062d77a Binary files /dev/null and b/LarkatorGUI/imgs/map_ScorchedEarth.jpg differ diff --git a/LarkatorGUI/imgs/map_TheCenter.jpg b/LarkatorGUI/imgs/map_TheCenter.jpg new file mode 100644 index 0000000..769dabb Binary files /dev/null and b/LarkatorGUI/imgs/map_TheCenter.jpg differ diff --git a/LarkatorGUI/imgs/map_TheIsland.jpg b/LarkatorGUI/imgs/map_TheIsland.jpg new file mode 100644 index 0000000..f65254c Binary files /dev/null and b/LarkatorGUI/imgs/map_TheIsland.jpg differ