The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

HUD API
☢ Nato Potato ☢  [开发者] 2021 年 5 月 15 日 下午 9:10
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"
最后由 ☢ Nato Potato ☢ 编辑于; 2021 年 5 月 15 日 下午 9:11
< >
正在显示第 1 - 1 条,共 1 条留言
☢ Nato Potato ☢  [开发者] 2021 年 5 月 15 日 下午 9:18 
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
最后由 ☢ Nato Potato ☢ 编辑于; 2021 年 5 月 15 日 下午 9:35
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50