-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
4,630 additions
and
1,847 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
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
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
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
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,45 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System; | ||
using System.Windows.Forms; | ||
|
||
namespace SHME.ExternalTool.Extras | ||
{ | ||
[Flags] | ||
public enum ShmeCommand | ||
{ | ||
None, | ||
Forward, | ||
Backward, | ||
Left, | ||
Right, | ||
Up, | ||
Down, | ||
Action, | ||
Aim, | ||
Light, | ||
Run, | ||
View, | ||
Map, | ||
Option | ||
} | ||
|
||
public class InputBind(ShmeCommand command, Keys keyBind, MouseButtons mouseBind) | ||
{ | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public ShmeCommand Command { get; set; } = command; | ||
|
||
[JsonConverter(typeof(StringEnumConverter))] | ||
public Keys KeyBind { get; set; } = keyBind; | ||
|
||
[JsonConverter(typeof(StringEnumConverter))] | ||
public MouseButtons MouseBind { get; set; } = mouseBind; | ||
|
||
public InputBind() : this(ShmeCommand.None, Keys.None, MouseButtons.None) | ||
{ | ||
} | ||
public InputBind(InputBind b) : this(b.Command, b.KeyBind, b.MouseBind) | ||
Check warning on line 41 in src/SHME.ExternalTool.Extras/InputBind.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,64 @@ | ||
using Nucs.JsonSettings; | ||
using Nucs.JsonSettings.Modulation; | ||
using System; | ||
using System.Collections.ObjectModel; | ||
using System.Windows.Forms; | ||
|
||
namespace SHME.ExternalTool.Extras | ||
{ | ||
public static class DefaultLocalSettings | ||
{ | ||
// This is tough to easily place in either local or roaming settings, | ||
// but local might make slightly more sense? Beyond personal preference, | ||
// whether one prefers to invert could depend on mouse vs. touchpad vs. | ||
// trackball, among other considerations. | ||
public static readonly bool CameraFlyInvert; | ||
|
||
// Different input hardware means different sensitivity. | ||
public static readonly decimal CameraFlySensitivity = 0.25m; | ||
|
||
public static readonly int SaveButton; | ||
|
||
public static readonly Collection<InputBind> FlyBinds = new([ | ||
new(ShmeCommand.Forward, Keys.W, MouseButtons.None), | ||
new(ShmeCommand.Backward, Keys.S, MouseButtons.None), | ||
new(ShmeCommand.Left, Keys.A, MouseButtons.None), | ||
new(ShmeCommand.Right, Keys.D, MouseButtons.None), | ||
new(ShmeCommand.Up, Keys.E, MouseButtons.None), | ||
new(ShmeCommand.Down, Keys.Q, MouseButtons.None)]); | ||
|
||
public static readonly Collection<InputBind> FpsBinds = new([ | ||
new(ShmeCommand.Forward, Keys.W, MouseButtons.None), | ||
new(ShmeCommand.Backward, Keys.S, MouseButtons.None), | ||
new(ShmeCommand.Left, Keys.A, MouseButtons.None), | ||
new(ShmeCommand.Right, Keys.D, MouseButtons.None), | ||
new(ShmeCommand.Action, Keys.E, MouseButtons.Left), | ||
new(ShmeCommand.Aim, Keys.Q, MouseButtons.Right), | ||
new(ShmeCommand.Light, Keys.F, MouseButtons.None), | ||
new(ShmeCommand.Run, Keys.ShiftKey, MouseButtons.None), | ||
new(ShmeCommand.View, Keys.Z, MouseButtons.None), | ||
new(ShmeCommand.Map, Keys.C, MouseButtons.None)]); | ||
} | ||
|
||
// Hiding this class, and RoamingSettings, in a satellite assembly turns out | ||
// to be necessary to prevent BizHawk from failing to load this external | ||
// tool. Being classes derived from bases defined in an external assembly, | ||
// they cause problems the first time BizHawk enumerates its external tools | ||
// directory. Breaking them out to this extra assembly solves that. | ||
public class LocalSettings : JsonSettings, IVersionable | ||
{ | ||
public Version Version { get; set; } = new Version(1, 0, 0, 0); | ||
|
||
public override string FileName { get; set; } = "local.json"; | ||
|
||
// Basics tab | ||
public virtual bool CameraFlyInvert { get; set; } = DefaultLocalSettings.CameraFlyInvert; | ||
public virtual decimal CameraFlySensitivity { get; set; } = DefaultLocalSettings.CameraFlySensitivity; | ||
|
||
public virtual Collection<InputBind> FlyBinds { get; } = []; | ||
public virtual Collection<InputBind> FpsBinds { get; } = []; | ||
|
||
// Save tab | ||
public virtual int SaveButton { get; set; } = DefaultLocalSettings.SaveButton; | ||
} | ||
} |
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,171 @@ | ||
using Nucs.JsonSettings; | ||
using Nucs.JsonSettings.Modulation; | ||
using System; | ||
|
||
namespace SHME.ExternalTool.Extras | ||
{ | ||
public static class DefaultRoamingSettings | ||
{ | ||
// Basics tab | ||
public static readonly bool EnableHarrySection = true; | ||
public static readonly bool EnableOverlay; | ||
|
||
public static readonly decimal CameraFlySpeed = 0.125m; | ||
public static readonly bool HideHarry = true; | ||
public static readonly bool ShowFeet = true; | ||
public static readonly decimal EyeHeight = -1.6m; | ||
public static readonly bool AlwaysRun = true; | ||
|
||
public static readonly bool EnableOverlayCameraReporting; | ||
public static readonly bool ReadLevelDataOnStageLoad; | ||
public static readonly bool RenderToFramebuffer; | ||
public static readonly bool BackfaceCulling; | ||
public static readonly bool FarClipping = true; | ||
public static readonly decimal CrosshairLength = 2.5m; | ||
public static readonly decimal FilledOpacity = 30.0m; | ||
public static readonly int RenderMode; | ||
|
||
// POIs tab | ||
public static readonly bool SelectedTriggerEnableUpdates = true; | ||
public static readonly int PoiRenderShape; | ||
public static readonly bool AxisColorsGame = true; | ||
public static readonly bool AxisColorsOverlay; | ||
public static readonly bool AxisColorsOff; | ||
|
||
// Stats tab | ||
public static readonly bool EnableStatsReporting = true; | ||
|
||
// Fog tab | ||
public static readonly decimal CustomFogR = 108m; | ||
public static readonly decimal CustomFogG = 100m; | ||
public static readonly decimal CustomFogB = 116m; | ||
public static readonly decimal CustomWorldTintR = 121m; | ||
public static readonly decimal CustomWorldTintG = 128m; | ||
public static readonly decimal CustomWorldTintB = 138m; | ||
|
||
// Test tab | ||
public static readonly bool EnableTestModelSection; | ||
public static readonly int TestModelScale = 1000; | ||
public static readonly decimal TestModelX; | ||
public static readonly decimal TestModelY; | ||
public static readonly decimal TestModelZ; | ||
|
||
public static readonly bool EnableTestBox; | ||
public static readonly decimal TestBoxX; | ||
public static readonly decimal TestBoxY; | ||
public static readonly decimal TestBoxZ; | ||
public static readonly decimal TestBoxSizeX = 1m; | ||
public static readonly decimal TestBoxSizeY = 1m; | ||
public static readonly decimal TestBoxSizeZ = 1m; | ||
|
||
public static readonly bool EnableTestLine; | ||
public static readonly decimal TestLineAX; | ||
public static readonly decimal TestLineAY = -1m; | ||
public static readonly decimal TestLineAZ; | ||
public static readonly decimal TestLineBX = 1m; | ||
public static readonly decimal TestLineBY = -1m; | ||
public static readonly decimal TestLineBZ; | ||
|
||
public static readonly bool EnableTestSheet; | ||
public static readonly decimal TestSheetX; | ||
public static readonly decimal TestSheetY; | ||
public static readonly decimal TestSheetZ; | ||
public static readonly decimal TestSheetSizeX = 1m; | ||
public static readonly decimal TestSheetSizeZ = 1m; | ||
|
||
// Framebuffer tab | ||
public static readonly decimal FramebufferOfsX = 0m; | ||
public static readonly decimal FramebufferOfsY = 32m; | ||
public static readonly decimal FramebufferW = 320m; | ||
public static readonly decimal FramebufferH = 448m; | ||
public static readonly int FramebufferZoom = 3; | ||
|
||
// Misc tab | ||
public static readonly bool EnableControllerReporting; | ||
} | ||
|
||
public class RoamingSettings : JsonSettings, IVersionable | ||
{ | ||
public Version Version { get; set; } = new Version(1, 0, 0, 0); | ||
|
||
public override string FileName { get; set; } = "roaming.json"; | ||
|
||
// Basics tab | ||
public virtual bool EnableHarrySection { get; set; } = DefaultRoamingSettings.EnableHarrySection; | ||
public virtual bool EnableOverlay { get; set; } = DefaultRoamingSettings.EnableOverlay; | ||
|
||
public virtual decimal CameraFlySpeed { get; set; } = DefaultRoamingSettings.CameraFlySpeed; | ||
public virtual bool HideHarry { get; set; } = DefaultRoamingSettings.HideHarry; | ||
public virtual bool ShowFeet { get; set; } = DefaultRoamingSettings.ShowFeet; | ||
public virtual decimal EyeHeight { get; set; } = DefaultRoamingSettings.EyeHeight; | ||
public virtual bool AlwaysRun { get; set; } = DefaultRoamingSettings.AlwaysRun; | ||
|
||
public virtual bool EnableOverlayCameraReporting { get; set; } = DefaultRoamingSettings.EnableOverlayCameraReporting; | ||
public virtual bool ReadLevelDataOnStageLoad { get; set; } = DefaultRoamingSettings.ReadLevelDataOnStageLoad; | ||
public virtual bool RenderToFramebuffer { get; set; } = DefaultRoamingSettings.RenderToFramebuffer; | ||
public virtual bool BackfaceCulling { get; set; } = DefaultRoamingSettings.BackfaceCulling; | ||
public virtual bool FarClipping { get; set; } = DefaultRoamingSettings.FarClipping; | ||
public virtual decimal CrosshairLength { get; set; } = DefaultRoamingSettings.CrosshairLength; | ||
public virtual decimal FilledOpacity { get; set; } = DefaultRoamingSettings.FilledOpacity; | ||
public virtual int RenderMode { get; set; } = DefaultRoamingSettings.RenderMode; | ||
|
||
// POIs tab | ||
public virtual bool SelectedTriggerEnableUpdates { get; set; } = DefaultRoamingSettings.SelectedTriggerEnableUpdates; | ||
public virtual int PoiRenderShape { get; set; } = DefaultRoamingSettings.PoiRenderShape; | ||
public virtual bool AxisColorsGame { get; set; } = DefaultRoamingSettings.AxisColorsGame; | ||
public virtual bool AxisColorsOverlay { get; set; } = DefaultRoamingSettings.AxisColorsOverlay; | ||
public virtual bool AxisColorsOff { get; set; } = DefaultRoamingSettings.AxisColorsOff; | ||
|
||
// Stats tab | ||
public virtual bool EnableStatsReporting { get; set; } = DefaultRoamingSettings.EnableStatsReporting; | ||
|
||
// Fog tab | ||
public virtual decimal CustomFogR { get; set; } = DefaultRoamingSettings.CustomFogR; | ||
public virtual decimal CustomFogG { get; set; } = DefaultRoamingSettings.CustomFogG; | ||
public virtual decimal CustomFogB { get; set; } = DefaultRoamingSettings.CustomFogB; | ||
public virtual decimal CustomWorldTintR { get; set; } = DefaultRoamingSettings.CustomWorldTintR; | ||
public virtual decimal CustomWorldTintG { get; set; } = DefaultRoamingSettings.CustomWorldTintG; | ||
public virtual decimal CustomWorldTintB { get; set; } = DefaultRoamingSettings.CustomWorldTintB; | ||
|
||
// Test tab | ||
public virtual bool EnableTestModelSection { get; set; } = DefaultRoamingSettings.EnableTestModelSection; | ||
public virtual int TestModelScale { get; set; } = DefaultRoamingSettings.TestModelScale; | ||
public virtual decimal TestModelX { get; set; } = DefaultRoamingSettings.TestModelX; | ||
public virtual decimal TestModelY { get; set; } = DefaultRoamingSettings.TestModelY; | ||
public virtual decimal TestModelZ { get; set; } = DefaultRoamingSettings.TestModelZ; | ||
|
||
public virtual bool EnableTestBox { get; set; } = DefaultRoamingSettings.EnableTestBox; | ||
public virtual decimal TestBoxX { get; set; } = DefaultRoamingSettings.TestBoxX; | ||
public virtual decimal TestBoxY { get; set; } = DefaultRoamingSettings.TestBoxY; | ||
public virtual decimal TestBoxZ { get; set; } = DefaultRoamingSettings.TestBoxZ; | ||
public virtual decimal TestBoxSizeX { get; set; } = DefaultRoamingSettings.TestBoxSizeX; | ||
public virtual decimal TestBoxSizeY { get; set; } = DefaultRoamingSettings.TestBoxSizeY; | ||
public virtual decimal TestBoxSizeZ { get; set; } = DefaultRoamingSettings.TestBoxSizeZ; | ||
|
||
public virtual bool EnableTestLine { get; set; } = DefaultRoamingSettings.EnableTestLine; | ||
public virtual decimal TestLineAX { get; set; } = DefaultRoamingSettings.TestLineAX; | ||
public virtual decimal TestLineAY { get; set; } = DefaultRoamingSettings.TestLineAY; | ||
public virtual decimal TestLineAZ { get; set; } = DefaultRoamingSettings.TestLineAZ; | ||
public virtual decimal TestLineBX { get; set; } = DefaultRoamingSettings.TestLineBX; | ||
public virtual decimal TestLineBY { get; set; } = DefaultRoamingSettings.TestLineBY; | ||
public virtual decimal TestLineBZ { get; set; } = DefaultRoamingSettings.TestLineBZ; | ||
|
||
|
||
public virtual bool EnableTestSheet { get; set; } = DefaultRoamingSettings.EnableTestSheet; | ||
public virtual decimal TestSheetX { get; set; } = DefaultRoamingSettings.TestSheetX; | ||
public virtual decimal TestSheetY { get; set; } = DefaultRoamingSettings.TestSheetY; | ||
public virtual decimal TestSheetZ { get; set; } = DefaultRoamingSettings.TestSheetZ; | ||
public virtual decimal TestSheetSizeX { get; set; } = DefaultRoamingSettings.TestSheetSizeX; | ||
public virtual decimal TestSheetSizeZ { get; set; } = DefaultRoamingSettings.TestSheetSizeZ; | ||
|
||
// Framebuffer tab | ||
public virtual decimal FramebufferOfsX { get; set; } = DefaultRoamingSettings.FramebufferOfsX; | ||
public virtual decimal FramebufferOfsY { get; set; } = DefaultRoamingSettings.FramebufferOfsY; | ||
public virtual decimal FramebufferW { get; set; } = DefaultRoamingSettings.FramebufferW; | ||
public virtual decimal FramebufferH { get; set; } = DefaultRoamingSettings.FramebufferH; | ||
public virtual int FramebufferZoom { get; set; } = DefaultRoamingSettings.FramebufferZoom; | ||
|
||
// Misc tab | ||
public virtual bool EnableControllerReporting { get; set; } = DefaultRoamingSettings.EnableControllerReporting; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/SHME.ExternalTool.Extras/SHME.ExternalTool.Extras.csproj
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,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<LangVersion>12.0</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<TargetFramework>net48</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||
<PackageReference Include="Nucs.JsonSettings" Version="2.0.2" /> | ||
<PackageReference Include="Nucs.JsonSettings.Autosave" Version="2.0.2" /> | ||
|
||
<Reference Include="System.Windows.Forms" /> | ||
|
||
<ProjectReference Include="..\CustomBuildTasks\CustomBuildTasks.csproj"> | ||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
</ProjectReference> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.