Implement setting disc music as main theme

This commit is contained in:
Melledy
2025-12-25 18:06:35 -08:00
parent fba1dfccd6
commit 297255a316
2 changed files with 31 additions and 1 deletions
@@ -75,6 +75,7 @@ public class Player implements GameDatabaseObject {
private int skinId;
private int titlePrefix;
private int titleSuffix;
private long music;
private int[] honor;
private int[] showChars;
private int[] boards;
@@ -344,6 +345,22 @@ public class Player implements GameDatabaseObject {
return true;
}
public boolean setMusic(long id) {
// Make sure we own the disc
if (id != 0 && !this.getCharacters().hasDisc((int) id)) {
return false;
}
// Set main menu music
this.music = id;
// Update in database
Nebula.getGameDatabase().update(this, this.getUid(), "music", this.getMusic());
// Success
return true;
}
public boolean setSkin(int skinId) {
// Skip if we are setting the same skin
if (this.skinId == skinId) {
@@ -871,6 +888,7 @@ public class Player implements GameDatabaseObject {
.setSigninIndex(this.getSignInIndex())
.setTowerTicket(this.getProgress().getTowerTickets())
.setDailyShopRewardStatus(this.getQuestManager().hasDailyReward())
.setMusicInfo(this.getMusic())
.setAchievements(new byte[64]);
var acc = proto.getMutableAcc()