Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Events.OnMainMenuEnter.Add(function()
- if not MainScreen or not MainScreen.instance then return end
- local self = MainScreen.instance
- if self.resetLua then return end
- local UI_BORDER_SPACING = 10
- local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small)
- local BUTTON_HGT = FONT_HGT_SMALL + 6
- local btnWidth = UI_BORDER_SPACING*2 + math.max(
- getTextManager():MeasureStringX(UIFont.Small, getText("UI_Details")),
- getTextManager():MeasureStringX(UIFont.Small, getText("UI_NewGame_Mods")),
- getTextManager():MeasureStringX(UIFont.Small, getText("UI_TermsOfService_MainMenu")),
- getTextManager():MeasureStringX(UIFont.Small, getText("UI_ResetLua")),
- getTextManager():MeasureStringX(UIFont.Small, getText("UI_ReportBug"))
- )
- local x = self.versionDetail and self.versionDetail.x or (self.width - btnWidth - UI_BORDER_SPACING*4)
- local y = self.height - BUTTON_HGT
- if self.termsOfService then
- y = self.termsOfService.y - UI_BORDER_SPACING - BUTTON_HGT
- elseif self.modListDetail then
- y = self.modListDetail.y - UI_BORDER_SPACING - BUTTON_HGT
- elseif self.reportBug then
- y = self.reportBug.y - UI_BORDER_SPACING - BUTTON_HGT
- end
- self.resetLua = ISButton:new(x, y, btnWidth, BUTTON_HGT, getText("UI_ResetLua"), self, function()
- getCore():ResetLua("default", "Force")
- end)
- self.resetLua:initialise()
- self.resetLua.borderColor = {r=0.2, g=0.8, b=1, a=1}
- self.resetLua.textColor = {r=0.2, g=0.8, b=1, a=1}
- self:addChild(self.resetLua)
- self.resetLua:setAnchorLeft(false)
- self.resetLua:setAnchorTop(false)
- self.resetLua:setAnchorRight(true)
- self.resetLua:setAnchorBottom(true)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement