1
0
Fork 0

Compare commits

...

5 Commits

Author SHA1 Message Date
ivan tkachenko 8a24448cb6 Consistent ordering of Easing functions in C# 2025-12-06 23:26:08 +02:00
ivan tkachenko a74bbfaee2 Add JSON exporter to debug builds 2025-11-23 15:56:58 +02:00
ivan tkachenko ad0a20cc7e Fix consistency of capitalization in csproj 2025-11-11 15:45:42 +02:00
ivan tkachenko 51e578f2da Migrate .sln to modern and simple .slnx 2025-11-10 18:10:21 +02:00
ivan tkachenko 3563fa2b36 Bump version 2025-11-10 18:08:16 +02:00
7 changed files with 113 additions and 22 deletions

View File

@ -1,5 +1,8 @@
# Changelog
## MuzikaGromche 1337.9001.2
## MuzikaGromche 1337.9001.1 - v73 Music louder Edition
- Raised the default audio volume, and added a configuration slider.

View File

@ -1,16 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MuzikaGromche", "MuzikaGromche\MuzikaGromche.csproj", "{72633315-F098-4E09-B32B-9224376CD9A5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{72633315-F098-4E09-B32B-9224376CD9A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{72633315-F098-4E09-B32B-9224376CD9A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72633315-F098-4E09-B32B-9224376CD9A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72633315-F098-4E09-B32B-9224376CD9A5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

3
MuzikaGromche.slnx Normal file
View File

@ -0,0 +1,3 @@
<Solution>
<Project Path="MuzikaGromche/MuzikaGromche.csproj" />
</Solution>

97
MuzikaGromche/Exporter.cs Normal file
View File

@ -0,0 +1,97 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
using UnityEngine;
namespace MuzikaGromche
{
#if DEBUG
// Dumps list of tracks as a JSON on launch.
static class Exporter
{
public static void ExportTracksJSON(ISelectableTrack[] tracks)
{
// Same directory where save files are located:
// C:\Users\user\AppData\LocalLow\ZeekerssRBLX\Lethal Company\
string directory = Application.persistentDataPath;
string fileName = "MuzikaGromcheTracks.json";
string filePath = Path.Join(directory, fileName);
var jsonObject = new Dictionary<string, object>();
var tracksList = new List<object>();
jsonObject["version"] = PluginInfo.PLUGIN_VERSION;
jsonObject["tracks"] = tracksList;
foreach (var (selectableTrack, audioTrack) in SelectTracks(tracks))
{
tracksList.Add(SerializeTrack(selectableTrack, audioTrack));
}
using StreamWriter sw = new(filePath);
using JsonWriter writer = new JsonTextWriter(sw)
{
Formatting = Formatting.Indented,
};
JsonSerializer serializer = new()
{
NullValueHandling = NullValueHandling.Include,
};
serializer.Serialize(writer, jsonObject);
}
private static IEnumerable<(ISelectableTrack selectableTrack, IAudioTrack audioTrack)> SelectTracks(ISelectableTrack[] tracks)
{
foreach (var selectableTrack in tracks)
{
foreach (var audioTrack in selectableTrack.GetTracks())
{
yield return (selectableTrack, audioTrack);
}
}
}
private static Dictionary<string, object?> SerializeTrack(ISelectableTrack selectableTrack, IAudioTrack audioTrack)
{
var obj = new Dictionary<string, object?>
{
["Name"] = audioTrack.Name, // may be different from selectableTrack.Name, if selectable track is a group
["IsExplicit"] = selectableTrack.IsExplicit,
["Language"] = selectableTrack.Language.Full,
["WindUpTimer"] = audioTrack.WindUpTimer,
["Bpm"] = audioTrack.Bpm,
["Beats"] = audioTrack.Beats,
["LoopOffset"] = audioTrack.LoopOffset,
["Ext"] = audioTrack.Ext,
["FileDurationIntro"] = audioTrack.LoadedIntro.length,
["FileDurationLoop"] = audioTrack.LoadedLoop.length,
["FileNameIntro"] = audioTrack.FileNameIntro,
["FileNameLoop"] = audioTrack.FileNameLoop,
["BeatsOffset"] = audioTrack.BeatsOffset,
["FadeOutBeat"] = audioTrack.FadeOutBeat,
["FadeOutDuration"] = audioTrack.FadeOutDuration,
["ColorTransitionIn"] = audioTrack.ColorTransitionIn,
["ColorTransitionOut"] = audioTrack.ColorTransitionOut,
["ColorTransitionEasing"] = audioTrack.ColorTransitionEasing.Name,
["FlickerLightsTimeSeries"] = audioTrack.FlickerLightsTimeSeries,
["Lyrics"] = SerializeTimeSeries(new TimeSeries<string>(audioTrack.LyricsTimeSeries, audioTrack.LyricsLines)),
["DrunknessLoopOffsetTimeSeries"] = SerializeTimeSeries(audioTrack.DrunknessLoopOffsetTimeSeries),
["CondensationLoopOffsetTimeSeries"] = SerializeTimeSeries(audioTrack.CondensationLoopOffsetTimeSeries),
["Palette"] = audioTrack.Palette.Colors.Select(SerializeColor).ToList(),
["GameOverText"] = audioTrack.GameOverText,
};
return obj;
}
private static object SerializeTimeSeries<T>(TimeSeries<T> timeSeries)
{
return timeSeries.Beats.Zip(timeSeries.Values, (one, two) => new object?[] { one, two }).ToList();
}
private static string SerializeColor(Color color)
{
string colorHex = $"#{ColorUtility.ToHtmlStringRGB(color)}";
return colorHex;
}
}
#endif
}

View File

@ -8,7 +8,7 @@
<AssemblyName>Ratijas.MuzikaGromche</AssemblyName>
<Product>Muzika Gromche</Product>
<Description>Add some content to your inverse teleporter experience on Titan!</Description>
<Version>1337.9001.1</Version>
<Version>1337.9001.2</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
@ -52,15 +52,18 @@
<Reference Include="Unity.Netcode.Runtime" Publicize="true" Private="false">
<HintPath>$(LethalCompanyDir)Lethal Company_Data\Managed\Unity.Netcode.Runtime.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro" Publicize="true" Private="False">
<Reference Include="Unity.TextMeshPro" Publicize="true" Private="false">
<HintPath>$(LethalCompanyDir)Lethal Company_Data\Managed\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI" Publicize="true" Private="False">
<Reference Include="UnityEngine.UI" Publicize="true" Private="false">
<HintPath>$(LethalCompanyDir)Lethal Company_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.Core.Runtime" Publicize="true" Private="False">
<Reference Include="Unity.RenderPipelines.Core.Runtime" Publicize="true" Private="false">
<HintPath>$(LethalCompanyDir)Lethal Company_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json" Publicize="false" Private="false">
<HintPath>$(LethalCompanyDir)Lethal Company_Data\Managed\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">

View File

@ -936,6 +936,7 @@ namespace MuzikaGromche
{
track.Debug();
}
Exporter.ExportTracksJSON(Tracks);
#endif
Config = new Config(base.Config);
DiscoBallManager.Load();
@ -991,8 +992,8 @@ namespace MuzikaGromche
public readonly record struct Easing(string Name, Func<float, float> Eval)
{
public static Easing Linear = new("Linear", static x => x);
public static Easing OutCubic = new("OutCubic", static x => 1 - Mathf.Pow(1f - x, 3f));
public static Easing InCubic = new("InCubic", static x => x * x * x);
public static Easing OutCubic = new("OutCubic", static x => 1 - Mathf.Pow(1f - x, 3f));
public static Easing InOutCubic = new("InOutCubic", static x => x < 0.5f ? 4f * x * x * x : 1 - Mathf.Pow(-2f * x + 2f, 3f) / 2f);
public static Easing InExpo = new("InExpo", static x => x == 0f ? 0f : Mathf.Pow(2f, 10f * x - 10f));
public static Easing OutExpo = new("OutExpo", static x => x == 1f ? 1f : 1f - Mathf.Pow(2f, -10f * x));

View File

@ -1,6 +1,6 @@
{
"name": "MuzikaGromche",
"version_number": "1337.9001.1",
"version_number": "1337.9001.2",
"author": "Ratijas",
"description": "Add some content to your inverse teleporter experience on Titan!",
"website_url": "https://git.vilunov.me/ratijas/muzika-gromche",