重做粗略选曲界面 浮动小游戏可开关
修复一些小bug和加入部分新功能
This commit is contained in:
@@ -20,8 +20,12 @@ public class SongDetailsUI : MonoBehaviour
|
||||
public Text songSerialNumberText;
|
||||
public Text personalRecordText;
|
||||
|
||||
// 新增:显示谱面(个人)分的文本
|
||||
public Text chartScoreText;
|
||||
|
||||
public Text thisSong_progressText;
|
||||
public Text thisSong_lastScoreText;
|
||||
public Text thisSong_lastScoreText; // will show last run total score if available
|
||||
public Text idolRecordText;
|
||||
//public Image songImage;
|
||||
|
||||
public int id_of_thisSong;
|
||||
@@ -122,13 +126,54 @@ public class SongDetailsUI : MonoBehaviour
|
||||
{
|
||||
difficultyText.text = entry.difficultyLEVEL.ToString();
|
||||
difficultyDesciptionText.text = entry.difficultyDescription;
|
||||
personalRecordText.text = entry.personalRecordForThisDifficulty.ToString();
|
||||
|
||||
// read values from SongData (SO)
|
||||
int chartPersonal = currentSong.GetPersonalRecord(difficulty); // 谱面个人分
|
||||
int idol = currentSong.GetIdolRecord(difficulty); // 偶像分
|
||||
|
||||
// Determine total: prefer stored total if present (>0), otherwise compute chartPersonal + idol
|
||||
int total;
|
||||
if (entry.totalPersonalRecordForThisDifficulty > 0)
|
||||
{
|
||||
total = entry.totalPersonalRecordForThisDifficulty;
|
||||
}
|
||||
else
|
||||
{
|
||||
total = chartPersonal + idol;
|
||||
}
|
||||
|
||||
// show total (personalRecord) and idol separately
|
||||
personalRecordText.text = total.ToString();
|
||||
if (idolRecordText != null)
|
||||
idolRecordText.text = idol.ToString();
|
||||
|
||||
// show chart personal (谱面分) if UI text provided
|
||||
if (chartScoreText != null)
|
||||
chartScoreText.text = chartPersonal.ToString();
|
||||
|
||||
// show last run total score if UI text provided
|
||||
if (thisSong_lastScoreText != null)
|
||||
{
|
||||
int lastRun = currentSong.GetChartScore(difficulty);
|
||||
thisSong_lastScoreText.text = lastRun.ToString();
|
||||
}
|
||||
|
||||
// also keep per-entry convenience fields in sync for inspector visibility
|
||||
entry.chartPersonalRecordForThisDifficulty = chartPersonal;
|
||||
entry.idolPersonalRecordForThisDifficulty = idol;
|
||||
entry.totalPersonalRecordForThisDifficulty = total;
|
||||
}
|
||||
else
|
||||
{
|
||||
difficultyText.text = difficulty.ToString();
|
||||
difficultyDesciptionText.text = "";
|
||||
personalRecordText.text = "0";
|
||||
if (idolRecordText != null)
|
||||
idolRecordText.text = "0";
|
||||
if (chartScoreText != null)
|
||||
chartScoreText.text = "0";
|
||||
if (thisSong_lastScoreText != null)
|
||||
thisSong_lastScoreText.text = "0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user