feat: implement hardcore hearts with game mode lock
Display hardcore heart textures when a world is in hardcore mode, matching Java Edition behavior. Hearts switch between normal/hardcore across all states (poison, wither, flash) and all HUD resolutions. C++ changes: - IUIScene_HUD: check isHardcore() and call SetHardcoreMode() each tick - UIScene_HUD: send hardcore boolean to Flash via Iggy, invalidate SetHealth dirty check on state change to force heart redraw - CreateWorldMenu/LoadMenu: lock game mode to Survival when hardcore - MinecraftServer: gate server.properties hardcore override behind MINECRAFT_SERVER_BUILD so offline worlds preserve their saved flag SWF changes (via new Java tools): - AddHardcoreBitmaps: adds 10 hardcore heart bitmaps to graphics SWFs - AddHardcoreHearts: adds 10 new frames (15-24) to health sprite - PatchHudABC: patches HUD ActionScript bytecode with SetHardcore method and frame offset logic (+14 normal/poison, +6 wither) Also updates README changelog styling with consistent ### headings.
This commit is contained in:
@@ -655,6 +655,23 @@ void UIScene_HUD::SetHorseJumpBarProgress(float progress)
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_HUD::SetHardcoreMode(bool bHardcore)
|
||||
{
|
||||
IggyDataValue result;
|
||||
IggyDataValue value[1];
|
||||
value[0].type = IGGY_DATATYPE_boolean;
|
||||
value[0].boolval = bHardcore;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetHardcore , 1 , value );
|
||||
|
||||
// When hardcore state changes, invalidate SetHealth's dirty check
|
||||
// so hearts are redrawn with the correct frame set on the next tick
|
||||
if(bHardcore != m_lastHealthHardcore)
|
||||
{
|
||||
m_lastHealthHardcore = bHardcore;
|
||||
m_lastMaxHealth = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_HUD::SetHealthAbsorb(int healthAbsorb)
|
||||
{
|
||||
if(m_iCurrentHealthAbsorb != healthAbsorb)
|
||||
|
||||
Reference in New Issue
Block a user