UI更改与功能修正

This commit is contained in:
YiHan0621
2025-09-17 16:22:06 +08:00
parent 0fd35d8c21
commit 3f425c9434
191 changed files with 1271 additions and 4307 deletions

View File

@@ -100,7 +100,7 @@ namespace TcgEngine.UI
//Set power abilities hover text
foreach (IconButton btn in hero_powers)
{
CardData icard = CardData.Get(btn.value);
CardData icard = CardData.Get(btn.GetValue());
HoverTargetUI hover = btn.GetComponent<HoverTargetUI>();
AbilityData iability = icard?.GetAbility(AbilityTrigger.Activate);
if (icard != null && hover != null && iability != null)
@@ -198,6 +198,9 @@ namespace TcgEngine.UI
RefreshStarterDeck();
}
/// <summary>
/// 筛选刷新
/// </summary>
private void RefreshFilters()
{
search.text = "";
@@ -388,7 +391,7 @@ namespace TcgEngine.UI
foreach (IconButton btn in hero_powers)
{
if (deck.hero != null && btn.value == deck.hero.tid)
if (deck.hero != null && btn.GetValue() == deck.hero.tid)
btn.Activate();
}
@@ -615,7 +618,7 @@ namespace TcgEngine.UI
{
foreach (TeamData team in TeamData.GetAll())
{
if (button.value == team.id)
if (button.GetValue() == TeamTitleData.Team(team.id))
filter_team = team;
}
}
@@ -806,7 +809,7 @@ namespace TcgEngine.UI
foreach (IconButton btn in hero_powers)
{
if (btn.IsActive())
return btn.value;
return btn.GetValue();
}
return "";
}

View File

@@ -47,8 +47,8 @@ namespace TcgEngine.UI
private bool isHideObject = false;
public List<string> Usersid = new List<string>();
UserData udata = ApiClient.Get().UserData;
private UserData udata;
protected override void Awake()
{
base.Awake();
@@ -59,6 +59,7 @@ namespace TcgEngine.UI
my_ladderLine.onClick += OnClickRankLine;
InitLines();
udata = ApiClient.Get().UserData;
}
private void OnDestroy()
@@ -288,6 +289,7 @@ namespace TcgEngine.UI
RefreshPanel();
RefreshLadderPanel();
ladderRank.Show();
udata = ApiClient.Get().UserData;
}
public override void Hide(bool instant = false)

View File

@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using TcgEngine.Client;
@@ -55,6 +56,7 @@ namespace TcgEngine.UI
public Text edit_error;
private string username;
private string _userPlayerID;
private UserData user_data;
private static PlayerPanel instance;
@@ -89,7 +91,6 @@ namespace TcgEngine.UI
user_data = Authenticator.Get().UserData;
else
user_data = await ApiClient.Get().LoadUserData(username);
RefreshPanel();
}
@@ -131,7 +132,7 @@ namespace TcgEngine.UI
defeats.text = user.defeats.ToString();
cards_all.text = user.CountUniqueCards() + " / " + CardData.GetAllDeckbuilding().Count;
buttons_area?.SetActive(IsYou()); //Buttons like logout only active if your account
// buttons_area?.SetActive(IsYou()); //Buttons like logout only active if your account
account_button?.SetActive(Authenticator.Get().IsApi());
sell_button?.SetActive(Authenticator.Get().IsApi());
}
@@ -419,7 +420,7 @@ namespace TcgEngine.UI
public override void Show(bool instant = false)
{
base.Show(instant);
ShowPlayer();
ShowPlayer(); // 每次显示
}
public override void Hide(bool instant = false)