9 Legacy Mode Features
96LawDawg edited this page 2026-02-11 20:22:53 -06:00

List of Legacy Mode Features

Review the wiki for Legacy Mode. Click on the list below or scroll down to see a list of the available Legacy Mode features. They are listed in the order they were added to Legacy Mode.

Convert numeric var parameters to numbers

Problem: Whenever you used a string in a var expression that consisted of only digits, it was converted to a number.

A common pitfall was storing a widget id in an array and later trying to SELECT it using the stored id. Because ids are randomly generated alphanumeric strings, this would fail for some unlucky widgets that received an all-numeric id.

Change: Numbers in strings remain strings and are not converted to numbers. Exception: all basic math operations (+, -, *, /, **, and %) will still convert numbers as strings to numbers.

Implemented: PR #2581

Example 1:

var a = [],
var a = push '1'

Old result: [1]
New result: ['1']

Example 2:

var b = '12' + '34',

Old result: 46
New result: 46

Use concat when you want to combine one or more strings instead of using +. So in example 2, if you wanted the result to be 1234, then use: var b = '12' concat '34'.

Use 1 as default for var parameters

Problem: When you called a function in a var expression, every parameter not provided was set to 1.

Change: Parameters that are not provided (or are null or undefined) are set to 0.

Implemented: PR #2581

Example 1:

var a = +,

Old result: 2
New result: 0 and an error message

Example 2:

var b = 'This is a string' slice ${someVariableThatDoesNotExist}

Old result: ""
New result: "This is a string"

Use iframes for card face HTML Objects

Problem: Cards using html in the faceTemplates now render directly in the DOM instead of inside an iframe.

Change: Older games that used HTML in cards have this legacy mode feature active to preserve their original display characteristics. There is no change to JSON syntax or structure, just increased flexibility for developers, especially using global room css.

Implemented: PR #2729

Disable holder image widget

Problem: Holders now support image, icon, and text properties natively, but some games manually implemented this functionality before it was supported and may break with the new behavior.

Change: Older games with image, icon, or text properties have this legacy mode feature active.

Implemented: PR #2634

Example 1: The following is supported on holder widgets:

  "icon": "👣",
  "text": "Bigfoot"