mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:47:37 +02:00
start implementation of new format
needs fixes for some types
This commit is contained in:
@ -127,7 +127,7 @@ namespace HeavenStudio.Editor.Commands
|
||||
deletedObj = eventObj;
|
||||
Selections.instance.Deselect(eventObj);
|
||||
Timeline.instance.DestroyEventObject(eventObj.entity);
|
||||
// Beatmap.Entity e = deletedObjs[i].entity;
|
||||
// DynamicBeatmap.DynamicEntity e = deletedObjs[i].entity;
|
||||
// Timeline.instance.AddEventObject(e.datamodel, false, new Vector3(e.beat, -e.track * Timeline.instance.LayerHeight()), e, true, e.eventObj.eventObjID);
|
||||
}
|
||||
}
|
||||
@ -166,7 +166,7 @@ namespace HeavenStudio.Editor.Commands
|
||||
{
|
||||
for (int i = 0; i < deletedObjs.Count; i++)
|
||||
{
|
||||
Beatmap.Entity e = deletedObjs[i].entity;
|
||||
DynamicBeatmap.DynamicEntity e = deletedObjs[i].entity;
|
||||
eventObjs[i] = Timeline.instance.AddEventObject(e.datamodel, false, new Vector3(e.beat, -e.track * Timeline.instance.LayerHeight()), e, true, e.eventObj.eventObjID);
|
||||
}
|
||||
}
|
||||
@ -190,7 +190,7 @@ namespace HeavenStudio.Editor.Commands
|
||||
{
|
||||
for (int i = 0; i < copiedObjs.Count; i++)
|
||||
{
|
||||
Beatmap.Entity e = copiedObjs[i].entity;
|
||||
DynamicBeatmap.DynamicEntity e = copiedObjs[i].entity;
|
||||
eventObjs[i] = Timeline.instance.AddEventObject(e.datamodel, false, new Vector3(e.beat, -e.track * Timeline.instance.LayerHeight()), e, true, e.eventObj.eventObjID);
|
||||
}
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ namespace HeavenStudio.Editor
|
||||
{
|
||||
var extensions = new[]
|
||||
{
|
||||
new ExtensionFilter("Heaven Studio Remix File", "tengoku")
|
||||
new ExtensionFilter("Heaven Studio Remix File", "riq")
|
||||
};
|
||||
|
||||
StandaloneFileBrowser.SaveFilePanelAsync("Save Remix As", "", "remix_level", extensions, (string path) =>
|
||||
@ -380,9 +380,9 @@ namespace HeavenStudio.Editor
|
||||
LoadRemix("");
|
||||
}
|
||||
|
||||
public void LoadRemix(string json = "")
|
||||
public void LoadRemix(string json = "", string type = "riq")
|
||||
{
|
||||
GameManager.instance.LoadRemix(json);
|
||||
GameManager.instance.LoadRemix(json, type);
|
||||
Timeline.instance.LoadRemix();
|
||||
Timeline.instance.TempoInfo.UpdateStartingBPMText();
|
||||
Timeline.instance.VolumeInfo.UpdateStartingVolumeText();
|
||||
@ -396,7 +396,8 @@ namespace HeavenStudio.Editor
|
||||
{
|
||||
var extensions = new[]
|
||||
{
|
||||
new ExtensionFilter("Heaven Studio Remix File", new string[] { "tengoku", "rhmania" })
|
||||
new ExtensionFilter("Heaven Studio Remix File", new string[] { "riq" }),
|
||||
new ExtensionFilter("Legacy Heaven Studio Remix", new string[] { "tengoku", "rhmania" })
|
||||
};
|
||||
|
||||
StandaloneFileBrowser.OpenFilePanelAsync("Open Remix", "", extensions, false, (string[] paths) =>
|
||||
@ -405,6 +406,7 @@ namespace HeavenStudio.Editor
|
||||
|
||||
if (path == string.Empty) return;
|
||||
loadedMusic = false;
|
||||
string extension = path.GetExtension();
|
||||
|
||||
using var zipFile = File.Open(path, FileMode.Open);
|
||||
using var archive = new ZipArchive(zipFile, ZipArchiveMode.Read);
|
||||
@ -416,7 +418,7 @@ namespace HeavenStudio.Editor
|
||||
{
|
||||
using var stream = entry.Open();
|
||||
using var reader = new StreamReader(stream);
|
||||
LoadRemix(reader.ReadToEnd());
|
||||
LoadRemix(reader.ReadToEnd(), extension);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -435,7 +437,10 @@ namespace HeavenStudio.Editor
|
||||
}
|
||||
|
||||
if (!loadedMusic)
|
||||
{
|
||||
Conductor.instance.musicSource.clip = null;
|
||||
MusicBytes = null;
|
||||
}
|
||||
|
||||
currentRemixPath = path;
|
||||
remixName = Path.GetFileName(path);
|
||||
|
@ -20,7 +20,7 @@ namespace HeavenStudio.Editor
|
||||
[SerializeField] private GameObject ColorP;
|
||||
[SerializeField] private GameObject StringP;
|
||||
|
||||
public Beatmap.Entity entity;
|
||||
public DynamicBeatmap.DynamicEntity entity;
|
||||
|
||||
public bool active;
|
||||
|
||||
@ -61,13 +61,13 @@ namespace HeavenStudio.Editor
|
||||
Editor.instance.SetGameEventTitle($"Select game event for {gridGameSelector.SelectedMinigame.Replace("\n", "")}");
|
||||
}
|
||||
|
||||
public void StartParams(Beatmap.Entity entity)
|
||||
public void StartParams(DynamicBeatmap.DynamicEntity entity)
|
||||
{
|
||||
active = true;
|
||||
AddParams(entity);
|
||||
}
|
||||
|
||||
private void AddParams(Beatmap.Entity entity)
|
||||
private void AddParams(DynamicBeatmap.DynamicEntity entity)
|
||||
{
|
||||
var minigame = EventCaller.instance.GetMinigame(entity.datamodel.Split(0));
|
||||
int actionIndex = minigame.actions.IndexOf(minigame.actions.Find(c => c.actionName == entity.datamodel.Split(1)));
|
||||
@ -118,7 +118,7 @@ namespace HeavenStudio.Editor
|
||||
{
|
||||
prefab = DropdownP;
|
||||
}
|
||||
else if (objType == typeof(Color))
|
||||
else if (objType == typeof(Color) || objType == typeof(EntityTypes.SerializableColor))
|
||||
{
|
||||
prefab = ColorP;
|
||||
}
|
||||
|
@ -121,10 +121,11 @@ namespace HeavenStudio.Editor
|
||||
break;
|
||||
|
||||
case Color _:
|
||||
case EntityTypes.SerializableColor _:
|
||||
colorPreview.colorPicker.onColorChanged += _ =>
|
||||
parameterManager.entity[propertyName] = colorPreview.colorPicker.color;
|
||||
|
||||
var paramCol = (Color) parameterManager.entity[propertyName];
|
||||
Color paramCol = parameterManager.entity[propertyName];
|
||||
|
||||
ColorBTN.onClick.AddListener(
|
||||
() =>
|
||||
|
@ -29,7 +29,7 @@ namespace HeavenStudio.Editor.Track
|
||||
|
||||
for (int i = 0; i < GameManager.instance.Beatmap.tempoChanges.Count; i++)
|
||||
{
|
||||
Beatmap.TempoChange tempoChange = GameManager.instance.Beatmap.tempoChanges[i];
|
||||
DynamicBeatmap.TempoChange tempoChange = GameManager.instance.Beatmap.tempoChanges[i];
|
||||
AddTempoChange(false, tempoChange);
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ namespace HeavenStudio.Editor.Track
|
||||
tempoTimelineObjs.Clear();
|
||||
}
|
||||
|
||||
public void AddTempoChange(bool create, Beatmap.TempoChange tempoChange_ = null)
|
||||
public void AddTempoChange(bool create, DynamicBeatmap.TempoChange tempoChange_ = null)
|
||||
{
|
||||
GameObject tempoChange = Instantiate(RefTempoChange.gameObject, this.transform);
|
||||
|
||||
@ -157,7 +157,7 @@ namespace HeavenStudio.Editor.Track
|
||||
tempoChange.transform.position = new Vector3(Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition).x + 0.08f, tempoChange.transform.position.y);
|
||||
tempoChange.transform.localPosition = new Vector3(Starpelly.Mathp.Round2Nearest(tempoChange.transform.localPosition.x, Timeline.SnapInterval()), tempoChange.transform.localPosition.y);
|
||||
|
||||
Beatmap.TempoChange tempoC = new Beatmap.TempoChange();
|
||||
DynamicBeatmap.TempoChange tempoC = new DynamicBeatmap.TempoChange();
|
||||
tempoC.beat = tempoChange.transform.localPosition.x;
|
||||
tempoC.tempo = GameManager.instance.Beatmap.bpm;
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace HeavenStudio.Editor.Track
|
||||
[SerializeField] private TMP_Text tempoTXT;
|
||||
[SerializeField] private RectTransform raycastRect;
|
||||
|
||||
public Beatmap.TempoChange tempoChange;
|
||||
public DynamicBeatmap.TempoChange tempoChange;
|
||||
|
||||
private float startPosX;
|
||||
private bool moving = false;
|
||||
|
@ -503,7 +503,7 @@ namespace HeavenStudio.Editor.Track
|
||||
|
||||
#region Functions
|
||||
|
||||
public TimelineEventObj AddEventObject(string eventName, bool dragNDrop = false, Vector3 pos = new Vector3(), Beatmap.Entity entity = null, bool addEvent = false, string eventId = "")
|
||||
public TimelineEventObj AddEventObject(string eventName, bool dragNDrop = false, Vector3 pos = new Vector3(), DynamicBeatmap.DynamicEntity entity = null, bool addEvent = false, string eventId = "")
|
||||
{
|
||||
var game = EventCaller.instance.GetMinigame(eventName.Split(0));
|
||||
var action = EventCaller.instance.GetGameAction(game, eventName.Split(1));
|
||||
@ -561,11 +561,11 @@ namespace HeavenStudio.Editor.Track
|
||||
|
||||
if (addEvent)
|
||||
{
|
||||
Beatmap.Entity tempEntity = entity;
|
||||
DynamicBeatmap.DynamicEntity tempEntity = entity;
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
Beatmap.Entity en = new Beatmap.Entity();
|
||||
DynamicBeatmap.DynamicEntity en = new DynamicBeatmap.DynamicEntity();
|
||||
en.datamodel = eventName;
|
||||
en.eventObj = eventObj;
|
||||
|
||||
@ -592,8 +592,17 @@ namespace HeavenStudio.Editor.Track
|
||||
{
|
||||
returnVal = ((EntityTypes.Float)ep[i].parameter).val;
|
||||
}
|
||||
else if (propertyType == typeof(Color))
|
||||
{
|
||||
returnVal = new EntityTypes.SerializableColor{ Color = (Color)ep[i].parameter };
|
||||
}
|
||||
else if (propertyType.IsEnum)
|
||||
{
|
||||
returnVal = (int) ep[i].parameter;
|
||||
}
|
||||
|
||||
tempEntity[ep[i].propertyName] = returnVal;
|
||||
//tempEntity[ep[i].propertyName] = returnVal;
|
||||
tempEntity.CreateProperty(ep[i].propertyName, returnVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -614,7 +623,7 @@ namespace HeavenStudio.Editor.Track
|
||||
private List<TimelineEventObj> duplicatedEventObjs = new List<TimelineEventObj>();
|
||||
public TimelineEventObj CopyEventObject(TimelineEventObj e)
|
||||
{
|
||||
Beatmap.Entity clone = e.entity.DeepCopy();
|
||||
DynamicBeatmap.DynamicEntity clone = e.entity.DeepCopy();
|
||||
TimelineEventObj dup = AddEventObject(clone.datamodel, false, new Vector3(clone.beat, -clone.track * Timeline.instance.LayerHeight()), clone, true, RandomID());
|
||||
duplicatedEventObjs.Add(dup);
|
||||
|
||||
@ -627,7 +636,7 @@ namespace HeavenStudio.Editor.Track
|
||||
duplicatedEventObjs = new List<TimelineEventObj>();
|
||||
}
|
||||
|
||||
public void DestroyEventObject(Beatmap.Entity entity)
|
||||
public void DestroyEventObject(DynamicBeatmap.DynamicEntity entity)
|
||||
{
|
||||
if (EventParameterManager.instance.entity == entity)
|
||||
EventParameterManager.instance.Disable();
|
||||
|
@ -29,7 +29,7 @@ namespace HeavenStudio.Editor.Track
|
||||
// private GameObject moveTemp;
|
||||
|
||||
[Header("Properties")]
|
||||
public Beatmap.Entity entity;
|
||||
public DynamicBeatmap.DynamicEntity entity;
|
||||
public float length;
|
||||
public bool eligibleToMove = false;
|
||||
private bool lastVisible;
|
||||
|
@ -15,7 +15,7 @@ namespace HeavenStudio.Editor.Track
|
||||
[SerializeField] private TMP_Text volumeTXT;
|
||||
[SerializeField] private RectTransform raycastRect;
|
||||
|
||||
public Beatmap.VolumeChange volumeChange;
|
||||
public DynamicBeatmap.VolumeChange volumeChange;
|
||||
|
||||
private float startPosX;
|
||||
private bool moving = false;
|
||||
|
Reference in New Issue
Block a user