Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from KisaragiEffective/fix/not-working
Browse files Browse the repository at this point in the history
  • Loading branch information
KisaragiEffective authored Nov 2, 2022
2 parents c28cd35 + 262fa42 commit a032e0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
39 changes: 2 additions & 37 deletions EnableSitModeOnLaunch/EnableSitModeOnLaunch.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using FrooxEngine;
using FrooxEngine.UIX;
using HarmonyLib;
using JetBrains.Annotations;
using NeosModLoader;

Expand All @@ -13,44 +11,11 @@ public class EnableSitModeOnLaunch : NeosMod
{
public override string Name => "EnableSitModeOnLaunch";
public override string Author => "kisaragi marine";
public override string Version => "0.1.2";
public override string Version => "0.1.3";

public override void OnEngineInit()
{
var harmony = new Harmony("com.github.kisaragieffective.neos.EnableSitModeOnLaunch");
harmony.PatchAll();
Msg("Injected");
}
}

[HarmonyPatch(typeof(SeatedModeFacetPreset), "Build")]
[UsedImplicitly]
internal class Patcher
{
private static bool _first = true;
// ReSharper disable once UnusedParameter.Local
[UsedImplicitly]
private static bool Prefix(Facet facet, Slot root)
{
var ui = new UIBuilder(root);
RadiantUI_Constants.SetupDefaultStyle(ui);
var trackingSpaceSync = root.AttachComponent<UserTrackingSpaceSync>();
if (_first)
{
trackingSpaceSync.SeatedMode.Value = true;
_first = false;
}
// TODO: this should be translated (blocked by local build issue)
ui.Button(NeosAssets.Graphics.Icons.General.ExitAvatarAnchor, (LocaleString) "---").SetupToggle(trackingSpaceSync.SeatedMode, new OptionDescription<bool>
{
spriteUrl = NeosAssets.Graphics.Icons.General.EnterAvatarAnchor,
label = "Options.SeatedMode.On"
}, new OptionDescription<bool>
{
spriteUrl = NeosAssets.Graphics.Icons.General.ExitAvatarAnchor,
label = "Options.SeatedMode.Off"
});
return false; // overwrite behavior
Engine.Current.RunPostInit(() => Engine.Current.InputInterface.SeatedMode = true);
}
}
}
4 changes: 2 additions & 2 deletions EnableSitModeOnLaunch/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.2.0")]
[assembly: AssemblyFileVersion("0.1.2.0")]
[assembly: AssemblyVersion("0.1.3.0")]
[assembly: AssemblyFileVersion("0.1.3.0")]

0 comments on commit a032e0d

Please # to comment.