Demooverpopup
Based on game build 714014 | Last updated: 2026-03-09
Overview
DemoOverPopup is a UI screen that appears when the demo period expires in Don't Starve Together. It presents a styled overlay with promotional artwork, a title, body text, and a quit button. As a subclass of Screen, it integrates into the TheFrontEnd screen stack and handles its own animation transitions for appearance and dismissal.
Usage example
local DemoOverPopup = require "screens/demooverpopup"
DemoOverPopup(function()
-- Called when popup closes without purchase
TheFrontEnd:PushScreen("mainmenu")
end)
Dependencies & tags
Components used: None identified
Tags: Adds popup; adds global TAB
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
callbackfn | function | nil | Function to invoke when the popup is dismissed without purchase. |
closing | boolean | false | Internal flag indicating whether dismissal animation is in progress. |
sale_image_time | number | nil | Accumulator used to animate the sale image scale. |
Main functions
GoAway(purchased)
- Description: Initiates the dismissal animation for the popup. If
purchasedisfalse, triggers a fade-out transition and invokescallbackfn. - Parameters:
purchased(boolean) – iftrue, skips the fade-out and callback; used when the user proceeds to the full game.
- Returns: Nothing.
- Error states: No-op if
closingis alreadytrue.
Events & listeners
- Listens to:
Update(viaOnUpdate(dt)) – checksTheSim:IsDemoExpired()and animatessale_image. - Pushes: None identified.