2022-09-14 05:25:58 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace RimWorldAnimationStudio
|
|
|
|
|
{
|
2022-09-15 05:17:44 +00:00
|
|
|
|
public class Workspace : Singleton<Workspace>
|
2022-09-14 05:25:58 +00:00
|
|
|
|
{
|
2022-09-15 05:17:44 +00:00
|
|
|
|
public static AnimationDef animationDef;
|
|
|
|
|
public static int stageID = 0;
|
|
|
|
|
public static bool isDirty = false;
|
2022-09-14 05:25:58 +00:00
|
|
|
|
|
2022-09-15 05:17:44 +00:00
|
|
|
|
public static List<string> defNames = new List<string>() { "Human" };
|
|
|
|
|
public static List<string> bodyParts = new List<string>() { "Penis", "Vagina", "Anus", "Breasts", "Mouth" };
|
|
|
|
|
public static List<string> bodyDefTypes = new List<string>() { "Human" };
|
|
|
|
|
public static List<string> sexTypes = new List<string>() { "None", "Vaginal", "Anal", "Oral", "Masturbation", "DoublePenetration", "Boobjob", "Handjob", "Footjob", "Fingering", "Scissoring", "MutualMasturbation", "Fisting", "MechImplant", "Rimming", "Fellatio", "Cunnilingus", "Sixtynine" };
|
|
|
|
|
public static List<string> interactionDefTypes = new List<string>();
|
2022-09-14 05:25:58 +00:00
|
|
|
|
|
2022-09-15 05:17:44 +00:00
|
|
|
|
private static List<WorkspaceSnapShot> workspaceHistory = new List<WorkspaceSnapShot>();
|
|
|
|
|
private static int maxHistoryDepth = 100;
|
|
|
|
|
private static int historyIndex = 0;
|
2022-09-14 05:25:58 +00:00
|
|
|
|
|
|
|
|
|
public void TrackChanges()
|
|
|
|
|
{
|
|
|
|
|
if (historyIndex < workspaceHistory.Count - 1)
|
|
|
|
|
{ workspaceHistory.RemoveRange(historyIndex + 1, workspaceHistory.Count - historyIndex); }
|
|
|
|
|
|
|
|
|
|
if (workspaceHistory.Any() && workspaceHistory.Count >= maxHistoryDepth)
|
|
|
|
|
{ workspaceHistory.RemoveAt(0); }
|
|
|
|
|
|
|
|
|
|
WorkspaceSnapShot workspaceSnapShot = new WorkspaceSnapShot();
|
|
|
|
|
workspaceSnapShot.animationDef = animationDef;
|
|
|
|
|
workspaceSnapShot.stageID = stageID;
|
|
|
|
|
|
|
|
|
|
workspaceHistory.Add(workspaceSnapShot);
|
|
|
|
|
|
|
|
|
|
// track bType for actors, stageID, isdirty
|
|
|
|
|
|
|
|
|
|
historyIndex++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Undo()
|
|
|
|
|
{
|
|
|
|
|
historyIndex = Mathf.Clamp(historyIndex - 1, 0, workspaceHistory.Count - 1);
|
|
|
|
|
LoadHistoricState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Redo()
|
|
|
|
|
{
|
|
|
|
|
historyIndex = Mathf.Clamp(historyIndex - 1, 0, workspaceHistory.Count - 1);
|
|
|
|
|
LoadHistoricState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void LoadHistoricState()
|
|
|
|
|
{
|
|
|
|
|
animationDef = workspaceHistory[historyIndex].animationDef;
|
|
|
|
|
|
|
|
|
|
// All other data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|