mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
touch up limits
This commit is contained in:
parent
652348157a
commit
e2121e4535
1 changed files with 13 additions and 12 deletions
|
@ -32,8 +32,8 @@ public class PropUndoButton : MelonMod
|
||||||
public const string sfx_redo = "PropUndo_sfx_redo";
|
public const string sfx_redo = "PropUndo_sfx_redo";
|
||||||
public const string sfx_warn = "PropUndo_sfx_warn";
|
public const string sfx_warn = "PropUndo_sfx_warn";
|
||||||
|
|
||||||
public const int redoHistoryLimit = 5; // amount that can be in history at once
|
public const int redoHistoryLimit = 20; // amount that can be in history at once
|
||||||
public const int redoTimeoutLimit = 60; // seconds
|
public const int redoTimeoutLimit = 120; // seconds
|
||||||
|
|
||||||
public override void OnInitializeMelon()
|
public override void OnInitializeMelon()
|
||||||
{
|
{
|
||||||
|
@ -144,11 +144,7 @@ public class PropUndoButton : MelonMod
|
||||||
// Add the spawned prop to the history of deleted props
|
// Add the spawned prop to the history of deleted props
|
||||||
if (deletedProps.Count >= redoHistoryLimit) deletedProps.RemoveAt(0); // Remove the oldest item
|
if (deletedProps.Count >= redoHistoryLimit) deletedProps.RemoveAt(0); // Remove the oldest item
|
||||||
|
|
||||||
// offset spawn height so game can account for it later
|
DeletedProp deletedProp = new DeletedProp(propData);
|
||||||
Vector3 position = propData.Spawnable.transform.position;
|
|
||||||
position.y -= propData.Spawnable.spawnHeight;
|
|
||||||
|
|
||||||
DeletedProp deletedProp = new DeletedProp(propData.ObjectId, position, propData.Spawnable.transform.rotation);
|
|
||||||
deletedProps.Add(deletedProp);
|
deletedProps.Add(deletedProp);
|
||||||
|
|
||||||
PlayAudioModule(sfx_undo);
|
PlayAudioModule(sfx_undo);
|
||||||
|
@ -298,12 +294,17 @@ public class PropUndoButton : MelonMod
|
||||||
public Quaternion rotation;
|
public Quaternion rotation;
|
||||||
public float timeDeleted;
|
public float timeDeleted;
|
||||||
|
|
||||||
public DeletedProp(string propGuid, Vector3 position, Quaternion rotation)
|
public DeletedProp(CVRSyncHelper.PropData propData)
|
||||||
{
|
{
|
||||||
this.propGuid = propGuid;
|
// Offset spawn height so game can account for it later
|
||||||
|
Transform spawnable = propData.Spawnable.transform;
|
||||||
|
Vector3 position = spawnable.position;
|
||||||
|
position.y -= propData.Spawnable.spawnHeight;
|
||||||
|
|
||||||
|
propGuid = propData.ObjectId;
|
||||||
this.position = position;
|
this.position = position;
|
||||||
this.rotation = rotation;
|
rotation = spawnable.rotation;
|
||||||
this.timeDeleted = Time.time;
|
timeDeleted = Time.time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue