This repository was archived by the owner on Jun 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finally getting around to making a repo for this bad move!
- Loading branch information
Showing
38 changed files
with
1,924 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
</configuration> |
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,76 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | ||
<security> | ||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<!-- UAC Manifest Options | ||
If you want to change the Windows User Account Control level replace the | ||
requestedExecutionLevel node with one of the following. | ||
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> | ||
Specifying requestedExecutionLevel element will disable file and registry virtualization. | ||
Remove this element if your application requires this virtualization for backwards | ||
compatibility. | ||
--> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
|
||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
<application> | ||
<!-- A list of the Windows versions that this application has been tested on | ||
and is designed to work with. Uncomment the appropriate elements | ||
and Windows will automatically select the most compatible environment. --> | ||
|
||
<!-- Windows Vista --> | ||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />--> | ||
|
||
<!-- Windows 7 --> | ||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />--> | ||
|
||
<!-- Windows 8 --> | ||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />--> | ||
|
||
<!-- Windows 8.1 --> | ||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />--> | ||
|
||
<!-- Windows 10 --> | ||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />--> | ||
|
||
</application> | ||
</compatibility> | ||
|
||
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher | ||
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need | ||
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should | ||
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. --> | ||
<!-- | ||
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<windowsSettings> | ||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> | ||
</windowsSettings> | ||
</application> | ||
--> | ||
|
||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) --> | ||
<!-- | ||
<dependency> | ||
<dependentAssembly> | ||
<assemblyIdentity | ||
type="win32" | ||
name="Microsoft.Windows.Common-Controls" | ||
version="6.0.0.0" | ||
processorArchitecture="*" | ||
publicKeyToken="6595b64144ccf1df" | ||
language="*" | ||
/> | ||
</dependentAssembly> | ||
</dependency> | ||
--> | ||
|
||
</assembly> |
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,26 @@ | ||
<prism:PrismApplication x:Class="PaisleyPark.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:prism="http://prismlibrary.com/"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> | ||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> | ||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> | ||
|
||
<!-- accent resource --> | ||
<!-- change "Cobalt" to the accent color you want --> | ||
|
||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Cobalt.xaml" /> | ||
|
||
<!-- theme resource --> | ||
<!-- change "BaseLight" to the theme you want --> | ||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" /> | ||
|
||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" /> | ||
|
||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</prism:PrismApplication> |
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,19 @@ | ||
using PaisleyPark.Views; | ||
using Prism.Ioc; | ||
using System.Windows; | ||
|
||
namespace PaisleyPark | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App | ||
{ | ||
protected override Window CreateShell() => Container.Resolve<MainWindow>(); | ||
|
||
protected override void RegisterTypes(IContainerRegistry containerRegistry) | ||
{ | ||
|
||
} | ||
} | ||
} |
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,32 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace PaisleyPark.Common | ||
{ | ||
public static class AsmjitCSharp | ||
{ | ||
[DllImport("AsmjitCSharp.dll", EntryPoint = "Assembler")] | ||
private static extern void Native_Assembler(string input, out IntPtr addr, out int size); | ||
|
||
/// <summary> | ||
/// Assembles input for injection. | ||
/// </summary> | ||
/// <param name="input">String of assembly split by new line characters.</param> | ||
/// <returns>Array of bytes.</returns> | ||
public static byte[] Assemble(string input) | ||
{ | ||
Native_Assembler(input, out IntPtr addr, out int size); | ||
byte[] bytes = new byte[size]; | ||
for (var i = 0; i < size; i++) | ||
bytes[i] = Marshal.ReadByte(addr, i); | ||
return bytes; | ||
} | ||
|
||
/// <summary> | ||
/// Assembles input for injection. | ||
/// </summary> | ||
/// <param name="input">Array of assembly instructions.</param> | ||
/// <returns>Array of bytes.</returns> | ||
public static byte[] Assemble(string[] input) => Assemble(string.Join("\n", input)); | ||
} | ||
} |
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.Windows; | ||
|
||
namespace PaisleyPark.Common | ||
{ | ||
public static class CloseProperty | ||
{ | ||
public static DependencyProperty IsCloseProperty = DependencyProperty.RegisterAttached( | ||
"IsClose", | ||
typeof(bool), | ||
typeof(CloseProperty), | ||
new PropertyMetadata(false, new PropertyChangedCallback(OnNotifyPropertyChanged)) | ||
); | ||
|
||
public static bool GetIsClose(UIElement win) => (bool)win.GetValue(IsCloseProperty); | ||
public static void SetIsClose(UIElement win, bool value) => win.SetValue(IsCloseProperty, value); | ||
|
||
private static void OnNotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
{ | ||
var win = d as Window; | ||
if ((bool)e.NewValue) | ||
win.Close(); | ||
} | ||
} | ||
} |
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,22 @@ | ||
using System.Windows; | ||
|
||
namespace PaisleyPark.Common | ||
{ | ||
public static class DialogCloser | ||
{ | ||
public static readonly DependencyProperty DialogResultProperty = DependencyProperty.RegisterAttached( | ||
"DialogResult", | ||
typeof(bool?), | ||
typeof(DialogCloser), | ||
new PropertyMetadata(OnDialogResultChanged) | ||
); | ||
|
||
private static void OnDialogResultChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
{ | ||
if (d is Window window && window != null && window.IsVisible) | ||
window.DialogResult = e.NewValue as bool?; | ||
} | ||
|
||
public static void SetDialogResult(Window target, bool? value) => target.SetValue(DialogResultProperty, value); | ||
} | ||
} |
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,10 @@ | ||
using System; | ||
|
||
namespace PaisleyPark.Common | ||
{ | ||
public static class ExtensionMethods | ||
{ | ||
public static string AsHex(this ulong s) => string.Format("0x{0:X}", s); | ||
public static ulong ToUint64(this IntPtr ptr) => (ulong)ptr.ToInt64(); | ||
} | ||
} |
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,9 @@ | ||
using Prism.Events; | ||
|
||
namespace PaisleyPark.Common | ||
{ | ||
public class GameMemoryUpdateEvent : PubSubEvent<object> | ||
{ | ||
|
||
} | ||
} |
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,15 @@ | ||
using SaintCoinach.Ex.Relational.Update; | ||
using System; | ||
|
||
namespace PaisleyPark.Common | ||
{ | ||
public class ProgressUpdate : IProgress<UpdateProgress> | ||
{ | ||
public event EventHandler<UpdateProgress> UpdateEvent; | ||
|
||
public void Report(UpdateProgress value) | ||
{ | ||
UpdateEvent.Invoke(this, value); | ||
} | ||
} | ||
} |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> | ||
<PropertyChanged2 /> | ||
</Weavers> |
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,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> | ||
<xs:element name="Weavers"> | ||
<xs:complexType> | ||
<xs:all> | ||
<xs:element name="PropertyChanged2" minOccurs="0" maxOccurs="1" type="xs:anyType" /> | ||
</xs:all> | ||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> | ||
<xs:annotation> | ||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> | ||
</xs:annotation> | ||
</xs:attribute> | ||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> | ||
<xs:annotation> | ||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> | ||
</xs:annotation> | ||
</xs:attribute> | ||
<xs:attribute name="GenerateXsd" type="xs:boolean"> | ||
<xs:annotation> | ||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> | ||
</xs:annotation> | ||
</xs:attribute> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:schema> |
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,39 @@ | ||
using System.ComponentModel; | ||
|
||
namespace PaisleyPark.Models | ||
{ | ||
/// <summary> | ||
/// Memory model holds information pulled from the game. | ||
/// </summary> | ||
public class Memory : INotifyPropertyChanged | ||
{ | ||
/// <summary> | ||
/// Current Map ID. | ||
/// </summary> | ||
public uint MapID { get; set; } | ||
|
||
/// <summary> | ||
/// Player coordinates in game. | ||
/// </summary> | ||
public float PlayerX { get; set; } | ||
public float PlayerY { get; set; } | ||
public float PlayerZ { get; set; } | ||
|
||
/// <summary> | ||
/// Waymark coordinates in game. | ||
/// </summary> | ||
public Waymark A { get; set; } | ||
public Waymark B { get; set; } | ||
public Waymark C { get; set; } | ||
public Waymark D { get; set; } | ||
public Waymark One { get; set; } | ||
public Waymark Two { get; set; } | ||
|
||
/// <summary> | ||
/// Property Changed event handler for this model. | ||
/// </summary> | ||
#pragma warning disable 67 | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
#pragma warning restore 67 | ||
} | ||
} |
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,37 @@ | ||
using System.ComponentModel; | ||
|
||
namespace PaisleyPark.Models | ||
{ | ||
/// <summary> | ||
/// Preset Model for use in the application. | ||
/// </summary> | ||
public class Preset : INotifyPropertyChanged | ||
{ | ||
/// <summary> | ||
/// Name of this preset. | ||
/// </summary> | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Map ID of where this preset belongs. | ||
/// </summary> | ||
public uint MapID { get; set; } | ||
|
||
/// <summary> | ||
/// Waymark values for all of every waymark in the game. | ||
/// </summary> | ||
public Waymark A { get; set; } | ||
public Waymark B { get; set; } | ||
public Waymark C { get; set; } | ||
public Waymark D { get; set; } | ||
public Waymark One { get; set; } | ||
public Waymark Two { get; set; } | ||
|
||
/// <summary> | ||
/// Property Changed event handler for this model. | ||
/// </summary> | ||
#pragma warning disable 67 | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
#pragma warning restore 67 | ||
} | ||
} |
Oops, something went wrong.