Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 46f3512

Browse files
committed
3.2.10
* The following preferences are now persistent between sessions: Active Menu Page, Scene Explorer Hide State, Debug Console Hide State * The "Resize Cursor" is now just a `↔` Text label instead of a sprite. * Added support for Unity 5.2+ games (previously was only supporting 5.6)
1 parent 604c499 commit 46f3512

36 files changed

+442
-351
lines changed

lib/UnityEngine.UI.dll

-30.5 KB
Binary file not shown.

lib/UnityEngine.dll

-457 KB
Binary file not shown.

src/Core/Config/ExplorerConfig.cs

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using IniParser.Parser;
66
using UnityExplorer.UI;
77
using System.Globalization;
8+
using UnityExplorer.Core.Inspectors;
9+
using UnityExplorer.UI.Main;
810

911
namespace UnityExplorer.Core.Config
1012
{
@@ -17,21 +19,17 @@ public class ExplorerConfig
1719

1820
internal static CultureInfo _enCulture = new CultureInfo("en-US");
1921

20-
static ExplorerConfig()
21-
{
22-
_parser.Configuration.CommentString = "#";
23-
24-
PanelDragger.OnFinishResize += PanelDragger_OnFinishResize;
25-
}
26-
2722
// Actual configs
28-
public KeyCode Main_Menu_Toggle = KeyCode.F7;
29-
public bool Force_Unlock_Mouse = true;
30-
public int Default_Page_Limit = 25;
31-
public string Default_Output_Path = Path.Combine(ExplorerCore.EXPLORER_FOLDER, "Output");
32-
public bool Log_Unity_Debug = false;
33-
public bool Hide_On_Startup = false;
34-
public string Window_Anchors = DEFAULT_WINDOW_ANCHORS;
23+
public KeyCode Main_Menu_Toggle = KeyCode.F7;
24+
public bool Force_Unlock_Mouse = true;
25+
public int Default_Page_Limit = 25;
26+
public string Default_Output_Path = Path.Combine(ExplorerCore.EXPLORER_FOLDER, "Output");
27+
public bool Log_Unity_Debug = false;
28+
public bool Hide_On_Startup = false;
29+
public string Window_Anchors = DEFAULT_WINDOW_ANCHORS;
30+
public int Active_Tab = 0;
31+
public bool DebugConsole_Hidden = false;
32+
public bool SceneExplorer_Hidden = false;
3533

3634
private const string DEFAULT_WINDOW_ANCHORS = "0.25,0.10,0.78,0.95";
3735

@@ -45,6 +43,12 @@ internal static void InvokeConfigChanged()
4543
public static void OnLoad()
4644
{
4745
Instance = new ExplorerConfig();
46+
_parser.Configuration.CommentString = "#";
47+
48+
PanelDragger.OnFinishResize += PanelDragger_OnFinishResize;
49+
SceneExplorer.OnToggleShow += SceneExplorer_OnToggleShow;
50+
DebugConsole.OnToggleShow += DebugConsole_OnToggleShow;
51+
MainMenu.OnActiveTabChanged += MainMenu_OnActiveTabChanged;
4852

4953
if (LoadSettings())
5054
return;
@@ -86,6 +90,15 @@ public static bool LoadSettings()
8690
case nameof(Window_Anchors):
8791
Instance.Window_Anchors = config.Value;
8892
break;
93+
case nameof(Active_Tab):
94+
Instance.Active_Tab = int.Parse(config.Value);
95+
break;
96+
case nameof(DebugConsole_Hidden):
97+
Instance.DebugConsole_Hidden = bool.Parse(config.Value);
98+
break;
99+
case nameof(SceneExplorer_Hidden):
100+
Instance.SceneExplorer_Hidden = bool.Parse(config.Value);
101+
break;
89102
}
90103
}
91104

@@ -99,20 +112,41 @@ public static void SaveSettings()
99112
data.Sections.AddSection("Config");
100113

