成就系统 巨大修改 新的ui 黑白效果 等一堆

This commit is contained in:
2026-01-23 18:43:23 +08:00
parent f3ece026ca
commit 0e47864569
256 changed files with 134131 additions and 31192 deletions
+62 -3
View File
@@ -226,6 +226,50 @@ public class selected_songInfo : MonoBehaviour
c_DifficultyImage.color = chosen;
}
}
// Update sumScore_thisDifficulty based on currently selected difficulty
if (sumScore_thisDifficulty != null)
{
int sel = song.thisLevel_selectedDifficultyID;
int totalForDifficulty = 0;
// Try to find ChartFileEntry for this difficulty
if (song.chartFiles != null)
{
foreach (var entry in song.chartFiles)
{
if (entry != null && entry.difficulty == sel)
{
if (entry.totalPersonalRecordForThisDifficulty > 0)
{
totalForDifficulty = entry.totalPersonalRecordForThisDifficulty;
}
else
{
int p = song.GetPersonalRecord(sel);
int i = song.GetIdolRecord(sel);
totalForDifficulty = p + i;
}
break;
}
}
}
// fallback to maps if chartFiles did not contain entry
if (totalForDifficulty == 0)
{
int p = song.GetPersonalRecord(sel);
int i = song.GetIdolRecord(sel);
totalForDifficulty = p + i;
}
sumScore_thisDifficulty.text = totalForDifficulty.ToString();
}
// Update total_gameTime once from SongData.game_enterTimes (no dynamic change on difficulty switch)
if (total_gameTime != null)
{
int enterTimes = song.game_enterTimes;
total_gameTime.text = enterTimes.ToString();
}
}
else
{
@@ -247,6 +291,9 @@ public class selected_songInfo : MonoBehaviour
// restore original difficulty button backgrounds and text colors
SetDifficultyButtonBackground(-1);
if (sumScore_thisDifficulty != null) sumScore_thisDifficulty.text = "0";
if (total_gameTime != null) total_gameTime.text = "0";
}
}
@@ -326,7 +373,7 @@ public class selected_songInfo : MonoBehaviour
}
}
private void OnEnterDetailPageClicked()
public void OnEnterDetailPageClicked()
{
if (SongDataHolder.SelectedSongData != null)
{
@@ -705,10 +752,11 @@ public class selected_songInfo : MonoBehaviour
var pauseMgr = PauseManager.Instance ?? FindObjectOfType<PauseManager>();
pauseMgr?.Pause(false);
// small buffer to avoid hitching immediately after unpause: wait configured realtime delay from GameManager
// small buffer to avoid hitching immediately after unpause: wait configured delay from GameManager
// Use scaled WaitForSeconds so PauseManager (Escape) will pause the countdown
float unpauseBuffer = 3f;
if (gameManager != null) unpauseBuffer = Mathf.Max(0f, gameManager.playbackStartDelay);
yield return new WaitForSecondsRealtime(unpauseBuffer);
yield return new WaitForSeconds(unpauseBuffer);
// Start spawning notes
if (beatmapManager != null && beatmapManager.beatmap != null)
@@ -811,4 +859,15 @@ public class selected_songInfo : MonoBehaviour
}
return 0f;
}
private string FormatSeconds(int totalSeconds)
{
if (totalSeconds <= 0) return "0:00";
int hours = totalSeconds / 3600;
int minutes = (totalSeconds % 3600) / 60;
int seconds = totalSeconds % 60;
if (hours > 0)
return string.Format("{0}:{1:D2}:{2:D2}", hours, minutes, seconds);
return string.Format("{0}:{1:D2}", minutes, seconds);
}
}