Advertisement
TwisTonFire

Zomboid mainscreen patch Build 42

Jun 10th, 2025 (edited)
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. Events.OnMainMenuEnter.Add(function()
  2. if not MainScreen or not MainScreen.instance then return end
  3. local self = MainScreen.instance
  4. if self.resetLua then return end
  5.  
  6. local UI_BORDER_SPACING = 10
  7. local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small)
  8. local BUTTON_HGT = FONT_HGT_SMALL + 6
  9. local btnWidth = UI_BORDER_SPACING*2 + math.max(
  10. getTextManager():MeasureStringX(UIFont.Small, getText("UI_Details")),
  11. getTextManager():MeasureStringX(UIFont.Small, getText("UI_NewGame_Mods")),
  12. getTextManager():MeasureStringX(UIFont.Small, getText("UI_TermsOfService_MainMenu")),
  13. getTextManager():MeasureStringX(UIFont.Small, getText("UI_ResetLua")),
  14. getTextManager():MeasureStringX(UIFont.Small, getText("UI_ReportBug"))
  15. )
  16.  
  17. local x = self.versionDetail and self.versionDetail.x or (self.width - btnWidth - UI_BORDER_SPACING*4)
  18. local y = self.height - BUTTON_HGT
  19.  
  20. if self.termsOfService then
  21. y = self.termsOfService.y - UI_BORDER_SPACING - BUTTON_HGT
  22. elseif self.modListDetail then
  23. y = self.modListDetail.y - UI_BORDER_SPACING - BUTTON_HGT
  24. elseif self.reportBug then
  25. y = self.reportBug.y - UI_BORDER_SPACING - BUTTON_HGT
  26. end
  27.  
  28. self.resetLua = ISButton:new(x, y, btnWidth, BUTTON_HGT, getText("UI_ResetLua"), self, function()
  29. getCore():ResetLua("default", "Force")
  30. end)
  31. self.resetLua:initialise()
  32. self.resetLua.borderColor = {r=0.2, g=0.8, b=1, a=1}
  33. self.resetLua.textColor = {r=0.2, g=0.8, b=1, a=1}
  34. self:addChild(self.resetLua)
  35. self.resetLua:setAnchorLeft(false)
  36. self.resetLua:setAnchorTop(false)
  37. self.resetLua:setAnchorRight(true)
  38. self.resetLua:setAnchorBottom(true)
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement