Compare commits
7 Commits
aba0f6bab5
...
140244a6e2
Author | SHA1 | Date |
---|---|---|
|
140244a6e2 | |
|
32dfeb79ab | |
|
2457d3806c | |
|
94cb3eecde | |
|
c8f1ba90e3 | |
|
eea59ca19f | |
|
b9f6bcce9d |
|
@ -485,6 +485,7 @@ $RECYCLE.BIN/
|
|||
|
||||
# Override *.user rule for templates
|
||||
!*.template.props.user
|
||||
!*.template.just.user
|
||||
|
||||
riderModule.iml
|
||||
dist/
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
import? 'MuzikaGromche.just.user'
|
||||
|
||||
build: build-debug build-release
|
||||
|
||||
build-release:
|
||||
dotnet build --configuration Release
|
||||
|
||||
build-debug:
|
||||
dotnet build --configuration Debug
|
||||
|
||||
clean:
|
||||
rm -rf dist MuzikaGromche/bin MuzikaGromche/obj
|
||||
|
||||
plugin_dir := "$HOME/.config/r2modmanPlus-local/LethalCompany/profiles" / imperium_profile / "BepInEx/plugins/Oflor-MuzikaGromche/"
|
||||
|
||||
install-imperium:
|
||||
rm -rf "{{ plugin_dir }}"
|
||||
mkdir "{{ plugin_dir }}"
|
||||
unzip -q dist/MuzikaGromche-Debug.zip -d "{{ plugin_dir }}"
|
||||
|
||||
run-imperium:
|
||||
DRI_PRIME=1 steam -applaunch 1966720 --doorstop-enable true --doorstop-target "Z:$HOME/.config/r2modmanPlus-local/LethalCompany/profiles/{{ imperium_profile }}/BepInEx/core/BepInEx.Preloader.dll" --r2profile "{{ imperium_profile }}"
|
||||
|
||||
bump version_number:
|
||||
[[ "v{{ version_number }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || (echo "Invalid version format" && exit 1)
|
||||
jq --indent 4 --arg v "{{ version_number }}" '.version_number = $v' < manifest.json > manifest.json.copy
|
||||
mv manifest.json.copy manifest.json
|
||||
sed -i 's/<Version>.*<\/Version>/<Version>{{ version_number }}<\/Version>/' MuzikaGromche/MuzikaGromche.csproj
|
|
@ -0,0 +1,3 @@
|
|||
# Copy me to MuzikaGromche.just.user and adjust tasks to your workflow
|
||||
|
||||
imperium_profile := "Muzika Gromche with Imperium"
|
|
@ -1,10 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<AssemblyName>MuzikaGromche</AssemblyName>
|
||||
<Description>Opa che tut u nas</Description>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>13.37.6</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
@ -32,4 +32,39 @@
|
|||
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Bundle" AfterTargets="Build">
|
||||
<PropertyGroup>
|
||||
<DistDir>$(TargetDir)MuzikaGromche\</DistDir>
|
||||
<ZipBundle>$(TargetDir)MuzikaGromche-$(Configuration).zip</ZipBundle>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackagedResources Include="$(SolutionDir)README.md" />
|
||||
<PackagedResources Include="$(SolutionDir)icon.png" />
|
||||
<PackagedResources Include="$(SolutionDir)manifest.json" />
|
||||
<PackagedResources Include="$(TargetDir)MuzikaGromche.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AudioFiles Include="$(SolutionDir)Assets\*.mp3" />
|
||||
<AudioFiles Include="$(SolutionDir)Assets\*.ogg" />
|
||||
<AudioFiles Include="$(SolutionDir)Assets\*.wav" />
|
||||
</ItemGroup>
|
||||
|
||||
<RemoveDir Directories="$(DistDir)" />
|
||||
<Copy
|
||||
SourceFiles="@(AudioFiles);@(PackagedResources)"
|
||||
DestinationFolder="$(DistDir)"
|
||||
/>
|
||||
<ZipDirectory
|
||||
SourceDirectory="$(DistDir)"
|
||||
DestinationFile="$(TargetDir)MuzikaGromche-$(Configuration).zip"
|
||||
Overwrite="true"
|
||||
/>
|
||||
<Copy
|
||||
SourceFiles="$(ZipBundle)"
|
||||
DestinationFolder="$(SolutionDir)dist\"
|
||||
/>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -63,7 +63,8 @@ namespace MuzikaGromche
|
|||
|
||||
public static void StopLightSwitching(MonoBehaviour __instance)
|
||||
{
|
||||
if (JesterLightSwitching != null) {
|
||||
if (JesterLightSwitching != null)
|
||||
{
|
||||
__instance.StopCoroutine(JesterLightSwitching);
|
||||
JesterLightSwitching = null;
|
||||
}
|
||||
|
@ -95,9 +96,12 @@ namespace MuzikaGromche
|
|||
Debug.Log("Chose color " + color);
|
||||
SetLightColor(color);
|
||||
i = (i + 1) % colors.Count;
|
||||
if (CurrentTrack != null) {
|
||||
if (CurrentTrack != null)
|
||||
{
|
||||
yield return new WaitForSeconds(60f / CurrentTrack.Bpm);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +111,8 @@ namespace MuzikaGromche
|
|||
{
|
||||
string text = Info.Location.TrimEnd((PluginInfo.PLUGIN_NAME + ".dll").ToCharArray());
|
||||
UnityWebRequest[] requests = new UnityWebRequest[Tracks.Length * 2];
|
||||
for (int i = 0; i < Tracks.Length; i++) {
|
||||
for (int i = 0; i < Tracks.Length; i++)
|
||||
{
|
||||
Track track = Tracks[i];
|
||||
requests[i * 2] = UnityWebRequestMultimedia.GetAudioClip($"File://{text}{track.FileNameStart}", track.AudioType);
|
||||
requests[i * 2 + 1] = UnityWebRequestMultimedia.GetAudioClip($"File://{text}{track.FileNameLoop}", track.AudioType);
|
||||
|
@ -117,14 +122,18 @@ namespace MuzikaGromche
|
|||
|
||||
while (!requests.All(request => request.isDone)) { }
|
||||
|
||||
if (requests.All(request => request.result == UnityWebRequest.Result.Success)) {
|
||||
for (int i = 0; i < Tracks.Length; i++) {
|
||||
if (requests.All(request => request.result == UnityWebRequest.Result.Success))
|
||||
{
|
||||
for (int i = 0; i < Tracks.Length; i++)
|
||||
{
|
||||
Track track = Tracks[i];
|
||||
track.LoadedStart = DownloadHandlerAudioClip.GetContent(requests[i * 2]);
|
||||
track.LoadedLoop = DownloadHandlerAudioClip.GetContent(requests[i * 2 + 1]);
|
||||
}
|
||||
new Harmony(PluginInfo.PLUGIN_NAME).PatchAll(typeof(JesterPatch));
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogError("Could not load audio file");
|
||||
}
|
||||
}
|
||||
|
@ -175,9 +184,12 @@ namespace MuzikaGromche
|
|||
[HarmonyPrefix]
|
||||
public static void DoNotStopTheMusicPrefix(JesterAI __instance, out State __state)
|
||||
{
|
||||
__state = new State();
|
||||
__state.prevStateindex = __instance.previousState;
|
||||
if (__instance.currentBehaviourStateIndex == 2 && __instance.previousBehaviourStateIndex != 2) {
|
||||
__state = new State
|
||||
{
|
||||
previousState = __instance.previousState
|
||||
};
|
||||
if (__instance.currentBehaviourStateIndex == 2 && __instance.previousState != 2)
|
||||
{
|
||||
// if just popped out
|
||||
// then override farAudio so that vanilla logic does not stop the music
|
||||
__state.farAudio = __instance.farAudio;
|
||||
|
@ -194,7 +206,7 @@ namespace MuzikaGromche
|
|||
__instance.farAudio = __state.farAudio;
|
||||
}
|
||||
|
||||
if (__instance.currentBehaviourStateIndex is 1 && __state.prevStateindex != 1)
|
||||
if (__instance.previousState == 1 && __state.previousState != 1)
|
||||
{
|
||||
// if just started winding up
|
||||
// then stop the default music...
|
||||
|
@ -224,19 +236,19 @@ namespace MuzikaGromche
|
|||
__instance.farAudio.Play();
|
||||
}
|
||||
|
||||
if (__instance.currentBehaviourStateIndex is 2 && __state.prevStateindex != 2)
|
||||
if (__instance.previousState == 2 && __state.previousState != 2)
|
||||
{
|
||||
__instance.creatureVoice.Stop();
|
||||
Plugin.StartLightSwitching(__instance);
|
||||
}
|
||||
|
||||
if (__instance.currentBehaviourStateIndex != 2 && __state.prevStateindex == 2)
|
||||
if (__instance.previousState != 2 && __state.previousState == 2)
|
||||
{
|
||||
Plugin.StopLightSwitching(__instance);
|
||||
Plugin.ResetLightColor();
|
||||
}
|
||||
|
||||
if (__instance.currentBehaviourStateIndex is 2 && !__instance.creatureVoice.isPlaying)
|
||||
if (__instance.previousState == 2 && !__instance.creatureVoice.isPlaying)
|
||||
{
|
||||
__instance.creatureVoice.maxDistance = 150;
|
||||
__instance.creatureVoice.clip = Plugin.CurrentTrack.LoadedLoop;
|
||||
|
@ -252,6 +264,6 @@ namespace MuzikaGromche
|
|||
internal class State
|
||||
{
|
||||
public AudioSource farAudio;
|
||||
public int prevStateindex;
|
||||
public int previousState;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue