mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-01 22:09:23 +00:00
fixed warn/deny sound usage, enabled sfx by default again
This commit is contained in:
parent
cbcbb9f288
commit
b1749af6ca
2 changed files with 14 additions and 15 deletions
|
@ -23,7 +23,7 @@ public class PropUndoButton : MelonMod
|
|||
Category.CreateEntry("Enabled", true, description: "Toggle Undo Prop Button.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryUseSFX =
|
||||
Category.CreateEntry("Use SFX", false, description: "Toggle audio queues for prop spawn, undo, redo, or warning.");
|
||||
Category.CreateEntry("Use SFX", true, description: "Toggle audio queues for prop spawn, undo, redo, and warning.");
|
||||
|
||||
// audio clip names, InterfaceAudio adds "PropUndo_" prefix
|
||||
public const string sfx_spawn = "PropUndo_sfx_spawn";
|
||||
|
@ -123,7 +123,7 @@ public class PropUndoButton : MelonMod
|
|||
|
||||
if (!IsPropSpawnAllowed() || IsAtPropLimit())
|
||||
{
|
||||
PlayAudioModule(sfx_warn);
|
||||
PlayAudioModule(sfx_deny);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -187,32 +187,32 @@ public class PropUndoButton : MelonMod
|
|||
public static void RedoProp()
|
||||
{
|
||||
int index = deletedProps.Count - 1;
|
||||
if (index < 0 || index >= deletedProps.Count || IsAtPropLimit())
|
||||
if (index < 0)
|
||||
{
|
||||
PlayAudioModule(sfx_warn);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsPropSpawnAllowed() || IsAtPropLimit())
|
||||
{
|
||||
PlayAudioModule(sfx_deny);
|
||||
return;
|
||||
}
|
||||
|
||||
// only allow redo of prop spawned in last minute
|
||||
DeletedProp deletedProp = deletedProps[index];
|
||||
if (Time.time - deletedProp.timeDeleted <= redoTimeoutLimit)
|
||||
{
|
||||
if (AttemptRedoProp(deletedProp.propGuid, deletedProp.position, deletedProp.rotation))
|
||||
{
|
||||
deletedProps.RemoveAt(index);
|
||||
PlayAudioModule(sfx_redo);
|
||||
return;
|
||||
}
|
||||
SendRedoProp(deletedProp.propGuid, deletedProp.position, deletedProp.rotation);
|
||||
PlayAudioModule(sfx_redo);
|
||||
}
|
||||
|
||||
PlayAudioModule(sfx_warn);
|
||||
deletedProps.RemoveAt(index);
|
||||
}
|
||||
|
||||
// original spawn prop method does not let you specify rotation
|
||||
public static bool AttemptRedoProp(string propGuid, Vector3 position, Vector3 rotation)
|
||||
public static void SendRedoProp(string propGuid, Vector3 position, Vector3 rotation)
|
||||
{
|
||||
if (!IsPropSpawnAllowed()) return false;
|
||||
|
||||
using (DarkRiftWriter darkRiftWriter = DarkRiftWriter.Create())
|
||||
{
|
||||
darkRiftWriter.Write(propGuid);
|
||||
|
@ -231,7 +231,6 @@ public class PropUndoButton : MelonMod
|
|||
NetworkManager.Instance.GameNetwork.SendMessage(message, SendMode.Reliable);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void PlayAudioModule(string module)
|
||||
|
|
|
@ -18,6 +18,6 @@
|
|||
],
|
||||
"downloadlink": "https://github.com/NotAKidOnSteam/PropUndoButton/releases/download/v1.0.1/PropUndoButton.dll",
|
||||
"sourcelink": "https://github.com/NotAKidOnSteam/PropUndoButton/",
|
||||
"changelog": "- Initial Release\n- Added redo button.\n- Disabled SFX by default.\n- Lowered SFX volume to match existing UI sounds.",
|
||||
"changelog": "- Initial Release\n- Added redo button.\n- Mitigated issue of props getting stuck locally if deleting them before they fully spawn.\n- Lowered SFX volume to match existing UI sounds.",
|
||||
"embedcolor": "#00FFFF"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue