mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 21:57:37 +02:00
prep auto-population of property menu
This commit is contained in:
@ -9,6 +9,18 @@ namespace HeavenStudio.Editor
|
||||
{
|
||||
public class RemixPropertiesDialog : Dialog
|
||||
{
|
||||
[Header("Editable Properties")]
|
||||
[SerializeField] string[] infoTags;
|
||||
[SerializeField] string[] infoLabels;
|
||||
[SerializeField] string[] flavourTags;
|
||||
[SerializeField] string[] flavourLabels;
|
||||
|
||||
[Header("Containers")]
|
||||
[SerializeField] ChartInfoProperties infoContainer;
|
||||
// [SerializeField] ChartFlavourProperties flavourContainer;
|
||||
|
||||
public DynamicBeatmap chart;
|
||||
|
||||
private void Start() {}
|
||||
|
||||
public void SwitchPropertiesDialog()
|
||||
@ -17,11 +29,46 @@ namespace HeavenStudio.Editor
|
||||
Editor.instance.canSelect = true;
|
||||
Editor.instance.inAuthorativeMenu = false;
|
||||
dialog.SetActive(false);
|
||||
|
||||
CleanDialog();
|
||||
} else {
|
||||
ResetAllDialogs();
|
||||
Editor.instance.canSelect = false;
|
||||
Editor.instance.inAuthorativeMenu = true;
|
||||
dialog.SetActive(true);
|
||||
|
||||
SetupDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupDialog() {
|
||||
chart = GameManager.instance.Beatmap;
|
||||
string[] tags = infoTags;
|
||||
string[] labels = infoLabels;
|
||||
int i = 0;
|
||||
|
||||
foreach (string property in tags) {
|
||||
if (chart.properties.ContainsKey(property)) {
|
||||
infoContainer.AddParam(this, property, chart.properties[property], labels[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (property == "divider")
|
||||
{
|
||||
//TODO: prefab that's just a dividing line
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Property Menu generation Warning: Property " + property + " not found");
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
private void CleanDialog() {
|
||||
foreach (Transform child in dialog.transform) {
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user