101114
var sec = data.Sections["Config"];
102-
sec.AddKey(nameof(Main_Menu_Toggle), Instance.Main_Menu_Toggle.ToString());
103-
sec.AddKey(nameof(Force_Unlock_Mouse), Instance.Force_Unlock_Mouse.ToString());
104-
sec.AddKey(nameof(Default_Page_Limit), Instance.Default_Page_Limit.ToString());
105-
sec.AddKey(nameof(Log_Unity_Debug), Instance.Log_Unity_Debug.ToString());
106-
sec.AddKey(nameof(Default_Output_Path), Instance.Default_Output_Path);
107-
sec.AddKey(nameof(Hide_On_Startup), Instance.Hide_On_Startup.ToString());
108-
sec.AddKey(nameof(Window_Anchors), GetWindowAnchorsString());
115+
sec.AddKey(nameof(Main_Menu_Toggle), Instance.Main_Menu_Toggle.ToString());
116+
sec.AddKey(nameof(Force_Unlock_Mouse), Instance.Force_Unlock_Mouse.ToString());
117+
sec.AddKey(nameof(Default_Page_Limit), Instance.Default_Page_Limit.ToString());
118+
sec.AddKey(nameof(Log_Unity_Debug), Instance.Log_Unity_Debug.ToString());
119+
sec.AddKey(nameof(Default_Output_Path), Instance.Default_Output_Path);
120+
sec.AddKey(nameof(Hide_On_Startup), Instance.Hide_On_Startup.ToString());
121+
sec.AddKey(nameof(Window_Anchors), GetWindowAnchorsString());
122+
sec.AddKey(nameof(Active_Tab), Instance.Active_Tab.ToString());
123+
sec.AddKey(nameof(DebugConsole_Hidden), Instance.DebugConsole_Hidden.ToString());
124+
sec.AddKey(nameof(SceneExplorer_Hidden), Instance.SceneExplorer_Hidden.ToString());
109125

110126
if (!Directory.Exists(ExplorerCore.Loader.ConfigFolder))
111127
Directory.CreateDirectory(ExplorerCore.Loader.ConfigFolder);
112128

113129
File.WriteAllText(INI_PATH, data.ToString());
114130
}
115131

132+
private static void SceneExplorer_OnToggleShow()
133+
{
134+
Instance.SceneExplorer_Hidden = SceneExplorer.UI.Hiding;
135+
SaveSettings();
136+
}
137+
138+
private static void DebugConsole_OnToggleShow()
139+
{
140+
Instance.DebugConsole_Hidden = DebugConsole.Hiding;
141+
SaveSettings();
142+
}
143+
144+
private static void MainMenu_OnActiveTabChanged(int page)
145+
{
146+
Instance.Active_Tab = page;
147+
SaveSettings();
148+
}
149+
116150
// ============ Window Anchors specific stuff ============== //
117151

118152
private static void PanelDragger_OnFinishResize()

src/Core/Inspectors/Reflection/CacheObject/CacheMember.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ internal override void ConstructUI()
224224
var topGroup = topGroupObj.GetComponent<HorizontalLayoutGroup>();
225225
topGroup.childForceExpandHeight = false;
226226
topGroup.childForceExpandWidth = false;
227-
topGroup.childControlHeight = true;
228-
topGroup.childControlWidth = true;
227+
topGroup.SetChildControlHeight(true);
228+
topGroup.SetChildControlWidth(true);
229229
topGroup.spacing = 10;
230230
topGroup.padding.left = 3;
231231
topGroup.padding.right = 3;
@@ -243,8 +243,8 @@ internal override void ConstructUI()
243243
var leftGroup = m_leftGroup.GetComponent<HorizontalLayoutGroup>();
244244
leftGroup.childForceExpandHeight = true;
245245
leftGroup.childForceExpandWidth = false;
246-
leftGroup.childControlHeight = true;
247-
leftGroup.childControlWidth = true;
246+
leftGroup.SetChildControlHeight(true);
247+
leftGroup.SetChildControlWidth(true);
248248
leftGroup.spacing = 4;
249249

250250
// member label
@@ -278,8 +278,8 @@ internal override void ConstructUI()
278278
var rightGroup = m_rightGroup.GetComponent<VerticalLayoutGroup>();
279279
rightGroup.childForceExpandHeight = true;
280280
rightGroup.childForceExpandWidth = false;
281-
rightGroup.childControlHeight = true;
282-
rightGroup.childControlWidth = true;
281+
rightGroup.SetChildControlHeight(true);
282+
rightGroup.SetChildControlWidth(true);
283283
rightGroup.spacing = 2;
284284
rightGroup.padding.top = 4;
285285
rightGroup.padding.bottom = 2;

