Skip to content

Commit

Permalink
fix sn
Browse files Browse the repository at this point in the history
  • Loading branch information
Govorunb committed Dec 4, 2023
1 parent af4a615 commit 05c6807
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@
</relationship>
</object>
<object class="EventMixerGroup" id="{1b3a75e7-cc62-4844-9506-bf9cba0186da}">
<property name="volume">
<value>-22.5</value>
</property>
<property name="name">
<value>Audio 1</value>
</property>
Expand Down
Binary file modified SCHIZO/Resources/FMODBanks/SCHIZO.bank
Binary file not shown.
File renamed without changes.
8 changes: 8 additions & 0 deletions SCHIZO/Subtitles/ActorData.Subnautica.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace SCHIZO.Subtitles;
partial class ActorData
{
protected override void Register()
{
// no actors in SN
}
}
2 changes: 2 additions & 0 deletions SCHIZO/Subtitles/SubtitlesData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ partial class SubtitleLine
{
public string subtitlesKey;
public int index;
#if BELOWZERO
public global::SubtitlesData.Entry ToSubEntry()
{
global::SubtitlesData.Entry entry = new()
Expand All @@ -30,5 +31,6 @@ partial class SubtitleLine
};
return entry;
}
#endif
}
}
14 changes: 8 additions & 6 deletions SCHIZO/Subtitles/SubtitlesHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,46 @@
using Nautilus.Handlers;
using UWE;
using GameSubtitles = Subtitles;
using GameSubtitlesData = SubtitlesData;

namespace SCHIZO.Subtitles;

[HarmonyPatch]
internal static class SubtitlesHandler
{
// compile-time data
// dict key is the subtitle key
// here for debuggability
public static readonly Dictionary<string, SubtitlesData> Subtitles = [];
#if BELOWZERO
// runtime data
public static readonly Dictionary<string, Actor[]> ActorTurns = [];
#endif

public static void Register(SubtitlesData data)
{
Subtitles[data.key] = data;
List<Actor> actors = [];

for (int i = 0; i < data.lines.Count; i++)
{
SubtitlesData.SubtitleLine line = data.lines[i];

actors.Add(line.actor);
LanguageHandler.SetLanguageLine(line.key, line.text);
}
ActorTurns[data.key] = [.. actors];
CoroutineHost.StartCoroutine(RegisterWhenReady(data));
}

private static IEnumerator RegisterWhenReady(SubtitlesData data)
{
#if BELOWZERO
while (!GameSubtitles._main)
yield return null;
GameSubtitles.main.subtitles[data.key] = ActorTurns[data.key];
foreach (SubtitlesData.SubtitleLine line in data.lines)
{
GameSubtitles.main.sounds[line.key] = line.ToSubEntry();
}
ActorTurns[data.key] = data.lines.Select(l => (Actor)l.actor).ToArray();
#else
yield break;
#endif
}

// TODO fix in nautilus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MonoBehaviour:
unlockSprite: {fileID: 0}
isImportantUnlock: 0
scanSounds: {fileID: 0}
encyPathSN:
encyPathSN: DownloadedData/PublicDocs
encyPathBZ: DownloadedData
title: Unknown Transmission #656C6976
texture: {fileID: 0}
Expand Down

0 comments on commit 05c6807

Please sign in to comment.