Added UI for DunGenExtender
Made DevOnly fields readonly
This commit is contained in:
parent
894645d85c
commit
32cebc67d6
12 changed files with 295 additions and 41 deletions
137
DunGenPlus/DunGenPlusEditor/DunGenExtenderPropertyDrawer.cs
Normal file
137
DunGenPlus/DunGenPlusEditor/DunGenExtenderPropertyDrawer.cs
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using DunGenPlus;
|
||||
using DunGenPlus.Collections;
|
||||
|
||||
namespace DunGenPlusEditor {
|
||||
|
||||
[CustomPropertyDrawer(typeof(DunGenExtenderProperties))]
|
||||
public class DunGenExtenderPropertiesPropertyDrawer : PropertyDrawer {
|
||||
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
PropertyDrawerUtility.SetupItems(container, property);
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(MainPathProperties))]
|
||||
public class MainPathPropertiesPropertyDrawer : PropertyDrawer {
|
||||
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
|
||||
var box = PropertyDrawerUtility.CreateDropdown(property, "Main Path");
|
||||
PropertyDrawerUtility.SetupItemsMainPathProperty(box.container, property, "MainPathCount", "Generating the default one main path");
|
||||
container.Add(box.parent);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(DungeonBoundsProperties))]
|
||||
public class DungeonBoundsPropertiesPropertyDrawer : PropertyDrawer {
|
||||
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
|
||||
var box = PropertyDrawerUtility.CreateDropdown(property, "Dungeon Bounds");
|
||||
PropertyDrawerUtility.SetupItemsBoolProperty(box.container, property, "UseDungeonBounds", "Disabled");
|
||||
container.Add(box.parent);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(NormalNodeArchetypesProperties))]
|
||||
public class NormalNodeArchetypesPropertiesPropertyDrawer : PropertyDrawer {
|
||||
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
|
||||
var box = PropertyDrawerUtility.CreateDropdown(property, "Normal Nodes Archetypes");
|
||||
PropertyDrawerUtility.SetupItemsBoolProperty(box.container, property, "AddArchetypesToNormalNodes", "Disabled");
|
||||
container.Add(box.parent);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(ForcedTilesProperties))]
|
||||
public class ForcedTilesPropertiesPropertyDrawer : PropertyDrawer {
|
||||
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
|
||||
var box = PropertyDrawerUtility.CreateDropdown(property, "Forced Tiles");
|
||||
PropertyDrawerUtility.SetupItemsBoolProperty(box.container, property, "UseForcedTiles", "Disabled");
|
||||
container.Add(box.parent);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(BranchPathMultiSimulationProperties))]
|
||||
public class BranchPathMultiSimulationPropertiesPropertyDrawer : PropertyDrawer {
|
||||
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
|
||||
var box = PropertyDrawerUtility.CreateDropdown(property, "Branch Path Multi Simulation");
|
||||
PropertyDrawerUtility.SetupItemsBoolProperty(box.container, property, "UseBranchPathMultiSim", "Disabled");
|
||||
container.Add(box.parent);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(LineRandomizerProperties))]
|
||||
public class LineRandomizerPropertiesPropertyDrawer : PropertyDrawer {
|
||||
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
|
||||
var box = PropertyDrawerUtility.CreateDropdown(property, "Line Randomizer");
|
||||
PropertyDrawerUtility.SetupItemsBoolProperty(box.container, property, "UseLineRandomizer", "Disabled");
|
||||
container.Add(box.parent);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(MiscellaneousProperties))]
|
||||
public class MiscellaneousPropertiesPropertyDrawer : PropertyDrawer {
|
||||
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
|
||||
var box = PropertyDrawerUtility.CreateDropdown(property, "Miscellaneous");
|
||||
PropertyDrawerUtility.SetupItems(box.container, property);
|
||||
container.Add(box.parent);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue