Skip to content

Commit 24faa7b

Browse files
committed
[BSL] Hide chara imgui when opening menu
1 parent 33ab153 commit 24faa7b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/BetterSceneLoader.Core/SceneGrid.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using UnityEngine;
55
using UnityEngine.UI;
66
using KeelPlugins.Utils;
7+
using Studio;
78
using UniRx.Triggers;
89
using UniRx;
910
using UnityEngine.EventSystems;
@@ -13,6 +14,7 @@ namespace BetterSceneLoader
1314
public class SceneGrid : ImageGrid
1415
{
1516
private ToolbarToggle toolbarToggle;
17+
private AddButtonCtrl addButtonCtrl;
1618

1719
public SceneGrid() : base(
1820
defaultPath: BepInEx.Utility.CombinePaths(Paths.GameRootPath, "UserData", "Studio", "scene"),
@@ -25,12 +27,15 @@ public override void ShowWindow(bool flag)
2527
{
2628
base.ShowWindow(flag);
2729
toolbarToggle?.SetValue(flag);
30+
if(flag && (addButtonCtrl.select == 0 || addButtonCtrl.select == 1))
31+
addButtonCtrl.OnClick(addButtonCtrl.select);
2832
}
2933

3034
public override void CreateUI(string name, int sortingOrder, string titleText)
3135
{
3236
base.CreateUI(name, sortingOrder, titleText);
3337
ThreadingHelper.Instance.StartCoroutine(AddToolbarButton());
38+
addButtonCtrl = GameObject.Find("StudioScene/Canvas Main Menu/01_Add").GetComponent<AddButtonCtrl>();
3439
}
3540

3641
private IEnumerator AddToolbarButton()

0 commit comments

Comments
 (0)