diff --git a/DunGenPlus/DunGenPlus/Collections/DunGenExtenderPropertiesCollection.cs b/DunGenPlus/DunGenPlus/Collections/DunGenExtenderPropertiesCollection.cs index 2c01ca0..188076b 100644 --- a/DunGenPlus/DunGenPlus/Collections/DunGenExtenderPropertiesCollection.cs +++ b/DunGenPlus/DunGenPlus/Collections/DunGenExtenderPropertiesCollection.cs @@ -12,12 +12,16 @@ namespace DunGenPlus.Collections { [System.Serializable] public class MainPathProperties { - [Tooltip("The number of main paths.\n\n1 means no additional main paths\n3 means two additional main paths\netc.")] + internal const string MainPathCountTooltip = "The number of main paths.\n\n1 means no additional main paths\n3 means two additional main paths\netc."; + internal const string MainRoomTilePrefabTooltip = "The Tile prefab where the additional main paths will start from.\n\nCannot be null if MainPathCount is more than 1."; + internal const string CopyNodeBehaviourTooltip = "Defines how the nodes list is copied onto the additional main paths.\n\nCopyFromMainPathPosition: nodes will copy based on the MainRoomTilePrefab's position in the main path.\nCopyFromNodeList: nodes will copy based on the MainRoomTilePrefab's position in the node list + 1."; + + [Tooltip(MainPathCountTooltip)] [Range(1, 9)] public int MainPathCount = 1; - [Tooltip("The Tile Prefab where the additional main paths will start from. Cannot be null if MainPathCount is more than 1.")] + [Tooltip(MainRoomTilePrefabTooltip)] public GameObject MainRoomTilePrefab; - [Tooltip("CopyFromMainPathPosition means that nodes will copy from the MainRoomTilePrefab's position in the main path.\n\nCopyFromNodeList means that nodes will copy from the MainRoomTilePrefab's location from the node list + 1.")] + [Tooltip(CopyNodeBehaviourTooltip)] public CopyNodeBehaviour CopyNodeBehaviour = CopyNodeBehaviour.CopyFromMainPathPosition; internal void CopyFrom(MainPathProperties props) { @@ -36,15 +40,21 @@ namespace DunGenPlus.Collections { [System.Serializable] public class DungeonBoundsProperties { - [Tooltip("If enabled, restricts the dungeon's generation to the bounds described below.\n\nThis will help in condensing the dungeon, but it will increase the chance of dungeon generation failure (potentially guarantees failure if the bounds is too small).")] + internal const string UseDungeonBoundsTooltip = "If enabled, restricts the dungeon's generation to the bounds described below.\n\nThis will help in condensing the dungeon, but it will increase the chance of dungeon generation failure (potentially guarantees failure if the bounds is too small)."; + internal const string SizeBaseTooltip = "The base size of the bounds."; + internal const string SizeFactorTooltip = "The factor that's multiplied with the base size AND the dungeon's size. The resulting value is added to the base size of the bounds.\n\n0 means that the bound size is not influenced by the dungeon's size and is therefore a constant."; + internal const string PositionOffsetTooltip = "The base positional offset of the bounds."; + internal const string PositionPivotTooltip = "The pivot of the bounds."; + + [Tooltip(UseDungeonBoundsTooltip)] public bool UseDungeonBounds = false; - [Tooltip("The base size of the bounds.")] + [Tooltip(SizeBaseTooltip)] public Vector3 SizeBase = new Vector3(120f, 40f, 80f); - [Tooltip("The factor that's multiplied with the base size AND the dungeon's size. The resulting value is added to the base size of the bounds.\n\n0 means that the bound size is not influenced by the dungeon's size and is therefore a constant.")] + [Tooltip(SizeFactorTooltip)] public Vector3 SizeFactor = new Vector3(1f, 0.5f, 1f); - [Tooltip("The base positional offset of the bounds.")] + [Tooltip(PositionOffsetTooltip)] public Vector3 PositionOffset = Vector3.zero; - [Tooltip("The pivot of the bounds.")] + [Tooltip(PositionPivotTooltip)] public Vector3 PositionPivot = new Vector3(0.5f, 0.5f, 0.5f); internal void CopyFrom(DungeonBoundsProperties props) { @@ -72,7 +82,9 @@ namespace DunGenPlus.Collections { [System.Serializable] public class NormalNodeArchetypesProperties { - [Tooltip("If enabled, adds archetypes to the normal nodes in the DungeonFlow.\n\nBy default, nodes cannot have branching paths since they don't have archetype references. This allows nodes to have branching paths.")] + internal const string AddArchetypesToNormalNodesTooltip = "If enabled, adds archetypes to the normal nodes in the DungeonFlow.\n\nBy default, nodes cannot have branching paths since they don't have archetype references. This allows nodes to have branching paths."; + + [Tooltip(AddArchetypesToNormalNodesTooltip)] public bool AddArchetypesToNormalNodes = false; public List NormalNodeArchetypes = new List(); internal Dictionary _normalNodeArchetypesDictioanry; @@ -98,22 +110,21 @@ namespace DunGenPlus.Collections { foreach (var n in NormalNodeArchetypes) { - if (_normalNodeArchetypesDictioanry.ContainsKey(n.label)) + if (_normalNodeArchetypesDictioanry.ContainsKey(n.Label)) { - Plugin.logger.LogError($"Label {n.label} already exists. Ignoring latest entry."); + Plugin.logger.LogError($"Label {n.Label} already exists. Ignoring latest entry."); continue; } - _normalNodeArchetypesDictioanry.Add(n.label, n); + _normalNodeArchetypesDictioanry.Add(n.Label, n); - if (string.IsNullOrWhiteSpace(n.label)) + if (string.IsNullOrWhiteSpace(n.Label)) { _defaultNodeArchetype = n; } } } - internal DungeonArchetype GetRandomArchetype(string label, RandomStream randomStream) - { + internal DungeonArchetype GetRandomArchetype(string label, RandomStream randomStream) { NodeArchetype node; if (!_normalNodeArchetypesDictioanry.TryGetValue(label, out node)) { @@ -122,7 +133,7 @@ namespace DunGenPlus.Collections { if (node != null) { - var archetypes = node.archetypes; + var archetypes = node.Archetypes; var count = archetypes.Count; if (count == 0) return null; @@ -138,9 +149,12 @@ namespace DunGenPlus.Collections { [System.Serializable] public class ForcedTilesProperties { - [Tooltip("If enabled, attempts to forcefully spawn tiles from ForcedTileSets after branching paths are generated.\n\nCan only be used if MainPathCount > 1.")] + internal const string UseForcedTilesTooltip = "If enabled, attempts to forcefully spawn tiles from ForcedTileSets after branching paths are generated.\n\nCan only be used if MainPathCount > 1."; + internal const string ForcedTileSetsTooltip = "The list of tiles that will be attempted to forcefully spawn. Each entry will spawn only one tile from it's list.\n\nIf the tile cannot be forcefully spawned, the dungeon generation will not restart."; + + [Tooltip(UseForcedTilesTooltip)] public bool UseForcedTiles = false; - [Tooltip("The list of tiles that will be attempted to forcefully spawn. Each entry will spawn only one tile from it's list.\n\nIf the tile cannot be forcefully spawned, the dungeon generation will not restart.")] + [Tooltip(ForcedTileSetsTooltip)] public List ForcedTileSets = new List(); internal void CopyFrom(ForcedTilesProperties props) { @@ -158,25 +172,46 @@ namespace DunGenPlus.Collections { [System.Serializable] public class BranchPathMultiSimulationProperties { - [Tooltip("If enabled, dungeon generation will simulate a number of branch paths for each branch path, then choose the best branch path based on its weight. The weight is decided by the following criteria. Slows down Branch Path Times by a second or two.")] + internal const string UseBranchPathMultiSimTooltip = "If enabled, dungeon generation will simulate a number of branch paths for each branch path, then choose the best branch path based on its weight. The weight is decided by the following criteria.\n\nCan slow down Branch Path Generation Times by a second or two."; + internal const string SimulationCountTooltip = "The number pf simulations per branch path.\n\nIncreasing this value can increase your chances of finding your best path, but will increase Branch Path Times and vice versa."; + internal const string LengthWeightScaleTooltip = "The weight scale for the branch path's length. The length of the branch path is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize very long branch paths."; + internal const string NormalizedLengthWeightScaleTooltip = "The weight scale for the branch path's normalized length. The normalized length (0 -> 1) of the branch path (PathLength / MaxPathLength) is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who meet their maximum path length."; + + [Tooltip(UseBranchPathMultiSimTooltip)] public bool UseBranchPathMultiSim = false; - [Tooltip("The number pf simulations per branch path.\n\nIncreasing this value can increase your chances of finding your best path, but will increase Branch Path Times and vice versa.")] + [Tooltip(SimulationCountTooltip)] public int SimulationCount = 5; - [Tooltip("The weight scale for the branch path's length. The length of the branch path is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize very long branch paths.")] + + [Space()] + [Tooltip(LengthWeightScaleTooltip)] public float LengthWeightScale = 0.125f; - [Tooltip("The weight scale for the branch path's normalized length. The normalized length (0 -> 1) of the branch path (PathLength / MaxPathLength) is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who meet their maximum path length.")] + [Tooltip(NormalizedLengthWeightScaleTooltip)] public float NormalizedLengthWeightScale = 1f; - [Tooltip("The weight scale for the branch path's number of connections to the same main path. The number of possible connections is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make path loops in their main path in general.")] + + internal const string SamePathBaseWeightScaleTooltip = "The weight scale for the branch path's number of connections to the same main path. The number of possible connections is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make path loops in their main path in general."; + internal const string SamePathDepthWeightScaleTooltip = "The weight scale for the branch path's number of connections to the same main path. For each possible connection, the main path depth difference is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make deep path loops to their main paths"; + internal const string SamePathNormalizedDepthWeightTooltip = "The weight scale for the branch path's number of connections to the same main path. For each possible connection, the main path normalized depth difference is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make generally deep path loops to their main paths"; + + [Space()] + [Header("Same Path")] + [Tooltip(SamePathBaseWeightScaleTooltip)] public float SamePathBaseWeightScale = 0.125f; - [Tooltip("The weight scale for the branch path's number of connections to the same main path. For each possible connection, the main path depth difference is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make deep path loops to their main paths")] + [Tooltip(SamePathDepthWeightScaleTooltip)] public float SamePathDepthWeightScale = 0.125f; - [Tooltip("The weight scale for the branch path's number of connections to the same main path. For each possible connection, the main path normalized depth difference is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make generally deep path loops to their main paths")] + [Tooltip(SamePathNormalizedDepthWeightTooltip)] public float SamePathNormalizedDepthWeightScale = 1f; - [Tooltip("The weight scale for the branch path's number of connections to other main paths. The number of possible connections is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make path loops to other main paths in general.")] + + internal const string DiffPathBaseWeightScaleTooltip = "The weight scale for the branch path's number of connections to other main paths. The number of possible connections is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make path loops to other main paths in general."; + internal const string DiffPathDepthWeightScaleTooltip = "The weight scale for the branch path's number of connections to other main paths. For each possible connection, the main path depth difference is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make deep path loops to other main paths."; + internal const string DiffPathNormalizedDepthWeightTooltip = "The weight scale for the branch path's number of connections to other main paths. For each possible connection, the main path normalized depth difference is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make generally deep path loops to other main paths."; + + [Space()] + [Header("Different Path")] + [Tooltip(DiffPathBaseWeightScaleTooltip)] public float DiffPathBaseWeightScale = 0.25f; - [Tooltip("The weight scale for the branch path's number of connections to other main paths. For each possible connection, the main path depth difference is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make deep path loops to other main paths.")] + [Tooltip(DiffPathDepthWeightScaleTooltip)] public float DiffPathDepthWeightScale = 0.25f; - [Tooltip("The weight scale for the branch path's number of connections to other main paths. For each possible connection, the main path normalized depth difference is multiplied by the scale and is added to the branch path's weight.\n\nIncreasing this value will prioritize branch paths who make generally deep path loops to other main paths.")] + [Tooltip(DiffPathNormalizedDepthWeightTooltip)] public float DiffPathNormalizedDepthWeightScale = 2f; public float GetWeightBase(float length, float normalizedLength){ @@ -223,13 +258,18 @@ namespace DunGenPlus.Collections { [System.Serializable] public class LineRandomizerProperties { - [Tooltip("If enabled, every archetype in LineRandomizerArchetypes will have the last LineRandomizerTakeCount tilesets replaced by a randomly selected set of tilesets from LineRandomizerTileSets. This applies for both archetype's TileSets and BranchCapTileSets.\n\nThis is designed for the scenario where dungeon generation takes a long time due to the combination of too many tiles and/or doorways in those tiles. This can reduce dungeon generation time while keeping some of the randomness of dungeon generation.\n\nAs stated previously, this WILL replace the last LineRandomizerTakeCount tilesets in the archetype's TileSets and BranchCapTileSets. As such you must guarantee that those elements can be replaced.")] + internal const string UseLineRandomizerTooltip = "If enabled, every archetype in LineRandomizerArchetypes will have the last LineRandomizerTakeCount tilesets replaced by a randomly selected set of tilesets from LineRandomizerTileSets. This applies for both archetype's TileSets and BranchCapTileSets.\n\nThis is designed for the scenario where dungeon generation takes a long time due to the combination of too many tiles and/or doorways in those tiles. This can reduce dungeon generation time while keeping some of the randomness of dungeon generation.\n\nAs stated previously, this WILL replace the last LineRandomizerTakeCount tilesets in the archetype's TileSets and BranchCapTileSets. As such you must guarantee that those elements can be replaced."; + internal const string ArchetypesTooltip = "The archetypes whose tilesets will be replaced.\n\nThese archetypes should ideally used in the Lines section of DungeonFlow, but it's a free country."; + internal const string TileSetsTooltip = "The tilesets that will be used for replacement."; + internal const string TileSetsTakeCountTooltip = "The amount of tilesets that will be replaced from the archetypes, starting from the last element to the first element.\n\nAs stated previously, this WILL replace the tilesets in the archetype's TileSets and BranchCapTileSets. As such you must guarantee that those elements can be replaced."; + + [Tooltip(UseLineRandomizerTooltip)] public bool UseLineRandomizer = false; - [Tooltip("The archetypes whose tilesets will be replaced.\n\nThese archetypes should ideally used in the Lines section of DungeonFlow, but it's a free country.")] + [Tooltip(ArchetypesTooltip)] public List Archetypes = new List(); - [Tooltip("The tilesets that will be used for replacement.")] + [Tooltip(TileSetsTooltip)] public List TileSets = new List(); - [Tooltip("The amount of tilesets that will be replaced from the archetypes, starting from the last element to the first element.\n\nAs stated previously, this WILL replace the tilesets in the archetype's TileSets and BranchCapTileSets. As such you must guarantee that those elements can be replaced.")] + [Tooltip(TileSetsTakeCountTooltip)] public int TileSetsTakeCount = 3; internal void CopyFrom(LineRandomizerProperties props) { @@ -249,13 +289,18 @@ namespace DunGenPlus.Collections { [System.Serializable] public class MiscellaneousProperties { - [Tooltip("If enabled, updates the MaxShadowsRequest to MaxShadowsRequestAmount when your dungeon loads.\n\nThis is designed for the scenario where your dungeon, for whatever reason, has too many lights nearby and causes the annoying 'Max shadow requests count reached' warning to spam the logs.")] + internal const string UseMaxShadowsRequestUpdateTooltip = "If enabled, updates the MaxShadowsRequest to MaxShadowsRequestAmount when your dungeon loads.\n\nThis is designed for the scenario where your dungeon, for whatever reason, has too many lights nearby and causes the annoying 'Max shadow requests count reached' warning to spam the logs."; + internal const string MaxShadowsRequestCountTooltip = "The amount of MaxShadowsRequest.\n\n4 is the game's default value. I find 8 to be more than acceptable."; + internal const string UseDoorwaySistersTooltip = "If enabled, the DoorwaySisters component will become active.\n\nThe component prevents an intersecting doorway from generating if it's 'sister' doorway already generated and both doorways would lead to the same neighboring tile.\n\nThis is designed for the scenario where, two neighboring doorways would lead to the same tile, one doorway is a locked door and the other is an open doorway. This would defeat the purpose of the locked door, and such as, this feature exists if needed.\n\nThis feature slows down dungeon generation slightly when enabled."; + internal const string UseRandomGuaranteedScrapSpawnTooltip = "If enabled, the RandomGuaranteedScrapSpawn component will be come active.\n\nThe component allows random scrap of a specified minimum value to always be spawned on a specific point."; + + [Tooltip(UseMaxShadowsRequestUpdateTooltip)] public bool UseMaxShadowsRequestUpdate = false; - [Tooltip("The amount of MaxShadowsRequest.\n\n4 is the game's default value. I find 8 to be more than acceptable.")] + [Tooltip(MaxShadowsRequestCountTooltip)] public int MaxShadowsRequestCount = 8; - [Tooltip("If enabled, the DoorwaySisters component will become active.\n\nThe component prevents an intersecting doorway from generating if it's 'sister' doorway already generated and both doorways would lead to the same neighboring tile.\n\nThis is designed for the scenario where, two neighboring doorways would lead to the same tile, one doorway is a locked door and the other is an open doorway. This would defeat the purpose of the locked door, and such as, this feature exists if needed.\n\nThis feature slows down dungeon generation slightly when enabled.")] + [Tooltip(UseDoorwaySistersTooltip)] public bool UseDoorwaySisters = false; - [Tooltip("If enabled, the RandomGuaranteedScrapSpawn component will be come active.\n\nThe component allows random scrap of a specified minimum value to always be spawned on a specific point.")] + [Tooltip(UseRandomGuaranteedScrapSpawnTooltip)] public bool UseRandomGuaranteedScrapSpawn = false; internal void CopyFrom(MiscellaneousProperties props) { diff --git a/DunGenPlus/DunGenPlus/Collections/ForcedTileSetList.cs b/DunGenPlus/DunGenPlus/Collections/ForcedTileSetList.cs index 534ee1c..de91571 100644 --- a/DunGenPlus/DunGenPlus/Collections/ForcedTileSetList.cs +++ b/DunGenPlus/DunGenPlus/Collections/ForcedTileSetList.cs @@ -10,13 +10,18 @@ namespace DunGenPlus.Collections { [System.Serializable] public class ForcedTileSetList { - [Tooltip("List of tiles to be forcefully spawned.")] - public List Tilesets = new List(); - [Tooltip("The weight based on the path's depth.")] + internal const string TileSetsTooltip = "List of tiles to be forcefully spawned."; + internal const string DepthWeightScaleTooltip = "The weight based on the path's depth."; + internal const string MainPathWeightTooltip = "The weight for the tile spawning on the main path."; + internal const string BranchPathWeightTooltip = "The weight for the tile spawning on the branch path."; + + [Tooltip(TileSetsTooltip)] + public List TileSets = new List(); + [Tooltip(DepthWeightScaleTooltip)] public AnimationCurve DepthWeightScale = new AnimationCurve(); - [Tooltip("The weight for the tile spawning on the main path.")] + [Tooltip(MainPathWeightTooltip)] public float MainPathWeight = 1f; - [Tooltip("The weight for the tile spawning on the branch path.")] + [Tooltip(BranchPathWeightTooltip)] public float BranchPathWeight = 1f; } diff --git a/DunGenPlus/DunGenPlus/Collections/NodeArchetype.cs b/DunGenPlus/DunGenPlus/Collections/NodeArchetype.cs index e54f3b3..0425dcd 100644 --- a/DunGenPlus/DunGenPlus/Collections/NodeArchetype.cs +++ b/DunGenPlus/DunGenPlus/Collections/NodeArchetype.cs @@ -10,10 +10,14 @@ namespace DunGenPlus.Collections { [System.Serializable] public class NodeArchetype { - [Tooltip("The normal node with this label will gain a randomly chosen archetype.\n\nIf empty, this becomes the default choice for any normal node without a NodeArchetype specified in this list.")] - public string label; - [Tooltip("The list of archetypes. One will be randomly chosen.")] - public List archetypes = new List(); + + internal const string LabelTooltip = "The normal node with this label will gain a randomly chosen archetype.\n\nIf empty, this becomes the default choice for any normal node without a NodeArchetype specified in this list."; + internal const string ArchetypesTooltip = "The list of archetypes. One will be randomly chosen."; + + [Tooltip(LabelTooltip)] + public string Label; + [Tooltip(ArchetypesTooltip)] + public List Archetypes = new List(); } } diff --git a/DunGenPlus/DunGenPlus/DevTools/Panels/Collections/DungeonFlowCacheAssets.cs b/DunGenPlus/DunGenPlus/DevTools/Panels/Collections/DungeonFlowCacheAssets.cs index e14198a..e1d0143 100644 --- a/DunGenPlus/DunGenPlus/DevTools/Panels/Collections/DungeonFlowCacheAssets.cs +++ b/DunGenPlus/DunGenPlus/DevTools/Panels/Collections/DungeonFlowCacheAssets.cs @@ -86,8 +86,8 @@ namespace DunGenPlus.DevTools.Panels.Collections { AddTileSets(dungeonFlow.TileInjectionRules.Select(n => n.TileSet)); if (extender) { - AddArchetypes(extender.Properties.NormalNodeArchetypesProperties.NormalNodeArchetypes.SelectMany(l => l.archetypes)); - AddTileSets(extender.Properties.ForcedTilesProperties.ForcedTileSets.SelectMany(l => l.Tilesets)); + AddArchetypes(extender.Properties.NormalNodeArchetypesProperties.NormalNodeArchetypes.SelectMany(l => l.Archetypes)); + AddTileSets(extender.Properties.ForcedTilesProperties.ForcedTileSets.SelectMany(l => l.TileSets)); AddTiles(extender.Properties.AssetCacheTileList); AddTileSets(extender.Properties.AssetCacheTileSetList); diff --git a/DunGenPlus/DunGenPlus/DevTools/Panels/DunGenPlusPanel.cs b/DunGenPlus/DunGenPlus/DevTools/Panels/DunGenPlusPanel.cs index 168d195..e469a9c 100644 --- a/DunGenPlus/DunGenPlus/DevTools/Panels/DunGenPlusPanel.cs +++ b/DunGenPlus/DunGenPlus/DevTools/Panels/DunGenPlusPanel.cs @@ -73,38 +73,40 @@ namespace DunGenPlus.DevTools.Panels { } + internal const string ActivateDunGenPlusTooltip = "If disabled, the dungeon generation will ignore this DunGenPlusExtender asset and simply create a vanilla dungeon instead when generating."; + public void SetupPanel() { selectedExtenderer = API.GetDunGenExtender(selectedDungeonFlow); var parentTransform = selectedListGameObject.transform; var properties = selectedExtenderer.Properties; - manager.CreateBoolInputField(parentTransform, "Activate DunGenPlus", selectedExtenderer.Active, SetActivateDunGenPlus); + manager.CreateBoolInputField(parentTransform, ("Activate DunGenPlus", ActivateDunGenPlusTooltip), selectedExtenderer.Active, SetActivateDunGenPlus); manager.CreateSpaceUIField(parentTransform); var mainPathTransform = manager.CreateVerticalLayoutUIField(parentTransform); mainPathParentGameobject = mainPathTransform.gameObject; manager.CreateHeaderUIField(parentTransform, "Main Path"); - manager.CreateIntSliderField(parentTransform, "Main Path Count", new IntParameter(properties.MainPathProperties.MainPathCount, 1, 10), SetMainPathCount); + manager.CreateIntSliderField(parentTransform, ("Main Path Count", MainPathProperties.MainPathCountTooltip), new IntParameter(properties.MainPathProperties.MainPathCount, 1, 10), SetMainPathCount); mainPathTransform.SetAsLastSibling(); - manager.CreateTileOptionsUIField(mainPathTransform, "Main Room Tile Prefab", selectedAssetCache.tiles.dictionary[properties.MainPathProperties.MainRoomTilePrefab], SetMainRoom); - manager.CreateEnumOptionsUIField(mainPathTransform, "Copy Node Behaviour", (int)properties.MainPathProperties.CopyNodeBehaviour, SetCopyNodeBehaviour); + manager.CreateTileOptionsUIField(mainPathTransform, ("Main Room Tile Prefab", MainPathProperties.MainRoomTilePrefabTooltip), selectedAssetCache.tiles.dictionary[properties.MainPathProperties.MainRoomTilePrefab], SetMainRoom); + manager.CreateEnumOptionsUIField(mainPathTransform, ("Copy Node Behaviour", MainPathProperties.CopyNodeBehaviourTooltip), (int)properties.MainPathProperties.CopyNodeBehaviour, SetCopyNodeBehaviour); manager.CreateSpaceUIField(parentTransform); var dungeonBoundsTransform = manager.CreateVerticalLayoutUIField(parentTransform); dungeonBoundsParentGameobject = dungeonBoundsTransform.gameObject; manager.CreateHeaderUIField(parentTransform, "Dungeon Bounds"); - manager.CreateBoolInputField(parentTransform, "Use Dungeon Bounds", properties.DungeonBoundsProperties.UseDungeonBounds, SetUseDungeonBounds); + manager.CreateBoolInputField(parentTransform, ("Use Dungeon Bounds", DungeonBoundsProperties.UseDungeonBoundsTooltip), properties.DungeonBoundsProperties.UseDungeonBounds, SetUseDungeonBounds); dungeonBoundsTransform.SetAsLastSibling(); - manager.CreateVector3InputField(dungeonBoundsTransform, "Size Base", properties.DungeonBoundsProperties.SizeBase, SetDungeonBoundsSizeBase); - manager.CreateVector3InputField(dungeonBoundsTransform, "Size Factor", properties.DungeonBoundsProperties.SizeFactor, SetDungeonBoundsSizeFactor); - manager.CreateVector3InputField(dungeonBoundsTransform, "Position Offset", properties.DungeonBoundsProperties.PositionOffset, SetDungeonBoundsPosOffset); - manager.CreateVector3InputField(dungeonBoundsTransform, "Position Pivot", properties.DungeonBoundsProperties.PositionPivot, SetDungeonBoundsPosPivot); + manager.CreateVector3InputField(dungeonBoundsTransform, ("Size Base", DungeonBoundsProperties.SizeBaseTooltip), properties.DungeonBoundsProperties.SizeBase, SetDungeonBoundsSizeBase); + manager.CreateVector3InputField(dungeonBoundsTransform, ("Size Factor", DungeonBoundsProperties.SizeFactorTooltip), properties.DungeonBoundsProperties.SizeFactor, SetDungeonBoundsSizeFactor); + manager.CreateVector3InputField(dungeonBoundsTransform, ("Position Offset", DungeonBoundsProperties.PositionOffsetTooltip), properties.DungeonBoundsProperties.PositionOffset, SetDungeonBoundsPosOffset); + manager.CreateVector3InputField(dungeonBoundsTransform, ("Position Pivot", DungeonBoundsProperties.PositionPivotTooltip), properties.DungeonBoundsProperties.PositionPivot, SetDungeonBoundsPosPivot); manager.CreateSpaceUIField(parentTransform); var archetypesTransform = manager.CreateVerticalLayoutUIField(parentTransform); archetypesNodesParentGameobject = archetypesTransform.gameObject; manager.CreateHeaderUIField(parentTransform, "Archetypes Normal Nodes"); - manager.CreateBoolInputField(parentTransform, "Add Archetypes", properties.NormalNodeArchetypesProperties.AddArchetypesToNormalNodes, SetAddArchetypes); + manager.CreateBoolInputField(parentTransform, ("Add Archetypes", NormalNodeArchetypesProperties.AddArchetypesToNormalNodesTooltip), properties.NormalNodeArchetypesProperties.AddArchetypesToNormalNodes, SetAddArchetypes); archetypesTransform.SetAsLastSibling(); manager.CreateListUIField(archetypesTransform, "Normal Node Archetypes", properties.NormalNodeArchetypesProperties.NormalNodeArchetypes); manager.CreateSpaceUIField(parentTransform); @@ -112,42 +114,42 @@ namespace DunGenPlus.DevTools.Panels { var forcedTilesTransform = manager.CreateVerticalLayoutUIField(parentTransform); forcedTilesParentGameobject = forcedTilesTransform.gameObject; manager.CreateHeaderUIField(parentTransform, "Forced Tiles"); - manager.CreateBoolInputField(parentTransform, "Use Forced Tiles", properties.ForcedTilesProperties.UseForcedTiles, SetUseForcedTiles); + manager.CreateBoolInputField(parentTransform, ("Use Forced Tiles", ForcedTilesProperties.UseForcedTilesTooltip), properties.ForcedTilesProperties.UseForcedTiles, SetUseForcedTiles); forcedTilesTransform.SetAsLastSibling(); - manager.CreateListUIField(forcedTilesTransform, "Forced Tile Sets", properties.ForcedTilesProperties.ForcedTileSets); + manager.CreateListUIField(forcedTilesTransform, ("Forced Tile Sets", ForcedTilesProperties.ForcedTileSetsTooltip), properties.ForcedTilesProperties.ForcedTileSets); manager.CreateSpaceUIField(parentTransform); var branchLoopTransform = manager.CreateVerticalLayoutUIField(parentTransform); branchLoopBoostParentGameobject = branchLoopTransform.gameObject; manager.CreateHeaderUIField(parentTransform, "Branch Path Multi Sim"); - manager.CreateBoolInputField(parentTransform, "Use Branch Path Multi Sim", properties.BranchPathMultiSimulationProperties.UseBranchPathMultiSim, SetUseBranchPathMultiSim); + manager.CreateBoolInputField(parentTransform, ("Use Branch Path Multi Sim", BranchPathMultiSimulationProperties.UseBranchPathMultiSimTooltip), properties.BranchPathMultiSimulationProperties.UseBranchPathMultiSim, SetUseBranchPathMultiSim); branchLoopTransform.SetAsLastSibling(); - manager.CreateIntInputField(branchLoopTransform, "Simulation Count", new IntParameter(properties.BranchPathMultiSimulationProperties.SimulationCount, 1, 10, 1), SetSimulationCount); - manager.CreateFloatInputField(branchLoopTransform, "Length Weight Scale", new FloatParameter(properties.BranchPathMultiSimulationProperties.LengthWeightScale, 0f, 2f, 0f), SetLengthScale); - manager.CreateFloatInputField(branchLoopTransform, "Norm. Length Weight Scale", new FloatParameter(properties.BranchPathMultiSimulationProperties.NormalizedLengthWeightScale, 0f, 2f, 0f), SetNormalizedLengthScale); + manager.CreateIntInputField(branchLoopTransform, ("Simulation Count", BranchPathMultiSimulationProperties.SimulationCountTooltip), new IntParameter(properties.BranchPathMultiSimulationProperties.SimulationCount, 1, 10, 1), SetSimulationCount); + manager.CreateFloatInputField(branchLoopTransform, ("Length Weight Scale", BranchPathMultiSimulationProperties.LengthWeightScaleTooltip), new FloatParameter(properties.BranchPathMultiSimulationProperties.LengthWeightScale, 0f, 2f, 0f), SetLengthScale); + manager.CreateFloatInputField(branchLoopTransform, ("Norm. Length Weight Scale", BranchPathMultiSimulationProperties.NormalizedLengthWeightScaleTooltip), new FloatParameter(properties.BranchPathMultiSimulationProperties.NormalizedLengthWeightScale, 0f, 2f, 0f), SetNormalizedLengthScale); manager.CreateSpaceUIField(branchLoopTransform); - manager.CreateTextUIField(branchLoopTransform, "Same Path Connect"); - manager.CreateFloatInputField(branchLoopTransform, "Base Weight Scale", new FloatParameter(properties.BranchPathMultiSimulationProperties.SamePathBaseWeightScale, 0f, 2f, 0f), SamePathBaseConnectScale); - manager.CreateFloatInputField(branchLoopTransform, "Depth Weight Scale", new FloatParameter(properties.BranchPathMultiSimulationProperties.SamePathDepthWeightScale, 0f, 2f, 0f), SamePathConnectDepthScale); - manager.CreateFloatInputField(branchLoopTransform, "Norm. Depth Weight Scale", new FloatParameter(properties.BranchPathMultiSimulationProperties.SamePathNormalizedDepthWeightScale, 0f, 2f, 0f), SamePathConnectNormalizedDepthScale); + manager.CreateTextUIField(branchLoopTransform, ("Same Path Connect", "Weight scale for branch paths that start from a main path and connect later to the same main path.")); + manager.CreateFloatInputField(branchLoopTransform, ("Base Weight Scale", BranchPathMultiSimulationProperties.SamePathBaseWeightScaleTooltip), new FloatParameter(properties.BranchPathMultiSimulationProperties.SamePathBaseWeightScale, 0f, 2f, 0f), SamePathBaseConnectScale); + manager.CreateFloatInputField(branchLoopTransform, ("Depth Weight Scale", BranchPathMultiSimulationProperties.SamePathDepthWeightScaleTooltip), new FloatParameter(properties.BranchPathMultiSimulationProperties.SamePathDepthWeightScale, 0f, 2f, 0f), SamePathConnectDepthScale); + manager.CreateFloatInputField(branchLoopTransform, ("Norm. Depth Weight Scale", BranchPathMultiSimulationProperties.SamePathNormalizedDepthWeightTooltip), new FloatParameter(properties.BranchPathMultiSimulationProperties.SamePathNormalizedDepthWeightScale, 0f, 2f, 0f), SamePathConnectNormalizedDepthScale); manager.CreateSpaceUIField(branchLoopTransform); - manager.CreateTextUIField(branchLoopTransform, "Diff Path Connect"); - manager.CreateFloatInputField(branchLoopTransform, "Base Weight Scale", new FloatParameter(properties.BranchPathMultiSimulationProperties.DiffPathBaseWeightScale, 0f, 2f, 0f), DiffPathBaseConnectScale); - manager.CreateFloatInputField(branchLoopTransform, "Depth Weight Scale", new FloatParameter(properties.BranchPathMultiSimulationProperties.DiffPathDepthWeightScale, 0f, 2f, 0f), DiffPathConnectDepthScale); - manager.CreateFloatInputField(branchLoopTransform, "Norm. Depth Weight Scale", new FloatParameter(properties.BranchPathMultiSimulationProperties.DiffPathNormalizedDepthWeightScale, 0f, 2f, 0f), DiffPathConnectNormalizedDepthScale); + manager.CreateTextUIField(branchLoopTransform, ("Diff Path Connect", "Weight scale for branch paths that start from a main path and connect later to a different main path.")); + manager.CreateFloatInputField(branchLoopTransform, ("Base Weight Scale", BranchPathMultiSimulationProperties.DiffPathBaseWeightScaleTooltip), new FloatParameter(properties.BranchPathMultiSimulationProperties.DiffPathBaseWeightScale, 0f, 2f, 0f), DiffPathBaseConnectScale); + manager.CreateFloatInputField(branchLoopTransform, ("Depth Weight Scale", BranchPathMultiSimulationProperties.DiffPathDepthWeightScaleTooltip), new FloatParameter(properties.BranchPathMultiSimulationProperties.DiffPathDepthWeightScale, 0f, 2f, 0f), DiffPathConnectDepthScale); + manager.CreateFloatInputField(branchLoopTransform, ("Norm. Depth Weight Scale", BranchPathMultiSimulationProperties.DiffPathNormalizedDepthWeightTooltip), new FloatParameter(properties.BranchPathMultiSimulationProperties.DiffPathNormalizedDepthWeightScale, 0f, 2f, 0f), DiffPathConnectNormalizedDepthScale); manager.CreateSpaceUIField(branchLoopTransform); manager.CreateHeaderUIField(parentTransform, "Miscellaneous"); var maxShadowTransform = manager.CreateVerticalLayoutUIField(parentTransform); maxShadowsParentGameobject = maxShadowTransform.gameObject; - manager.CreateBoolInputField(parentTransform, "Use Max Shadows Request", properties.MiscellaneousProperties.UseMaxShadowsRequestUpdate, SetUseMaxShadows); - manager.CreateIntInputField(maxShadowTransform, "Shadows Request Amount", new IntParameter(properties.MiscellaneousProperties.MaxShadowsRequestCount, 4, 20, 4), SetMaxShadowsCount); + manager.CreateBoolInputField(parentTransform, ("Use Max Shadows Request", MiscellaneousProperties.UseMaxShadowsRequestUpdateTooltip), properties.MiscellaneousProperties.UseMaxShadowsRequestUpdate, SetUseMaxShadows); + manager.CreateIntInputField(maxShadowTransform, ("Shadows Request Amount", MiscellaneousProperties.MaxShadowsRequestCountTooltip), new IntParameter(properties.MiscellaneousProperties.MaxShadowsRequestCount, 4, 20, 4), SetMaxShadowsCount); maxShadowTransform.SetAsLastSibling(); - manager.CreateBoolInputField(parentTransform, "Use Doorway Sisters", properties.MiscellaneousProperties.UseDoorwaySisters, SetUseDoorwaySisters); - manager.CreateBoolInputField(parentTransform, "Use Random Guaranteed Scrap", properties.MiscellaneousProperties.UseRandomGuaranteedScrapSpawn, SetUseRandomGuaranteedScrap); + manager.CreateBoolInputField(parentTransform, ("Use Doorway Sisters", MiscellaneousProperties.UseDoorwaySistersTooltip), properties.MiscellaneousProperties.UseDoorwaySisters, SetUseDoorwaySisters); + manager.CreateBoolInputField(parentTransform, ("Use Random Guaranteed Scrap", MiscellaneousProperties.UseRandomGuaranteedScrapSpawnTooltip), properties.MiscellaneousProperties.UseRandomGuaranteedScrapSpawn, SetUseRandomGuaranteedScrap); manager.CreateSpaceUIField(parentTransform); mainPathParentGameobject.SetActive(properties.MainPathProperties.MainPathCount > 1); @@ -288,6 +290,8 @@ namespace DunGenPlus.DevTools.Panels { public void RestoreOriginalState(){ selectedExtenderer.Properties.CopyFrom(selectedAssetCache.originalProperties); + ClearPanel(); + SetupPanel(); } } diff --git a/DunGenPlus/DunGenPlus/DevTools/Panels/MainPanel.cs b/DunGenPlus/DunGenPlus/DevTools/Panels/MainPanel.cs index c2cd33f..0457327 100644 --- a/DunGenPlus/DunGenPlus/DevTools/Panels/MainPanel.cs +++ b/DunGenPlus/DunGenPlus/DevTools/Panels/MainPanel.cs @@ -22,6 +22,8 @@ namespace DunGenPlus.DevTools.Panels { internal ExtendedLevel[] levels; internal IEnumerable levelOptions; + private GameObject asyncParentGameobject; + public override void AwakeCall(){ Instance = this; @@ -32,21 +34,26 @@ namespace DunGenPlus.DevTools.Panels { manager.CreateHeaderUIField(parentTransform, "Dungeon Generator"); seedInputField = manager.CreateIntInputField(parentTransform, "Seed", gen.Seed, SetSeed); - manager.CreateBoolInputField(parentTransform, "Randomize Seed", gen.ShouldRandomizeSeed, SetRandomSeed); + manager.CreateBoolInputField(parentTransform, ("Randomize Seed", "If true, creates and saves a new seed when generating the dungeon."), gen.ShouldRandomizeSeed, SetRandomSeed); manager.CreateSpaceUIField(parentTransform); - manager.CreateIntInputField(parentTransform, "Max Attempts", new IntParameter(gen.MaxAttemptCount, 0, 500, 0), SetMaxAttempts); + manager.CreateIntInputField(parentTransform, ("Max Attempts", "Maximum number of dungeon generation attempts before giving up."), new IntParameter(gen.MaxAttemptCount, 0, 500, 0), SetMaxAttempts); manager.CreateSpaceUIField(parentTransform); - manager.CreateBoolInputField(parentTransform, "Generate Async", gen.GenerateAsynchronously, SetGenerateAsync); - manager.CreateFloatInputField(parentTransform, "Max Async (ms)", new FloatParameter(gen.MaxAsyncFrameMilliseconds, 0f, float.MaxValue), SetMaxAsync); - manager.CreateFloatInputField(parentTransform, "Pause Between Rooms", new FloatParameter(gen.PauseBetweenRooms, 0f, float.MaxValue), SetPauseBetweenRooms); + var asyncTransform = manager.CreateVerticalLayoutUIField(parentTransform); + asyncParentGameobject = asyncTransform.gameObject; + manager.CreateBoolInputField(parentTransform, ("Generate Async", "If true, visually generates the dungeon tile by tile."), gen.GenerateAsynchronously, SetGenerateAsync); + manager.CreateFloatInputField(asyncTransform, "Max Async (ms)", new FloatParameter(gen.MaxAsyncFrameMilliseconds, 0f, float.MaxValue), SetMaxAsync); + manager.CreateFloatInputField(asyncTransform, "Pause Between Rooms", new FloatParameter(gen.PauseBetweenRooms, 0f, float.MaxValue), SetPauseBetweenRooms); + asyncTransform.SetAsLastSibling(); manager.CreateSpaceUIField(parentTransform); manager.CreateHeaderUIField(parentTransform, "Levels"); manager.CreateLevelOptionsUIField(parentTransform, "Level", 0, SetLevel); - lengthMultiplierField = manager.CreateTextUIField(parentTransform, "Length Multiplier"); + lengthMultiplierField = manager.CreateTextUIField(parentTransform, ("Length Multiplier", "Dungeon size multiplier based on the level.")); SetLevel(levels[0]); + + asyncParentGameobject.SetActive(gen.GenerateAsynchronously); } public void SetSeed(int value) { @@ -63,6 +70,7 @@ namespace DunGenPlus.DevTools.Panels { public void SetGenerateAsync(bool state) { dungeon.Generator.GenerateAsynchronously = state; + asyncParentGameobject.SetActive(state); } public void SetMaxAsync(float value) { diff --git a/DunGenPlus/DunGenPlus/DevTools/UIElements/Collections/ListEntryType.cs b/DunGenPlus/DunGenPlus/DevTools/UIElements/Collections/ListEntryType.cs index b2b2ed7..dc0da8e 100644 --- a/DunGenPlus/DunGenPlus/DevTools/UIElements/Collections/ListEntryType.cs +++ b/DunGenPlus/DunGenPlus/DevTools/UIElements/Collections/ListEntryType.cs @@ -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); } } diff --git a/DunGenPlus/DunGenPlus/DevTools/UIElements/Collections/Parameters.cs b/DunGenPlus/DunGenPlus/DevTools/UIElements/Collections/Parameters.cs index fe08629..bfb61b8 100644 --- a/DunGenPlus/DunGenPlus/DevTools/UIElements/Collections/Parameters.cs +++ b/DunGenPlus/DunGenPlus/DevTools/UIElements/Collections/Parameters.cs @@ -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 { diff --git a/DunGenPlus/DunGenPlus/DevTools/UIElements/DropdownInputField.cs b/DunGenPlus/DunGenPlus/DevTools/UIElements/DropdownInputField.cs index a132fe1..840eafc 100644 --- a/DunGenPlus/DunGenPlus/DevTools/UIElements/DropdownInputField.cs +++ b/DunGenPlus/DunGenPlus/DevTools/UIElements/DropdownInputField.cs @@ -17,7 +17,7 @@ namespace DunGenPlus.DevTools.UIElements public void SetupDropdown(TitleParameter titleParameter, int baseValue, Action setAction, Func convertIndex, IEnumerable 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(); diff --git a/DunGenPlus/DunGenPlus/DunGenPlus.csproj b/DunGenPlus/DunGenPlus/DunGenPlus.csproj index 3223092..08b239e 100644 --- a/DunGenPlus/DunGenPlus/DunGenPlus.csproj +++ b/DunGenPlus/DunGenPlus/DunGenPlus.csproj @@ -146,6 +146,7 @@ + diff --git a/DunGenPlus/DunGenPlus/Generation/DunGenPlusGeneratorMiscellaneous.cs b/DunGenPlus/DunGenPlus/Generation/DunGenPlusGeneratorMiscellaneous.cs index a56bc1b..1cd13b3 100644 --- a/DunGenPlus/DunGenPlus/Generation/DunGenPlusGeneratorMiscellaneous.cs +++ b/DunGenPlus/DunGenPlus/Generation/DunGenPlusGeneratorMiscellaneous.cs @@ -29,7 +29,7 @@ namespace DunGenPlus.Generation { // try every tile, if we somehow fail than man that sucks foreach(var pair in allTiles){ var t = pair.t; - var tileProxy = gen.AddTile(t, item.Tilesets, t.Placement.NormalizedDepth, null, TilePlacementResult.None); + var tileProxy = gen.AddTile(t, item.TileSets, t.Placement.NormalizedDepth, null, TilePlacementResult.None); if (tileProxy == null) continue; tileProxy.Placement.BranchDepth = t.Placement.BranchDepth; diff --git a/DunGenPlus/DunGenPlus/Patches/RoundManagerPatch.cs b/DunGenPlus/DunGenPlus/Patches/RoundManagerPatch.cs index b7e8c1c..021239e 100644 --- a/DunGenPlus/DunGenPlus/Patches/RoundManagerPatch.cs +++ b/DunGenPlus/DunGenPlus/Patches/RoundManagerPatch.cs @@ -18,7 +18,9 @@ namespace DunGenPlus.Patches { [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "Awake")] public static void AwakePatch(){ - var devDebug = new GameObject("DevDebugOpen", typeof(DevDebugOpen)); + if (PluginConfig.EnableDevDebugTools.Value){ + var devDebug = new GameObject("DevDebugOpen", typeof(DevDebugOpen)); + } } [HarmonyPrefix] diff --git a/DunGenPlus/DunGenPlus/Plugin.cs b/DunGenPlus/DunGenPlus/Plugin.cs index 7bfba65..661c239 100644 --- a/DunGenPlus/DunGenPlus/Plugin.cs +++ b/DunGenPlus/DunGenPlus/Plugin.cs @@ -25,7 +25,7 @@ namespace DunGenPlus { internal const string modGUID = "dev.ladyalice.dungenplus"; private const string modName = "Dungeon Generation Plus"; - private const string modVersion = "1.0.6"; + private const string modVersion = "1.1.0"; internal readonly Harmony Harmony = new Harmony(modGUID); @@ -41,6 +41,8 @@ namespace DunGenPlus { logger = BepInEx.Logging.Logger.CreateLogSource(modGUID); logger.LogInfo($"Plugin {modName} has been added!"); + PluginConfig.SetupConfig(Config); + Harmony.PatchAll(typeof(DungeonGeneratorPatch)); Harmony.PatchAll(typeof(DoorwayConnectionPatch)); Harmony.PatchAll(typeof(RoundManagerPatch)); diff --git a/DunGenPlus/DunGenPlus/PluginConfig.cs b/DunGenPlus/DunGenPlus/PluginConfig.cs new file mode 100644 index 0000000..4c90977 --- /dev/null +++ b/DunGenPlus/DunGenPlus/PluginConfig.cs @@ -0,0 +1,18 @@ +using BepInEx.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DunGenPlus { + internal class PluginConfig { + + public static ConfigEntry EnableDevDebugTools; + + public static void SetupConfig(ConfigFile cfg) { + EnableDevDebugTools = cfg.Bind(new ConfigDefinition("Dev", "Enable Dev Debug Tools"), false, new ConfigDescription("If enabled, allows the dev debug tools to be usable in the ship.\n\nPress M to activate.")); + } + + } +} diff --git a/DunGenPlus/DunGenPlus/dungen b/DunGenPlus/DunGenPlus/dungen index 8762463..44d2b6a 100644 Binary files a/DunGenPlus/DunGenPlus/dungen and b/DunGenPlus/DunGenPlus/dungen differ