Project Zomboid

Project Zomboid

[B42]CleanUI V2.2
redkkong 9 月 26 日 下午 7:52
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
< >
正在显示第 1 - 7 条,共 7 条留言
pedrudehuere 9 月 27 日 上午 8:08 
Thanks!
MadBeast 9 月 27 日 上午 9:45 
where can i find the 108600 file?
KrazyJas 9 月 27 日 上午 9:55 
I needed this, thanks
Rog 9 月 29 日 下午 3:26 
it works, thanks!
Darkerowl 10 月 1 日 下午 6:18 
TBH Thank you so much! I

引用自 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://psteamcommunity.yuanyoumao.com_to->formattinghelp
最后由 Darkerowl 编辑于; 10 月 1 日 下午 7:10
House of Rahl 10 月 5 日 下午 5:05 
i dun really understand. how do these lines of code fix it? where do we enter this code?
Darkerowl 10 月 6 日 下午 5:52 
引用自 House of Rahl
i dun really understand. how do these lines of code fix it? where do we enter this code?
I can tell you were to put the code if needed, unless you figured it out? LMK and ill leave a detail to follow the best that I can, the code I think fixes the inventory cap idk the full issue but worth doing just in case. Once you do it once its get easier after that.
最后由 Darkerowl 编辑于; 10 月 6 日 下午 5:55
< >
正在显示第 1 - 7 条,共 7 条留言
每页显示数: 1530 50