mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-17 06:28:42 +08:00
Fix for GenericConstructorWidget, adjust UI
This commit is contained in:
parent
ecc33927ee
commit
ff882296fd
@ -2,6 +2,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using UnityExplorer.Hooks;
|
using UnityExplorer.Hooks;
|
||||||
|
using UnityExplorer.UI.Widgets;
|
||||||
using UnityExplorer.UI.Widgets.AutoComplete;
|
using UnityExplorer.UI.Widgets.AutoComplete;
|
||||||
using UniverseLib;
|
using UniverseLib;
|
||||||
using UniverseLib.UI;
|
using UniverseLib.UI;
|
||||||
@ -22,15 +23,15 @@ namespace UnityExplorer.UI.Panels
|
|||||||
GenericArgsSelector,
|
GenericArgsSelector,
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static HookCreator hookCreator;
|
public static HookCreator hookCreator;
|
||||||
internal static HookList hookList;
|
public static HookList hookList;
|
||||||
internal static GenericHookHandler genericArgsHandler;
|
public static GenericConstructorWidget genericArgsHandler;
|
||||||
|
|
||||||
// Panel
|
// Panel
|
||||||
public override UIManager.Panels PanelType => UIManager.Panels.HookManager;
|
public override UIManager.Panels PanelType => UIManager.Panels.HookManager;
|
||||||
public override string Name => "Hooks";
|
public override string Name => "Hooks";
|
||||||
public override bool ShowByDefault => false;
|
public override bool ShowByDefault => false;
|
||||||
public override int MinWidth => 750;
|
public override int MinWidth => 400;
|
||||||
public override int MinHeight => 400;
|
public override int MinHeight => 400;
|
||||||
public override Vector2 DefaultAnchorMin => new(0.5f, 0.5f);
|
public override Vector2 DefaultAnchorMin => new(0.5f, 0.5f);
|
||||||
public override Vector2 DefaultAnchorMax => new(0.5f, 0.5f);
|
public override Vector2 DefaultAnchorMax => new(0.5f, 0.5f);
|
||||||
@ -48,19 +49,19 @@ namespace UnityExplorer.UI.Panels
|
|||||||
case Pages.ClassMethodSelector:
|
case Pages.ClassMethodSelector:
|
||||||
HookCreator.AddHooksRoot.SetActive(true);
|
HookCreator.AddHooksRoot.SetActive(true);
|
||||||
HookCreator.EditorRoot.SetActive(false);
|
HookCreator.EditorRoot.SetActive(false);
|
||||||
GenericHookHandler.UIRoot.SetActive(false);
|
genericArgsHandler.UIRoot.SetActive(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Pages.HookSourceEditor:
|
case Pages.HookSourceEditor:
|
||||||
HookCreator.AddHooksRoot.SetActive(false);
|
HookCreator.AddHooksRoot.SetActive(false);
|
||||||
HookCreator.EditorRoot.SetActive(true);
|
HookCreator.EditorRoot.SetActive(true);
|
||||||
GenericHookHandler.UIRoot.SetActive(false);
|
genericArgsHandler.UIRoot.SetActive(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Pages.GenericArgsSelector:
|
case Pages.GenericArgsSelector:
|
||||||
HookCreator.AddHooksRoot.SetActive(false);
|
HookCreator.AddHooksRoot.SetActive(false);
|
||||||
HookCreator.EditorRoot.SetActive(false);
|
HookCreator.EditorRoot.SetActive(false);
|
||||||
GenericHookHandler.UIRoot.SetActive(true);
|
genericArgsHandler.UIRoot.SetActive(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,28 +81,30 @@ namespace UnityExplorer.UI.Panels
|
|||||||
hookCreator = new();
|
hookCreator = new();
|
||||||
genericArgsHandler = new();
|
genericArgsHandler = new();
|
||||||
|
|
||||||
GameObject baseHoriGroup = UIFactory.CreateHorizontalGroup(ContentRoot, "HoriGroup", true, true, true, true);
|
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(ContentRoot, true, false);
|
||||||
UIFactory.SetLayoutElement(baseHoriGroup, flexibleWidth: 9999, flexibleHeight: 9999);
|
|
||||||
|
|
||||||
// Left Group
|
// GameObject baseHoriGroup = UIFactory.CreateHorizontalGroup(ContentRoot, "HoriGroup", true, true, true, true);
|
||||||
|
// UIFactory.SetLayoutElement(baseHoriGroup, flexibleWidth: 9999, flexibleHeight: 9999);
|
||||||
|
|
||||||
GameObject leftGroup = UIFactory.CreateVerticalGroup(baseHoriGroup, "LeftGroup", true, true, true, true);
|
// // Left Group
|
||||||
UIFactory.SetLayoutElement(leftGroup.gameObject, minWidth: 300, flexibleWidth: 9999, flexibleHeight: 9999);
|
|
||||||
|
|
||||||
hookList.ConstructUI(leftGroup);
|
//GameObject leftGroup = UIFactory.CreateVerticalGroup(ContentRoot, "LeftGroup", true, true, true, true);
|
||||||
|
UIFactory.SetLayoutElement(ContentRoot.gameObject, minWidth: 300, flexibleWidth: 9999, flexibleHeight: 9999);
|
||||||
|
|
||||||
// Right Group
|
hookList.ConstructUI(ContentRoot);
|
||||||
|
|
||||||
GameObject rightGroup = UIFactory.CreateVerticalGroup(baseHoriGroup, "RightGroup", true, true, true, true);
|
// // Right Group
|
||||||
UIFactory.SetLayoutElement(rightGroup, minWidth: 300, flexibleWidth: 9999, flexibleHeight: 9999);
|
|
||||||
|
|
||||||
hookCreator.ConstructAddHooksView(rightGroup);
|
//GameObject rightGroup = UIFactory.CreateVerticalGroup(ContentRoot, "RightGroup", true, true, true, true);
|
||||||
|
UIFactory.SetLayoutElement(ContentRoot, minWidth: 300, flexibleWidth: 9999, flexibleHeight: 9999);
|
||||||
|
|
||||||
hookCreator.ConstructEditor(rightGroup);
|
hookCreator.ConstructAddHooksView(ContentRoot);
|
||||||
|
|
||||||
|
hookCreator.ConstructEditor(ContentRoot);
|
||||||
HookCreator.EditorRoot.SetActive(false);
|
HookCreator.EditorRoot.SetActive(false);
|
||||||
|
|
||||||
genericArgsHandler.ConstructUI(rightGroup);
|
genericArgsHandler.ConstructUI(ContentRoot);
|
||||||
GenericHookHandler.UIRoot.SetActive(false);
|
genericArgsHandler.UIRoot.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user