Moved UI settings to MelonPreferences

(I missed two lunches because of this)
This commit is contained in:
SDraw 2022-08-10 15:09:12 +03:00
parent 47298675e0
commit d04cf447fd
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
13 changed files with 595 additions and 320 deletions

View file

@ -71,9 +71,6 @@ namespace ml_fpt
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowLine(false);
CVR_InteractableManager.enableInteractions = true;
if(PlayerSetup.Instance._avatar.GetComponent<ABI.CCK.Components.CVRAvatar>().avatarUsesAdvancedSettings)
PlayerSetup.Instance.LoadCurrentAvatarSettingsDefault();
Reset();
ShowHudNotification("Calibration completed");
@ -92,7 +89,7 @@ namespace ml_fpt
ViewManager.Instance.gameMenuView.Listener.ReadyForBindings += () =>
{
ViewManager.Instance.gameMenuView.View.RegisterForEvent("MelonMod_Action_FPT_Calibrate", new System.Action(this.StartCalibration));
ViewManager.Instance.gameMenuView.View.RegisterForEvent("MelonMod_FPT_Action_Calibrate", new System.Action(this.StartCalibration));
};
ViewManager.Instance.gameMenuView.Listener.FinishLoad += (_) =>

View file

@ -1,10 +1,10 @@
using System.Reflection;
[assembly: AssemblyTitle("FourPointTracking")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: MelonLoader.MelonInfo(typeof(ml_fpt.FourPointTracking), "FourPointTracking", "1.0.0", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonInfo(typeof(ml_fpt.FourPointTracking), "FourPointTracking", "1.0.1", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]

View file

@ -14,7 +14,7 @@ namespace ml_fpt
try
{
Stream l_libraryStream = l_assembly.GetManifestResourceStream(l_assemblyName + "." + p_name);
Stream l_libraryStream = l_assembly.GetManifestResourceStream(l_assemblyName + ".resources." + p_name);
StreamReader l_streadReader = new StreamReader(l_libraryStream);
l_result = l_streadReader.ReadToEnd();
}

View file

@ -1,6 +0,0 @@
var l_block = document.createElement("fpt_block");
l_block.innerHTML = `
<h2>4-Point Tracking</h2>
<div class="action-btn" onclick="engine.trigger('MelonMod_Action_FPT_Calibrate');"><img src=\"gfx/recalibrate.svg\">Calibrate</div>
`;
document.getElementById('settings-implementation').appendChild(l_block);

View file

@ -84,7 +84,7 @@
<Compile Include="Scripts.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="menu.js" />
<EmbeddedResource Include="resources\menu.js" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>

8
ml_fpt/resources/menu.js Normal file
View file

@ -0,0 +1,8 @@
{
var l_block = document.createElement('div');
l_block.innerHTML = `
<h2>4-Point Tracking</h2>
<div class ="action-btn" onclick="engine.trigger('MelonMod_FPT_Action_Calibrate');"><img src="gfx/recalibrate.svg">Calibrate</div>
`;
document.getElementById('settings-implementation').appendChild(l_block);
}