Added config for the dev debug tools

Setup hover UI for the dev window
This commit is contained in:
LadyAliceMargatroid 2024-08-26 21:42:35 -07:00
parent e143d2ad3d
commit b7a70f56d6
15 changed files with 181 additions and 92 deletions

View file

@ -41,8 +41,8 @@ namespace DunGenPlus.DevTools.UIElements.Collections {
public override void CreateEntry(IList list, int index, Transform parentTransform, float layoutOffset) {
var entry = (NodeArchetype)list[index];
DevDebugManager.Instance.CreateStringInputField(parentTransform, new TitleParameter("Label", layoutOffset), entry.label, (t) => entry.label = t);
DevDebugManager.Instance.CreateListUIField(parentTransform, new TitleParameter("Archetypes", layoutOffset), entry.archetypes);
DevDebugManager.Instance.CreateStringInputField(parentTransform, new TitleParameter("Label", NodeArchetype.LabelTooltip, layoutOffset), entry.Label, (t) => entry.Label = t);
DevDebugManager.Instance.CreateListUIField(parentTransform, new TitleParameter("Archetypes", NodeArchetype.ArchetypesTooltip, layoutOffset), entry.Archetypes);
}
}
@ -55,12 +55,12 @@ namespace DunGenPlus.DevTools.UIElements.Collections {
public override void CreateEntry(IList list, int index, Transform parentTransform, float layoutOffset) {
var entry = (ForcedTileSetList)list[index];
DevDebugManager.Instance.CreateFloatInputField(parentTransform, new TitleParameter("Main Path Weight", layoutOffset), entry.MainPathWeight, (t) => entry.MainPathWeight = t);
DevDebugManager.Instance.CreateFloatInputField(parentTransform, new TitleParameter("Branch Path Weight", layoutOffset), entry.BranchPathWeight, (t) => entry.BranchPathWeight = t);
DevDebugManager.Instance.CreateFloatInputField(parentTransform, new TitleParameter("Main Path Weight", ForcedTileSetList.MainPathWeightTooltip, layoutOffset), entry.MainPathWeight, (t) => entry.MainPathWeight = t);
DevDebugManager.Instance.CreateFloatInputField(parentTransform, new TitleParameter("Branch Path Weight", ForcedTileSetList.BranchPathWeightTooltip, layoutOffset), 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(parentTransform, new TitleParameter("Depth Weight Scale", layoutOffset), entry.DepthWeightScale, (t) => entry.DepthWeightScale = t);
DevDebugManager.Instance.CreateListUIField(parentTransform, new TitleParameter("Tile Sets", layoutOffset), entry.Tilesets);
DevDebugManager.Instance.CreateAnimationCurveOptionsUIField(parentTransform, new TitleParameter("Depth Weight Scale", ForcedTileSetList.DepthWeightScaleTooltip, layoutOffset), entry.DepthWeightScale, (t) => entry.DepthWeightScale = t);
DevDebugManager.Instance.CreateListUIField(parentTransform, new TitleParameter("Tile Sets", ForcedTileSetList.TileSetsTooltip, layoutOffset), entry.TileSets);
}
}

View file

@ -23,7 +23,7 @@ namespace DunGenPlus.DevTools.UIElements.Collections {
}
public static implicit operator TitleParameter(string text) => new TitleParameter(text);
public static implicit operator TitleParameter((string text, string hoverText) pair) => new TitleParameter(pair.text, pair.hoverText);
}
internal struct IntParameter {

View file

@ -17,7 +17,7 @@ namespace DunGenPlus.DevTools.UIElements
public void SetupDropdown<T>(TitleParameter titleParameter, int baseValue, Action<T> setAction, Func<int, T> convertIndex, IEnumerable<string> options) {
SetupBase(titleParameter);
var maxLength = (int)Mathf.LerpUnclamped(24f, 20f, layoutOffset / 24f);
var maxLength = (int)Mathf.LerpUnclamped(28f, 24f, layoutOffset / 24f);
dropDown.options = options.Select(c => {
return new TMP_Dropdown.OptionData(c.Substring(0, Math.Min(maxLength, c.Length)));
}).ToList();