This commit is contained in:
2026-07-10 00:46:23 +08:00
parent 2d550bd2a0
commit 18aff7eb28
4 changed files with 173 additions and 41 deletions
@@ -88,12 +88,17 @@ public class UIHome_BY_BackPackPanel : SubUIBase
return;
}
APIRequestList.UpdateUserName(newName, (result) =>
UIManager.Instance.ShowTiShi($"确定要将名字改为\"{newName}\"吗?", () =>
{
UIManager.Instance.ShowBoardError("改名成功");
GameManager.Instance.user.BaseInfo.userName = newName;
tMPText_NewName.text = "";
changNamePanel.SetActive(false);
APIRequestList.UpdateUserName(newName, (result) =>
{
UIManager.Instance.ShowBoardError("改名成功");
// 更新本地用户数据并触发 OnUserDataChanged,刷新主界面等订阅面板
GameManager.Instance.user.BaseInfo.userName = newName;
GameManager.Instance.UpdataUserData(GameManager.Instance.user);
tMPText_NewName.text = "";
changNamePanel.SetActive(false);
});
});
}