diff --git a/DunGenPlus/DunGenPlus/DevTools/DevDebugManager.cs b/DunGenPlus/DunGenPlus/DevTools/DevDebugManager.cs index 859ad9b..8391995 100644 --- a/DunGenPlus/DunGenPlus/DevTools/DevDebugManager.cs +++ b/DunGenPlus/DunGenPlus/DevTools/DevDebugManager.cs @@ -25,6 +25,7 @@ namespace DunGenPlus.DevTools { public RuntimeDungeon dungeon; public GameObject devCamera; public BasePanel[] panels; + public RectTransform canvasRectTransform; public TMP_Dropdown dungeonFlowSelectionDropDown; private ExtendedDungeonFlow[] dungeonFlows; @@ -49,6 +50,10 @@ namespace DunGenPlus.DevTools { private Vector2 cameraYRange; + // canvas + public bool canvasExtended; + private float canvasWidthTarget; + void Awake(){ Instance = this; @@ -70,6 +75,9 @@ namespace DunGenPlus.DevTools { disabledGameObject.transform.SetParent(transform); cameraYRange = new Vector2(devCamera.transform.position.y - 200f, devCamera.transform.position.y); + + canvasExtended = false; + canvasWidthTarget = 440f; } void OnDestroy(){ @@ -85,6 +93,10 @@ namespace DunGenPlus.DevTools { } void Update(){ + var sizeDelta = canvasRectTransform.sizeDelta; + sizeDelta.x = Mathf.Lerp(sizeDelta.x, canvasWidthTarget, Time.deltaTime * 10f); + canvasRectTransform.sizeDelta = sizeDelta; + statusTextMesh.text = dungeon.Generator.Status.ToString(); if (!DevDebugOpen.IsSinglePlayerInShip()) { @@ -111,6 +123,11 @@ namespace DunGenPlus.DevTools { } } + public void ToggleCanvasExtended(){ + canvasExtended = !canvasExtended; + canvasWidthTarget = canvasExtended ? 800f : 440f; + } + public void SelectDungeonFlow(int index){ selectedExtendedDungeonFlow = dungeonFlows[index]; selectedDungeonFlow = selectedExtendedDungeonFlow.DungeonFlow; diff --git a/DunGenPlus/DunGenPlus/DevTools/UIElements/BaseUIElement.cs b/DunGenPlus/DunGenPlus/DevTools/UIElements/BaseUIElement.cs index 0c694ad..49df7ff 100644 --- a/DunGenPlus/DunGenPlus/DevTools/UIElements/BaseUIElement.cs +++ b/DunGenPlus/DunGenPlus/DevTools/UIElements/BaseUIElement.cs @@ -17,6 +17,7 @@ namespace DunGenPlus.DevTools.UIElements { public LayoutElement layoutElement; internal float layoutOffset; + internal float layoutWidthBase; public void SetupBase(TitleParameter titleParameter) { title = titleParameter.text; @@ -26,8 +27,17 @@ namespace DunGenPlus.DevTools.UIElements { layoutOffset = titleParameter.offset; if (layoutElement) { layoutElement.minWidth -= layoutOffset; + layoutWidthBase = layoutElement.minWidth; + } + } + + void Update(){ + if (layoutElement) { + var minWidth = layoutWidthBase; + if (DevDebugManager.Instance.canvasExtended) minWidth += 40f; + + layoutElement.minWidth = Mathf.Lerp(layoutElement.minWidth, minWidth, Time.deltaTime * 10f); } - } public void SetText(string value) { diff --git a/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll b/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll index 62feb9b..75d4778 100644 Binary files a/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll and b/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll differ diff --git a/DunGenPlus/DunGenPlus/dungen b/DunGenPlus/DunGenPlus/dungen index cc29b18..a0a7388 100644 Binary files a/DunGenPlus/DunGenPlus/dungen and b/DunGenPlus/DunGenPlus/dungen differ