搜索面板条件关闭重新打开重置

This commit is contained in:
lishuo committed 2021-05-26 18:04:58 +08:00
1 parent 4e4da38252
commit e88f32e99b
8 files changed
+2780 -2674

No files matched your search

@@ -317,6 +317,51 @@ public class MapListController : PFUIPanel
isEnd = false;
GetList();
}
public void ResetPanel()
{
if (searchInput != null)
{
//empty Data
ftname = string.Empty;
hands = new List<string>();
var text = distanceOptions.GetComponent<Dropdown>().options[0].text;
distance = MapFilterOptions.distanceDict[text];
is3d = false;
isFav = false;
//empty ui
searchInput.GetComponent<InputField>().text = string.Empty;
var dDropdown = distanceOptions.GetComponent<Dropdown>();
dDropdown.value = 0;
if (diffOptions != null)
{
foreach (Transform t in diffOptions)
{
var button = t.GetComponent<Button>();
var image = t.GetComponent<Image>();
var buttonText = t.Find("Text").GetComponent<Text>();
ColorUtility.TryParseHtmlString("#23232D", out Color c);
//ColorUtility.TryParseHtmlString("#F93086", out Color c);
image.color = c;
buttonText.color = new Color(1, 1, 1, 1);
}
}
var isfav = favContainer.Find("Gou").gameObject;
isfav.SetActive(false);
var is3dUI = tdContainer.Find("Gou").gameObject;
is3dUI.SetActive(false);
if (sorts != null)
{
var drop = sorts.GetComponent<Dropdown>();
drop.value = 0;
}
Refresh();
}
}
void ResetList()
{
distance = "";
@@ -114,6 +114,13 @@ public class UserInfoController : PFUIPanel
}
}
public void Reset()
{
if (summaryPanel != null)
{
summaryPanel.Find("Panel").Find("RideResultList").GetComponent<ResultListController>().Reset();
}
}
// Update is called once per frame
void Update()
{
@@ -128,6 +128,17 @@ public class ResultListController : MonoBehaviour
pageIndex[scrollIndex] = 0;
GetList();
}
public void Reset()
{
if (searchInput != null)
{
searchInput.GetComponent<InputField>().text = "";
name = "";
Load();
StartScroll(1);
}
}
Dictionary<int, bool> isEnd = new Dictionary<int, bool>
{
{0,false },{1,false }
+2
View File
@@ -343,6 +343,7 @@ public class UIManager : MonoBehaviour
public static void ShowUserInfoPanel()
{
UIManager.Instance.UserInfoPanel.Reset();
UIManager.Show(UIManager.Instance.UserInfoPanel, UIManager.Instance.MainPanel);
}
@@ -419,6 +420,7 @@ public class UIManager : MonoBehaviour
{
Debug.Log("清空");
//App.propTextureCache["recordCache"].Clear();
UIManager.Instance.MapListPanel.ResetPanel();
UIManager.Show(UIManager.Instance.MapListPanel, UIManager.Instance.MainPanel);
}
public static void ShowMapDetailPanel(int id)