改动与优化

This commit is contained in:
2026-07-20 22:19:25 +08:00
parent 0a0872c4f4
commit b5d1cdcbc5
83 changed files with 2475 additions and 276 deletions
+27 -31
View File
@@ -165,7 +165,13 @@ public class UI_Idols : MonoBehaviour
private void HandleQuitClicked()
{
gameObject.SetActive(false);
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
private void BeginStartupSkillValidation()
@@ -320,6 +326,7 @@ public class UI_Idols : MonoBehaviour
SetObjectState(skillsObj, idolSkillsToggle != null && idolSkillsToggle.isOn);
SetObjectState(skinsObj, idolSkinsToggle != null && idolSkinsToggle.isOn);
SetObjectState(weaponObj, idolWeaponToggle != null && idolWeaponToggle.isOn);
PlayActiveSectionRefresh();
}
private bool AnySectionToggleOn()
@@ -421,6 +428,7 @@ public class UI_Idols : MonoBehaviour
IdolLevelSnapshot snapshot = BuildLevelSnapshot(hero);
GameObject instance = GetOrCreateCard(visibleCardCount);
UI_OrderedEntryAnimator.PlaySingle(instance, visibleCardCount, 0.18f, 0.015f, -18f, 0.965f, true);
visibleCardCount++;
idolCardPrefab card = instance.GetComponent<idolCardPrefab>();
@@ -567,6 +575,7 @@ public class UI_Idols : MonoBehaviour
ApplyBehaviourRadar(hero);
PopulateSpecialSkills(hero);
UI_OrderedEntryAnimator.PlayRefresh(rightPanel, 0.16f, -8f, 0.99f, true);
}
private void SetIdolDocumentText(string value)
@@ -693,6 +702,7 @@ public class UI_Idols : MonoBehaviour
}
GameObject instance = GetOrCreateSpecialSkillEntry(shown);
UI_OrderedEntryAnimator.PlaySingle(instance, shown, 0.16f, 0.025f, -10f, 0.97f, true);
ssPrefab display = instance.GetComponent<ssPrefab>();
if (display != null)
@@ -839,6 +849,19 @@ public class UI_Idols : MonoBehaviour
return entry;
}
private void PlayActiveSectionRefresh()
{
GameObject active = null;
if (levelsObj != null && levelsObj.activeSelf) active = levelsObj;
else if (voicesObj != null && voicesObj.activeSelf) active = voicesObj;
else if (detailPassageObj != null && detailPassageObj.activeSelf) active = detailPassageObj;
else if (skillsObj != null && skillsObj.activeSelf) active = skillsObj;
else if (skinsObj != null && skinsObj.activeSelf) active = skinsObj;
else if (weaponObj != null && weaponObj.activeSelf) active = weaponObj;
UI_OrderedEntryAnimator.PlayRefresh(active, 0.16f, -8f, 0.99f, true);
}
private static void SetText(Text target, string value)
{
if (target != null)
@@ -939,7 +962,7 @@ public class UI_Idols : MonoBehaviour
SetText(il.damageResistant, FormatGrowthPercent(baseLevelInfo != null ? baseLevelInfo.damageResistance : levelInfo.damageResistance, levelInfo.damageResistance));
SetText(il.scoreEfficency, FormatGrowthPercent(baseLevelInfo != null ? baseLevelInfo.scoreEfficiency : levelInfo.scoreEfficiency, levelInfo.scoreEfficiency));
int baseSlotAmount = baseLevelInfo != null ? baseLevelInfo.skill_slot_limited : levelInfo.skill_slot_limited;
int effectiveSlotAmount = currentSelectedHero != null ? currentSelectedHero.GetEffectiveSkillSlotLimit() : levelInfo.skill_slot_limited;
int effectiveSlotAmount = currentSelectedHero != null ? AllyHeroLevelRuntimeResolver.GetEffectiveSkillSlotLimit(currentSelectedHero) : levelInfo.skill_slot_limited;
SetText(il.slotAmount, FormatGrowthInt(baseSlotAmount, effectiveSlotAmount));
SetText(il.miss_mr, levelInfo.manaGainOnMiss.ToString());
SetText(il.good_mr, levelInfo.manaGainGood.ToString());
@@ -953,39 +976,12 @@ public class UI_Idols : MonoBehaviour
private AllyHero_SO.AllyLevelInfo GetEffectiveLevelInfoFromLedger(AllyHero_SO hero)
{
AllyHero_SO.AllyLevelInfo baseLevelInfo = GetBaseLevelInfoFromLedger(hero);
return hero != null ? hero.GetEffectiveLevelInfoWithEquipment(baseLevelInfo) : null;
return AllyHeroLevelRuntimeResolver.GetEffectiveLevelInfo(hero);
}
private AllyHero_SO.AllyLevelInfo GetBaseLevelInfoFromLedger(AllyHero_SO hero)
{
if (hero == null || hero.levelStats == null || hero.levelStats.Count == 0)
{
return null;
}
List<AllyHero_SO.AllyLevelInfo> levels = new List<AllyHero_SO.AllyLevelInfo>();
for (int i = 0; i < hero.levelStats.Count; i++)
{
if (hero.levelStats[i] != null)
{
levels.Add(hero.levelStats[i]);
}
}
if (levels.Count == 0)
{
return null;
}
levels.Sort((left, right) => left.requiredEXP.CompareTo(right.requiredEXP));
int index = ResolveUnlockedLevelIndexFromLedger(hero, levels, AllyHeroDeployLedger.EnsureInstance());
if (index < 0 || index >= levels.Count)
{
return null;
}
return levels[index];
return AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(hero);
}
private int ResolveUnlockedLevelIndexFromLedger(AllyHero_SO hero, List<AllyHero_SO.AllyLevelInfo> levels, AllyHeroDeployLedger ledger)