The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

HUD API
☢ Nato Potato ☢  [developer] 15 May, 2021 @ 9:10pm
Repentance Updates
as part of the compatibility updates HUD API will use the value REPENTANCE to check if the player is running the repentance dlc, you can use this in a simple if statement to add alternative code


HUDs will need to be updated to replace instances of player.SecondaryActiveItem to be compatible

here are examples of how the default huds were updated:
replaced "local activeitem2 = player.SecondaryActiveItem.Item" with
"local activeitem2 = 0
if REPENTANCE then
activeitem2 = player:GetActiveItem(1)
else
activeitem2 = player.SecondaryActiveItem.Item
end"

replaced "if player.SecondaryActiveItem.Charge == nil then" with
"if (REPENTANCE and player:GetActiveCharge(1) == nil) or (REPENTANCE == false and player.SecondaryActiveItem.Charge == nil) then"

replaced "local charges = player.SecondaryActiveItem.Charge + player.SecondaryActiveItem.BatteryCharge" with
"local charges = 0
if REPENTANCE then
charges = player:GetActiveCharge(1) + player:GetBatteryCharge(1)
else
charges = player.SecondaryActiveItem.Charge + player.SecondaryActiveItem.BatteryCharge
end"

replaced "local itemcharge = Isaac.GetItemConfig():GetCollectible(player.SecondaryActiveItem.Item).MaxCharges" with
"local itemcharge = Isaac.GetItemConfig():GetCollectible(activeitem2).MaxCharges"
Last edited by ☢ Nato Potato ☢; 15 May, 2021 @ 9:11pm
< >
Showing 1-1 of 1 comments
☢ Nato Potato ☢  [developer] 15 May, 2021 @ 9:18pm 
the API will also have the value HUDAPIabstyle that can be set in the config menu and that you can check if you want your hud to have a mode that more closely matches with the AB+ style hud even if the player is using repentance

e.g. to move a sprite and make it smaller in 'repentance mode' but not 'ab+ mode'
if REPENTANCE and HUDAPIabstyle == false then
HUDAPI.GetSpriteByID(1).RenderOffset = Vector(3,8)
HUDAPI.SpriteList[1].Scale = Vector(0.5,0.5)
end
Last edited by ☢ Nato Potato ☢; 15 May, 2021 @ 9:35pm
< >
Showing 1-1 of 1 comments
Per page: 1530 50