correction du bug d'affichage des aventuriers dans le panel de recrutement. Il y a desormais bien 20 aventuriers generes. ajustement bouton et texte dans le panel de creation de partie

This commit is contained in:
toine 2025-10-01 13:07:11 +02:00
parent ccf63574e4
commit 2ab20b0e8c
9 changed files with 1556 additions and 30 deletions

View file

@ -12,11 +12,14 @@ namespace GameUI.Runtime
{
#region Unity API
private void Start()
void OnEnable()
{
AdventurerSignals.OnPortraitCaptured += OnPortraitCapturedHandler;
AdventurerSignals.OnRefresh += DisplayAdventurers;
}
private void Start()
{
foreach (var txt in GetComponentsInChildren<TMP_Text>())
{
txt.text = LocalizationSystem.Instance.GetLocalizedText(txt.text);
@ -26,7 +29,7 @@ namespace GameUI.Runtime
}
private void OnDestroy()
private void OnDisable()
{
AdventurerSignals.OnPortraitCaptured -= OnPortraitCapturedHandler;
AdventurerSignals.OnRefresh -= DisplayAdventurers;

View file

@ -33,21 +33,16 @@ namespace GameUI.Runtime
void OnDisable()
{
// Intentionally left empty during debug to validate first-open rendering.
// (We avoid destroying children here to keep the list intact between toggles.)
//
}
IEnumerator OpenRoutine()
{
Info("On rentre dans la routine <OpenRoutine>");
// Defer one frame to let Canvas/Scaler/Mask finish their activation cycle
yield return null;
// Generate only if empty (prevents duplicate spawns on reopen)
if (_content != null && _content.childCount == 0)
{
Clear();
GenerateAdventurer(20);
}
GenerateAdventurer(20);
// Wait until end of frame to ensure instantiated elements are present before forcing layout
yield return new WaitForEndOfFrame();

View file

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 6316a3aa107e4d8ba4cd0a842e60caa6
timeCreated: 1754590062