Implement setting headicons/skins

This commit is contained in:
Melledy
2025-11-02 19:04:23 -08:00
parent 88f3b246c8
commit 42f8233132
9 changed files with 244 additions and 26 deletions

View File

@@ -295,35 +295,11 @@ public class Character implements GameDatabaseObject {
return false;
}
//
var skinData = GameData.getCharacterSkinDataTable().get(skinId);
if (skinData == null) {
return false;
}
// Make sure we have the skin
if (skinData.getCharId() != this.getCharId()) {
if (!getPlayer().getInventory().hasSkin(skinId)) {
return false;
}
switch (skinData.getType()) {
case 1:
// Default skin, always allow
break;
case 2:
// Ascension skin, only allow if the character has the right ascension level
if (this.getAdvance() < this.getData().getAdvanceSkinUnlockLevel()) {
return false;
}
break;
default:
// Extra skin, only allow if we have the skin unlocked
if (!getPlayer().getInventory().getExtraSkins().contains(skinId)) {
return false;
}
break;
}
// Set skin
this.skin = skinId;