Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require = GLOBAL.require
- local PlayerHUD = require "screens/playerhud"
- Assets =
- {
- Asset("ATLAS", "images/newslots.xml"),
- }
- function backpackpostinit(inst)
- inst.components.equippable.equipslot = GLOBAL.EQUIPSLOTS.BACK
- end
- function amuletpostinit(inst)
- inst.components.equippable.equipslot = GLOBAL.EQUIPSLOTS.NECK
- end
- function inventorypostinit(component,inst)
- inst.components.inventory.numequipslots = 5
- end
- AddPrefabPostInit("amulet", amuletpostinit)
- AddPrefabPostInit("blueamulet", amuletpostinit)
- AddPrefabPostInit("purpleamulet", amuletpostinit)
- AddPrefabPostInit("orangeamulet", amuletpostinit)
- AddPrefabPostInit("greenamulet", amuletpostinit)
- AddPrefabPostInit("yellowamulet", amuletpostinit)
- AddComponentPostInit("inventory", inventorypostinit)
- AddPrefabPostInit("backpack", backpackpostinit)
- AddPrefabPostInit("krampus_sack", backpackpostinit)
- AddPrefabPostInit("piggyback", backpackpostinit)
- AddPrefabPostInit("icepack", backpackpostinit)
- table.insert(GLOBAL.EQUIPSLOTS, "BACK")
- GLOBAL.EQUIPSLOTS.BACK = "back"
- table.insert(GLOBAL.EQUIPSLOTS, "NECK")
- GLOBAL.EQUIPSLOTS.NECK = "neck"
- local oldSetMainCharacter = PlayerHUD.SetMainCharacter
- function PlayerHUD:SetMainCharacter(maincharacter)
- local result = oldSetMainCharacter(self, maincharacter)
- self.controls.inv:AddEquipSlot(GLOBAL.EQUIPSLOTS.BACK, "images/newslots.xml", "back.tex")
- self.controls.inv:AddEquipSlot(GLOBAL.EQUIPSLOTS.NECK, "images/newslots.xml", "neck.tex")
- self.controls.inv.bg:SetScale(1.25,1,1.25)
- local bp = maincharacter.components.inventory:GetEquippedItem(GLOBAL.EQUIPSLOTS.BACK)
- if bp and bp.components.container then
- bp.components.container:Close()
- bp.components.container:Open(maincharacter)
- end
- return result
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement