Project Zomboid

Project Zomboid

[B42]CleanUI V2.1
redkkong 26 Sep @ 7:52pm
42.12.0 Temporary inventory capacity fix
108600\3437629766\mods\CleanUI\42\media\lua\client\ISUI\ISInventoryPage.lua

Code to find (existing code):

-- lootAll Button & weightLabel
if not self.onCharacter and self.lootAll and self.lootAll:getIsVisible() then
if self.lootAll:isMouseOver() then
self.lootAll:setTitle(getText("IGUI_invpage_Loot_all"))
self.lootAll:setWidth(textWid)
else
self.lootAll:setTitle(weightLabel)
self.lootAll:setWidth(textWid)
end
self.lootAll:setX(self.closeButton:getX() - self.padding - self.lootAll:getWidth())
end



Modified code

-- lootAll Button & weightLabel
if not self.onCharacter then
local showLootAllButton = self.lootAll and self.lootAll:getIsVisible()

if showLootAllButton then
if self.lootAll:isMouseOver() then
self.lootAll:setTitle(getText("IGUI_invpage_Loot_all"))
self.lootAll:setWidth(textWid)
else
self.lootAll:setTitle(weightLabel)
self.lootAll:setWidth(textWid)
end
self.lootAll:setX(self.closeButton:getX() - self.padding - self.lootAll:getWidth())
else
local weightWidOnly = getTextManager():MeasureStringX(UIFont.Small, weightLabel)
local weightX = self.closeButton:getX() - self.padding - weightWidOnly
local weightY = (titleBarHeight - FONT_HGT_SMALL) / 2
self:drawText(weightLabel, weightX, weightY, 1, 1, 1, 1, UIFont.Small)
end
end

Temporary inventory capacity fix
< >
Showing 1-5 of 5 comments
Thanks!
MadBeast 27 Sep @ 9:45am 
where can i find the 108600 file?
KrazyJas 27 Sep @ 9:55am 
I needed this, thanks
Rognvald 29 Sep @ 3:26pm 
it works, thanks!
TBH Thank you so much! I

Originally posted by MadBeast:
where can i find the 108600 file?
SteamLibrary\steamapps\workshop\content\108600\3437629766\mods\CleanUI\42\media\lua\client\ISUI

Also I don't know why when code is posted to Steam you would not add it to a code block so the format of the if to end and the indents are not in normal locations. I know how to code but not everyone does or knows that pasting it as above will break it. Markdown like formatting allows for a code blocks helps for those who don't know .lua or code at all to just copy and paste the code needed in the location specified.

Code help

Old Code
-- lootAll Button & weightLabel if not self.onCharacter and self.lootAll and self.lootAll:getIsVisible() then if self.lootAll:isMouseOver() then self.lootAll:setTitle(getText("IGUI_invpage_Loot_all")) self.lootAll:setWidth(textWid) else self.lootAll:setTitle(weightLabel) self.lootAll:setWidth(textWid) end self.lootAll:setX(self.closeButton:getX() - self.padding - self.lootAll:getWidth()) end


New Code

-- lootAll Button & weightLabel if not self.onCharacter then local showLootAllButton = self.lootAll and self.lootAll:getIsVisible() if showLootAllButton then if showLootAllButton then self.lootAll:setTitle(getText("IGUI_invpage_Loot_all")) self.lootAll:setWidth(textWid) else self.lootAll:setTitle(weightLabel) self.lootAll:setWidth(textWid) end self.lootAll:setX(self.closeButton:getX() - self.padding - self.lootAll:getWidth()) else local weightWidOnly = getTextManager():MeasureStringX(UIFont.Small, weightLabel) local weightX = self.closeButton:getX() - self.padding - weightWidOnly local weightY = (titleBarHeight - FONT_HGT_SMALL) / 2 self:drawText(weightLabel, weightX, weightY, 1, 1, 1, 1, UIFont.Small) end end
steam for long code runs makes it look like the code goes on line down but when you copy and paste it is pasted normal

I think this is correct but its based off my Python work im no Lua coder.

http://gtm.steamproxy.vip_to->formattinghelp
Last edited by Darkerowl; 1 Oct @ 7:10pm
< >
Showing 1-5 of 5 comments
Per page: 1530 50