Skip to main content

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

PropertyTypeDefault ValueDescription
callbackfnfunctionnilFunction to invoke when the popup is dismissed without purchase.
closingbooleanfalseInternal flag indicating whether dismissal animation is in progress.
sale_image_timenumbernilAccumulator used to animate the sale image scale.

Main functions

GoAway(purchased)

  • Description: Initiates the dismissal animation for the popup. If purchased is false, triggers a fade-out transition and invokes callbackfn.
  • Parameters:
    • purchased (boolean) – if true, skips the fade-out and callback; used when the user proceeds to the full game.
  • Returns: Nothing.
  • Error states: No-op if closing is already true.

Events & listeners

  • Listens to: Update (via OnUpdate(dt)) – checks TheSim:IsDemoExpired() and animates sale_image.
  • Pushes: None identified.