-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
update to new api
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace SCHIZO.Interop.Subnautica; | ||
|
||
partial class _JukeboxDisk : JukeboxDisk; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Text; | ||
using Nautilus.Handlers; | ||
using Nautilus.Utility; | ||
using Story; | ||
using UnityEngine; | ||
|
||
namespace SCHIZO.Sounds.Jukebox_; | ||
partial class CustomJukeboxDisk | ||
{ | ||
public CustomJukeboxTrack _track; | ||
public AudioClip unlockSound; | ||
|
||
public new void Start() | ||
{ | ||
if (_track) track = _track; | ||
if (track == default) LOGGER.LogWarning($"Jukebox disk {name} at {transform.position} was not assigned a track"); | ||
|
||
// the lore is that when you pick up a disk, AL-AN plays a snippet of it in your head | ||
if (unlockSound && StoryGoalManager.main!?.GetAlanActor() == Actor.AlAn) | ||
{ | ||
int soundLenHash = unlockSound.samples.GetHashCode(); | ||
int soundNameHash = unlockSound.name.GetHashCode(); | ||
string guid = new StringBuilder(32).Insert(0, $"{soundLenHash:x08}{soundNameHash:x08}", 2).ToString(); | ||
|
||
if (!CustomSoundHandler.TryGetCustomSound(guid, out _)) | ||
CustomSoundHandler.RegisterCustomSound(guid, unlockSound, "bus:/master/SFX_for_pause/PDA_pause/jukebox", AudioUtils.StandardSoundModes_2D); | ||
|
||
acquireSound = AudioUtils.GetFmodAsset(guid); | ||
} | ||
base.Start(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace SCHIZO.Sounds.Jukebox_; | ||
|
||
partial class CustomJukeboxTrack | ||
{ | ||
protected override void Register() | ||
{ | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.