Skip to main content

Modwarningscreen

Based on game build 714014 | Last updated: 2026-03-09

Overview

ModWarningScreen is a UI screen that presents mod-related warnings to the player in a modal dialog. It is typically used to display critical messages about mod status (e.g., mods disabled, incompatibility warnings), and provides interactive options such as acknowledgment checkboxes and action buttons (e.g., "Back", "Mod Forums"). It inherits from Screen and manages its own visual hierarchy including background overlay, title, body text, optional additional text, version info, and focusable controls.

Usage example

local ModWarningScreen = require "screens/modwarningscreen"
local screen = ModWarningScreen(
"Mod Warning",
"This mod may cause instability. Proceed with caution.",
{ "Back" },
nil, -- texthalign
"Mod Name: ExampleMod v1.2.3", -- additionaltext
24, -- textsize
true -- showdisable
)
TheFrontEnd:OpenScreen(screen)

Dependencies & tags

Components used: Profile (via Profile:GetModsWarning(), Profile:SetModsWarning(), Profile:Save()), TheInputProxy, APP_VERSION, PLATFORM, STRINGS.UI.MAINSCREEN.* (localization keys). Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
blackImageFullscreen dark overlay (alpha .8) to dim background.
rootWidgetRoot container for dialog content, centered on screen.
titleTextLarge (50 pt) title text, positioned at y = 170.
textTextMain body text, wraps within 480×2 x 200 region, default font BODYTEXTFONT.
additionaltextText or nilnilOptional secondary text block, positioned above text (y = -150).
versionTextBottom-left version indicator (Rev. <APP_VERSION> <PLATFORM>).
menuMenu or nilnilHorizontal button menu if buttons parameter provided.
disablemodwarningWidget (LabelCheckbox) or nilnilCheckbox to disable future mod warnings; toggles Profile.ModsWarning.
default_focusMenu or nilself.menuInitial focus target for keyboard navigation.

Main functions

No public methods beyond the constructor are defined in this screen class. All behavior is encapsulated during construction.

Events & listeners

  • Listens to: None identified.
  • Pushes: None identified.