Jump to content

Ysa

Member
  • Posts

    8
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Ysa got a reaction from igormaozao in "Drop All" button into loot window   
    Try 
     
    local floorContainer = ISInventoryPage.GetFloorContainer(self.player)  
    I was looking through PZ's own lua, this file ISInventoryPage.lua is very helpful to understand what's what with containers in PZ.
    You can find game sources here <path>\ProjectZomboid\media\lua
     
  2. Like
    Ysa got a reaction from igormaozao in "Drop All" button into loot window   
    Hey, do something like this:
     
    local ISInventoryPagecreateChildren = ISInventoryPage.createChildren function ISInventoryPage:createChildren() ISInventoryPagecreateChildren(self) local titleBarHeight = self:titleBarHeight(); local textWidth = getTextManager():MeasureStringX(UIFont.Small, "your_text"); local button = ISButton:new(0, 0, textWidth, titleBarHeight, "your_text", self, your_function); button:initialise(); button.tooltip = "your_tooltip" button.borderColor.a = 0.0; button.backgroundColor.a = 0.0; button.backgroundColorMouseOver.a = 0.7; self:addChild(button); button:setVisible(true); -- I'd also expose button for other mods if planning to release public self.MY_MOD_BUTTON_NAME = button end  
    or check out my mod's source here https://github.com/SharePickle/easy-drop-n-loot/blob/master/media/lua/client/KADropnLoot/KAInventoryPageButtons.lua
×
×
  • Create New...