Skip to main content

Scrapmonocleover

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

Overview

ScrapMonocleover is a UI widget that displays the Scrap Monocle vision overlay animation on the screen. It listens for the "scrapmonolevision" event from its owner and toggles visibility based on whether the owner's playervision component reports active Scrap Monocle vision. It extends UIAnim and manages its own animation playback and delayed hiding behavior.

Usage example

-- Typically instantiated and managed automatically by the Scrap Monocle prefab.
-- Manual usage example (not recommended for production):
local over = ScrapMonocleOver(owner)
TheFrontEnd:AddWidget(over, "scrap_monocle_over")

Dependencies & tags

Components used: playervision Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
ownerGEntitynilThe entity (usually a player) whose vision state controls the overlay.
shownbooleanfalseInternal flag tracking whether the overlay is currently shown.
hidetaskTasknilTask used to defer hiding after the post-animation finishes.

Main functions

Toggle(show)

  • Description: Shows or hides the overlay based on the show flag, handling transitions via Enable() and Disable().
  • Parameters: show (boolean) — true to show the overlay, false to hide it.
  • Returns: Nothing.
  • Error states: No-op if the current visibility state already matches show.

Enable()

  • Description: Activates the overlay: cancels any pending hide task and plays the pre-animation followed by the idle loop.
  • Parameters: None.
  • Returns: Nothing.

Disable()

  • Description: Begins the hiding sequence: plays the post-animation and schedules a delayed Hide() call based on animation length.
  • Parameters: None.
  • Returns: Nothing.

Events & listeners

  • Listens to: scrapmonolevision — fired on the owner entity; triggers Toggle(data.enabled) to show/hide the overlay.
  • Pushes: None identified.