src/Core/Inspectors/Reflection/CacheObject/CacheObjectBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ internal virtual void ConstructUI()
9292
m_mainRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 25);
9393
var mainGroup = m_mainContent.GetComponent<VerticalLayoutGroup>();
9494
mainGroup.childForceExpandWidth = true;
95-
mainGroup.childControlWidth = true;
95+
mainGroup.SetChildControlWidth(true);
9696
mainGroup.childForceExpandHeight = true;
97-
mainGroup.childControlHeight = true;
97+
mainGroup.SetChildControlHeight(true);
9898
var mainLayout = m_mainContent.AddComponent<LayoutElement>();
9999
mainLayout.minHeight = 25;
100100
mainLayout.flexibleHeight = 9999;

src/Core/Inspectors/Reflection/InteractiveValue/InteractiveDictionary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public override void ConstructSubcontent()
296296

297297
var scrollGroup = m_listContent.GetComponent<VerticalLayoutGroup>();
298298
scrollGroup.childForceExpandHeight = true;
299-
scrollGroup.childControlHeight = true;
299+
scrollGroup.SetChildControlHeight(true);
300300
scrollGroup.spacing = 2;
301301
scrollGroup.padding.top = 5;
302302
scrollGroup.padding.left = 5;

src/Core/Inspectors/Reflection/InteractiveValue/InteractiveEnumerable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public override void ConstructSubcontent()
270270

271271
var scrollGroup = m_listContent.GetComponent<VerticalLayoutGroup>();
272272
scrollGroup.childForceExpandHeight = true;
273-
scrollGroup.childControlHeight = true;
273+
scrollGroup.SetChildControlHeight(true);
274274
scrollGroup.spacing = 2;
275275
scrollGroup.padding.top = 5;
276276
scrollGroup.padding.left = 5;

src/Core/Inspectors/Reflection/InteractiveValue/InteractiveFlags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public override void ConstructSubcontent()
9898
var group = groupObj.GetComponent<VerticalLayoutGroup>();
9999
group.childForceExpandHeight = true;
100100
group.childForceExpandWidth = false;
101-
group.childControlHeight = true;
102-
group.childControlWidth = true;
101+
group.SetChildControlHeight(true);
102+
group.SetChildControlWidth(true);
103103
group.padding.top = 3;
104104
group.padding.left = 3;
105105
group.padding.right = 3;

src/Core/Inspectors/Reflection/InteractiveValue/InteractiveString.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ public override void ConstructSubcontent()
155155
hiddenLayout.flexibleWidth = 9000;
156156
var hiddenGroup = m_hiddenObj.AddComponent<HorizontalLayoutGroup>();
157157
hiddenGroup.childForceExpandWidth = true;
158-
hiddenGroup.childControlWidth = true;
158+
hiddenGroup.SetChildControlWidth(true);
159159
hiddenGroup.childForceExpandHeight = true;
160-
hiddenGroup.childControlHeight = true;
160+
hiddenGroup.SetChildControlHeight(true);
161161

162162
var inputObj = UIFactory.CreateInputField(m_hiddenObj, 14, 3);
163163
var inputLayout = inputObj.AddComponent<LayoutElement>();

src/Core/Inspectors/Reflection/InteractiveValue/InteractiveValue.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ public virtual void ConstructUI(GameObject parent, GameObject subGroup)
308308
mainRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 25);
309309
var mainGroup = m_valueContent.GetComponent<HorizontalLayoutGroup>();
310310
mainGroup.childForceExpandWidth = false;
311-
mainGroup.childControlWidth = true;
311+
mainGroup.SetChildControlWidth(true);
312312
mainGroup.childForceExpandHeight = false;
313-
mainGroup.childControlHeight = true;
313+
mainGroup.SetChildControlHeight(true);
314314
mainGroup.spacing = 4;
315315
mainGroup.childAlignment = TextAnchor.UpperLeft;
316316
var mainLayout = m_valueContent.AddComponent<LayoutElement>();

0 commit comments

Comments
 (0)