2022-09-03 23:10:27 +00:00
|
|
|
using System;
|
2022-08-23 14:56:39 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using HeavenStudio.Editor.Track;
|
|
|
|
|
|
|
|
using TMPro;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Editor
|
|
|
|
{
|
2022-08-27 03:43:01 +00:00
|
|
|
public class RemixPropertiesDialog : Dialog
|
2022-08-23 14:56:39 +00:00
|
|
|
{
|
2022-09-02 00:57:47 +00:00
|
|
|
[Header("Editable Properties")]
|
2022-09-03 23:10:27 +00:00
|
|
|
[SerializeField] PropertyTag[] infoTags;
|
|
|
|
[SerializeField] PropertyTag[] flavourTags;
|
2022-09-02 00:57:47 +00:00
|
|
|
|
|
|
|
[Header("Containers")]
|
|
|
|
[SerializeField] ChartInfoProperties infoContainer;
|
|
|
|
// [SerializeField] ChartFlavourProperties flavourContainer;
|
|
|
|
|
|
|
|
public DynamicBeatmap chart;
|
|
|
|
|
2022-09-03 23:10:27 +00:00
|
|
|
private void Start() { }
|
2022-08-23 14:56:39 +00:00
|
|
|
|
2022-08-27 03:43:01 +00:00
|
|
|
public void SwitchPropertiesDialog()
|
2022-08-23 14:56:39 +00:00
|
|
|
{
|
2022-09-03 23:10:27 +00:00
|
|
|
if (dialog.activeSelf)
|
|
|
|
{
|
2022-08-27 03:43:01 +00:00
|
|
|
Editor.instance.canSelect = true;
|
|
|
|
Editor.instance.inAuthorativeMenu = false;
|
|
|
|
dialog.SetActive(false);
|
2022-09-02 00:57:47 +00:00
|
|
|
|
|
|
|
CleanDialog();
|
2022-09-03 23:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-08-27 03:43:01 +00:00
|
|
|
ResetAllDialogs();
|
|
|
|
Editor.instance.canSelect = false;
|
|
|
|
Editor.instance.inAuthorativeMenu = true;
|
|
|
|
dialog.SetActive(true);
|
2022-09-02 00:57:47 +00:00
|
|
|
|
|
|
|
SetupDialog();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-03 23:10:27 +00:00
|
|
|
private void SetupDialog()
|
|
|
|
{
|
2022-09-02 00:57:47 +00:00
|
|
|
chart = GameManager.instance.Beatmap;
|
2022-09-03 23:10:27 +00:00
|
|
|
PropertyTag[] tags = infoTags;
|
2022-09-02 00:57:47 +00:00
|
|
|
int i = 0;
|
|
|
|
|
2022-09-03 23:10:27 +00:00
|
|
|
foreach (PropertyTag property in tags)
|
|
|
|
{
|
|
|
|
if (chart.properties.ContainsKey(property.tag))
|
|
|
|
{
|
|
|
|
Debug.Log($"Found property: {property.tag} with label {property.label}");
|
|
|
|
infoContainer.AddParam(this, property.tag, chart.properties[property.tag], property.label, property.isReadOnly);
|
2022-09-02 00:57:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-09-03 23:10:27 +00:00
|
|
|
if (property.tag == "divider")
|
2022-09-02 00:57:47 +00:00
|
|
|
{
|
|
|
|
//TODO: prefab that's just a dividing line
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-09-03 23:10:27 +00:00
|
|
|
Debug.LogWarning("Property Menu generation Warning: Property " + property.tag + " not found, skipping...");
|
2022-09-02 00:57:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-03 23:10:27 +00:00
|
|
|
private void CleanDialog() {}
|
2022-08-23 14:56:39 +00:00
|
|
|
|
|
|
|
private void Update() {}
|
2022-09-03 23:10:27 +00:00
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
public class PropertyTag
|
|
|
|
{
|
|
|
|
public string tag;
|
|
|
|
public string label;
|
|
|
|
public bool isReadOnly;
|
|
|
|
}
|
2022-08-23 14:56:39 +00:00
|
|
|
}
|
|
|
|
}
|