finished rest of DunGenPlus dev panel
This commit is contained in:
parent
fdb1767890
commit
101e2c3904
9 changed files with 256 additions and 82 deletions
|
@ -26,6 +26,7 @@ namespace DunGenPlus.DevTools.UIElements {
|
|||
private void SetValue(Action<int> setAction, float value) {
|
||||
Plugin.logger.LogInfo($"Setting {title} to {value}");
|
||||
setAction.Invoke((int)value);
|
||||
textMesh.text = value.ToString();
|
||||
}
|
||||
|
||||
public override void Set(int value){
|
||||
|
|
|
@ -37,10 +37,14 @@ namespace DunGenPlus.DevTools.UIElements {
|
|||
|
||||
public void AddElement() {
|
||||
object item = null;
|
||||
if (listType == typeof(DungeonArchetype)) {
|
||||
if (listType == typeof(DungeonArchetype) || listType == typeof(TileSet)) {
|
||||
item = null;
|
||||
} else if (listType == typeof(NodeArchetype)) {
|
||||
item = new NodeArchetype();
|
||||
} else if (listType == typeof(ForcedTileSetList)){
|
||||
var forcedTileset = new ForcedTileSetList();
|
||||
forcedTileset.DepthWeightScale = null;
|
||||
item = forcedTileset;
|
||||
}
|
||||
|
||||
list.Add(item);
|
||||
|
@ -63,12 +67,28 @@ namespace DunGenPlus.DevTools.UIElements {
|
|||
DevDebugManager.Instance.CreateArchetypeOptionsUIField(copyParentTransform, new TitleParameter("Archetype", layoutOffset + 24f), baseValue, (t) => list[index] = t);
|
||||
}
|
||||
|
||||
else if (listType == typeof(TileSet)){
|
||||
var entry = (TileSet)list[index];
|
||||
var baseValue = DunGenPlusPanel.Instance.selectedAssetCache.tileSets.dictionary[entry];
|
||||
DevDebugManager.Instance.CreateTileSetsOptionsUIField(copyParentTransform, new TitleParameter("Tile Set", layoutOffset + 24f), baseValue, (t) => list[index] = t);
|
||||
}
|
||||
|
||||
else if (listType == typeof(NodeArchetype)) {
|
||||
var entry = (NodeArchetype)list[index];
|
||||
DevDebugManager.Instance.CreateStringInputField(copyParentTransform, new TitleParameter("Label", layoutOffset + 24f), entry.label, (t) => entry.label = t);
|
||||
DevDebugManager.Instance.CreateListUIField(copyParentTransform, new TitleParameter("Archetypes", layoutOffset + 24f), entry.archetypes);
|
||||
}
|
||||
|
||||
else if (listType == typeof(ForcedTileSetList)) {
|
||||
var entry = (ForcedTileSetList)list[index];
|
||||
DevDebugManager.Instance.CreateFloatInputField(copyParentTransform, new TitleParameter("Main Path Weight", layoutOffset + 24f), entry.MainPathWeight, (t) => entry.MainPathWeight = t);
|
||||
DevDebugManager.Instance.CreateFloatInputField(copyParentTransform, new TitleParameter("Branch Path Weight", layoutOffset + 24f), entry.BranchPathWeight, (t) => entry.BranchPathWeight = t);
|
||||
|
||||
// depth is weird cause we have to account for every entry's unique depth curve, even if they don't have one
|
||||
DevDebugManager.Instance.CreateAnimationCurveOptionsUIField(copyParentTransform, new TitleParameter("Depth Weight Scale", layoutOffset + 24f), entry.DepthWeightScale, (t) => entry.DepthWeightScale = t);
|
||||
DevDebugManager.Instance.CreateListUIField(copyParentTransform, new TitleParameter("Tile Sets", layoutOffset + 24f), entry.Tilesets);
|
||||
}
|
||||
|
||||
copy.SetActive(true);
|
||||
}
|
||||
|
||||
|
@ -78,5 +98,7 @@ namespace DunGenPlus.DevTools.UIElements {
|
|||
return copy;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue