cleanup unstripping

This commit is contained in:
sinaioutlander committed 2020-11-09 16:43:19 +11:00
1 parent 3783638c89
commit 5e761e2379
22 files changed
+115 -130

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using UnityExplorer.Unstrip.ColorUtility;
using UnityExplorer.Unstrip;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
+2 -2
View File
@@ -6,7 +6,7 @@ using UnityEngine;
using UnityEngine.UI;
using UnityExplorer.Config;
using UnityExplorer.UI.Shared;
using UnityExplorer.Unstrip.ColorUtility;
using UnityExplorer.Unstrip;
namespace UnityExplorer.UI.PageModel
{
@@ -169,7 +169,7 @@ namespace UnityExplorer.UI.PageModel
labelLayout.minWidth = 150;
labelLayout.minHeight = 25;
var toggleObj = UIFactory.CreateToggle(rowObj, out m_unlockMouseToggle, out Text toggleText);
UIFactory.CreateToggle(rowObj, out m_unlockMouseToggle, out Text toggleText);
m_unlockMouseToggle.isOn = ModConfig.Instance.Force_Unlock_Mouse;
toggleText.text = "";
}
+11 -7
View File
@@ -8,7 +8,7 @@ using UnityEngine.UI;
using UnityExplorer.Helpers;
using UnityExplorer.Inspectors;
using UnityExplorer.UI.Shared;
using UnityExplorer.Unstrip.Resources;
using UnityExplorer.Unstrip;
#if CPP
using UnhollowerRuntimeLib;
#endif
@@ -263,17 +263,17 @@ namespace UnityExplorer.UI.PageModel
#endif
var results = new List<object>();
// prefer filter comparers
// perform filter comparers
string nameFilter = null;
if (!string.IsNullOrEmpty(m_nameInput.text))
nameFilter = m_nameInput.text.ToLower();
bool canFilterScene = (m_sceneFilter != SceneFilter.Any || m_childFilter != ChildFilter.Any)
bool canGetGameObject = (m_sceneFilter != SceneFilter.Any || m_childFilter != ChildFilter.Any)
&& (m_context == SearchContext.GameObject || typeof(Component).IsAssignableFrom(searchType));
string sceneFilter = null;
if (!canFilterScene)
if (!canGetGameObject)
{
if (m_context != SearchContext.UnityObject && (m_sceneFilter != SceneFilter.Any || m_childFilter != ChildFilter.Any))
ExplorerCore.LogWarning($"Type '{searchType}' cannot have Scene or Child filters applied to it");
@@ -292,7 +292,7 @@ namespace UnityExplorer.UI.PageModel
if (!string.IsNullOrEmpty(nameFilter) && !obj.name.ToLower().Contains(nameFilter))
continue;
if (canFilterScene)
if (canGetGameObject)
{
#if MONO
var go = m_context == SearchContext.GameObject
@@ -304,6 +304,9 @@ namespace UnityExplorer.UI.PageModel
: obj.TryCast<Component>().gameObject;
#endif
if (!go)
continue;
// scene check
if (m_sceneFilter != SceneFilter.Any)
{
@@ -484,7 +487,7 @@ namespace UnityExplorer.UI.PageModel
customTypeLayout.minHeight = 25;
customTypeLayout.flexibleHeight = 0;
m_customTypeInput = customTypeObj.GetComponent<TMP_InputField>();
m_customTypeInput.placeholder.gameObject.GetComponent<TextMeshProUGUI>().text = "eg. UnityEngine.Camera";
m_customTypeInput.placeholder.gameObject.GetComponent<TextMeshProUGUI>().text = "eg. UnityEngine.Texture2D, etc...";
m_customTypeInput.onFocusSelectAll = true;
#if MONO
m_customTypeInput.onSelect.AddListener((string val) => { OnContextButtonClicked(SearchContext.Custom); });
@@ -507,13 +510,14 @@ namespace UnityExplorer.UI.PageModel
var nameLabelObj = UIFactory.CreateLabel(nameRowObj, TextAnchor.MiddleLeft);
var nameLabelText = nameLabelObj.GetComponent<Text>();
nameLabelText.text = "Search by name:";
nameLabelText.text = "Name contains:";
var nameLabelLayout = nameLabelObj.AddComponent<LayoutElement>();
nameLabelLayout.minWidth = 125;
nameLabelLayout.minHeight = 25;
var nameInputObj = UIFactory.CreateTMPInput(nameRowObj, 14, 0, (int)TextAlignmentOptions.MidlineLeft);
m_nameInput = nameInputObj.GetComponent<TMP_InputField>();
//m_nameInput.placeholder.gameObject.GetComponent<TextMeshProUGUI>().text = "";
var nameInputLayout = nameInputObj.AddComponent<LayoutElement>();
nameInputLayout.minWidth = 150;
nameInputLayout.flexibleWidth = 5000;
+1 -1
View File
@@ -5,7 +5,7 @@ using UnityEngine.UI;
using UnityExplorer.Input;
using System.IO;
#if CPP
using UnityExplorer.Unstrip.ImageConversion;
using UnityExplorer.Unstrip;
#endif
namespace UnityExplorer.UI
+21 -29
View File
@@ -35,11 +35,6 @@ public class SliderScrollbar
this.m_slider.Set(1f, false);
}
~SliderScrollbar()
{
Instances.Remove(this);
}
internal void Update()
{
this.RefreshVisibility();
@@ -47,39 +42,36 @@ public class SliderScrollbar
internal void RefreshVisibility()
{
if (this.m_slider && this.m_scrollbar)
{
bool shouldShow = !Mathf.Approximately(this.m_scrollbar.size, 1);
var obj = this.m_slider.handleRect.gameObject;
if (obj.activeSelf != shouldShow)
{
obj.SetActive(shouldShow);
if (shouldShow)
this.m_slider.Set(this.m_scrollbar.value, false);
else
m_slider.Set(1f, false);
}
if (!m_slider || !m_scrollbar)
{
Instances.Remove(this);
return;
}
}
bool shouldShow = !Mathf.Approximately(this.m_scrollbar.size, 1);
var obj = this.m_slider.handleRect.gameObject;
if (obj.activeSelf != shouldShow)
{
obj.SetActive(shouldShow);
if (shouldShow)
this.m_slider.Set(this.m_scrollbar.value, false);
else
m_slider.Set(1f, false);
}
}
public void OnScrollbarValueChanged(float _value)
{
//this.RefreshVisibility();
if (this.m_slider && this.m_slider.value != _value)
{
if (this.m_slider.value != _value)
this.m_slider.Set(_value, false);
}
}
public void OnSliderValueChanged(float _value)
{
if (this.m_scrollbar)
{
this.m_scrollbar.value = _value;
}
}
this.m_scrollbar.value = _value;
}
#region UI CONSTRUCTION
+1 -1
View File
@@ -8,7 +8,7 @@ using TMPro;
using System.Reflection;
using UnityExplorer.Helpers;
#if CPP
using UnityExplorer.Unstrip.AssetBundle;
using UnityExplorer.Unstrip;
#endif
namespace UnityExplorer.UI