Skip to main content

Skindebugscreen

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

Overview

SkinDebugScreen is a specialized debug UI screen that allows developers to preview character skin assets (pants and shoes) in a puppet renderer and adjust their legs_cuff_size and feet_cuff_size properties interactively. It is not intended for production use and is only available during development or testing. It uses the Puppet widget to render the character and dynamically modifies the global CLOTHING table to reflect size changes.

Usage example

This screen is instantiated internally by the game and is not meant to be created directly by mods. Its usage is limited to calling TheFrontEnd:SetScreen(SkinDebugScreen(prev_screen, user_profile)) in debug builds.

-- Not intended for mod use. Example instantiation:
local screen = SkinDebugScreen(prev_screen, user_profile)
TheFrontEnd:SetScreen(screen)

Dependencies & tags

Components used: None (screen-only UI component; no entity components used). Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
prev_screenScreen?nilThe screen to return to upon exit.
user_profileUserProfile?nilUser profile data (unused in current implementation).
pants, shoestable[]{}, {}Lists of clothing items categorized as pants or shoes, each containing id and type.
pants_index, shoes_indexnumber1Current selection index in pants and shoes tables.
pants_txt, shoes_txtTextUI text widgets displaying selected clothing ID and cuff size.
puppetPuppetPuppet instance used to render the character preview.
puppet_rootWidgetContainer widget for the puppet.
control_menu, size_menuMenuMenus for navigation and size adjustment controls.
back_buttonWidget?nilBack button (if not on a controller).
characterstring"wilson"Character being previewed.
skintypestableAvailable skin types for the character.
view_indexnumber1Current skin type view index.
selected_skintypestringType of skin currently applied to the puppet.

Main functions

DoInit()

  • Description: Initializes the screen UI, creates menus for navigation and size control, sets up the character puppet, populates pants/shoes lists from CLOTHING, and sorts them by cuff size.
  • Parameters: None.
  • Returns: Nothing.

UpdatePuppet()

  • Description: Updates the puppet with the currently selected pants and shoes, updates the on-screen text labels, and applies skin settings.
  • Parameters: None.
  • Returns: Nothing.

SetShoes(forward)

  • Description: Selects the next or previous shoe item in the shoes list, with clamping to keep the index within bounds.
  • Parameters: forward (boolean) — true to select the next item, false to select the previous.
  • Returns: Nothing.

SetPants(forward)

  • Description: Selects the next or previous pants item in the pants list, with clamping to keep the index within bounds.
  • Parameters: forward (boolean) — true to select the next item, false to select the previous.
  • Returns: Nothing.

ResizeShoes(delta)

  • Description: Modifies the feet_cuff_size value for the currently selected shoe item in CLOTHING and updates the list order and puppet.
  • Parameters: delta (number) — Amount to adjust feet_cuff_size (e.g., +1 or -1).
  • Returns: Nothing.

ResizePants(delta)

  • Description: Modifies the legs_cuff_size value for the currently selected pants item in CLOTHING and updates the list order and puppet.
  • Parameters: delta (number) — Amount to adjust legs_cuff_size (e.g., +1 or -1).
  • Returns: Nothing.

SortClothesLists()

  • Description: Re-sorts both pants and shoes lists in descending order by their respective cuff sizes (legs_cuff_size or feet_cuff_size), breaking ties by descending id string. Maintains current selection position after sorting.
  • Parameters: None.
  • Returns: Nothing.

OnControl(control, down)

  • Description: Handles input; if CONTROL_CANCEL is released, triggers screen exit via TheFrontEnd:FadeBack().
  • Parameters:
    • control (number) — Input control code.
    • down (boolean) — true if the control is pressed, false if released.
  • Returns: true if input was handled, false otherwise.

GetHelpText()

  • Description: Returns localized help text indicating the button to press to exit the screen.
  • Parameters: None.
  • Returns: string — Localized help string (e.g., "B Back").

Events & listeners

  • Listens to: None.
  • Pushes: None.