LegacyShell WikiLegacyShell Wiki
Back to LegacyShell
Home
Wiki
Plugins
Docs
Back to LegacyShell
Home
Wiki
Plugins
Docs
  • Plugins

    • Plugin Docs

      • Default

        • Crackshot
        • Auto Restart Notifications
        • Auto Shop Notifications
        • Block Viewer
        • Burnt Block Sets
        • Christmas Event
        • Classic Skybox
        • DeadInternet
        • Debug F3
        • Discord Playtest
        • dynamicmapblocks
        • FancyGraphics
        • Francium
        • Health Pack Item
        • Item ToolTips
        • LagCompensation
        • LegacyAchievements
        • LegacyAdmin
        • LegacyAnalytics
        • LegacyLightmaps
        • LegacyProfiles
        • LegacyReplay
        • LegacySettings
        • LegacyShellCore
        • LegacyThemes
        • LegacyWeather
        • Map Editor Saving
        • Modern Map Blocks
        • Modern Shell Guns
        • Modern Shell Hats
        • Modern Shell Stamps
        • Minerva
        • ParkourMode
        • Player Count Notifications
        • TimeMachine
        • Vaporwave Map Blocks
        • WhatsAppTheme
        • Wiki Only Mode
        • Zaxonius Custom Guns
        • ZombiesMode
      • Examples

        • Modern Shell Maps
    • List of plugins

Canonical source: plugins_default/legacysettings/README.md - edit that file, not this page (this page is built live from it, nothing here is a tracked copy).

LegacySettings

A complete replacement settings-menu UI, and - more importantly for other plugin authors - a small framework other plugins build their own settings tabs on top of. FancyGraphics is a real example of a plugin doing exactly that.

Setup

Client-only (plugins.type !== "client" returns early elsewhere). Splices its own CSS and client.js into the browser bundle at the beforebefore insertion position (see Client-Side Code) - early enough that the rest of the bundle, and other plugins' client code, can rely on the global LegacySettings instance already existing.

The API other plugins actually use

A single global instance (LegacySettings, client.js) exposes:

MethodWhat it does
addTab(name, panelWidths = [1])Creates (or returns the existing) tab. panelWidths splits the tab into side-by-side columns, e.g. [1,1] for two equal panels.
addCategory(tabName, panelIndex, label, { defaultOpen, collapsible })A labeled, optionally-collapsible group of options within one panel.
addOption(tabName, opt, panelIndex, categoryLabel)Adds one control. opt.key is the persisted storage key (auto-generated with a warning if omitted); opt.type selects which control renders - see below.
get(key, default) / set(key, value)Read/write a value directly, outside of the UI - state persists to localStorage under the settings-menu's own id, not to any server-side store.
refresh()Re-reads every option's value into its control - for when state changed somewhere else (a reset, another option that depends on this one).

addOption returns the option object, which has its own get(), set(value), refresh() and setVisible(bool). An option normally stores its value under opt.key, but it can be backed by state that lives elsewhere instead: give it getValue()/setValue(value) and LegacySettings reads and writes through those (this is how LegacyShellCore's rebuilt 0.17.0 settings menu drives the core's own settings object and keybinds). onChange(value) is called whenever the player changes it.

Existing settings added before this plugin's own UI takes over are preserved: finalise() absorbs the page's original #settingsContainer element wholesale into a "General" tab (absorbOldSettings, default true) rather than discarding it.

Option types

checkbox, slider (with an optional live number readout), button, bind (captures the next keypress/mouse button/scroll direction as a keybind), select, radio, text, info (static, but updatable text), list (removable and/or drag-reorderable), gallery (a small image carousel), and customDiv (wraps an arbitrary existing DOM element - this is the mechanism absorbOldSettings itself uses). Any option can also take a tooltip string, shown in a floating tooltip that follows the cursor while it is over the row (label and control), drawn by the itemtooltips plugin (same as the shop's). An unrecognized type renders a visible "Unknown option type" placeholder rather than failing silently, which is worth knowing if a typo'd type string doesn't show what you expected.

Notes

client.js ends with a full worked example (a "Gameplay" tab exercising every option type) purely for reference. It's commented out (uncomment the marker line above it and the one at the end of the file to see it in game), but reading it directly is the fastest way to see every option type's exact call shape at once.


This page was drafted with AI assistance and reviewed for accuracy. If something looks wrong, please open a PR or flag it.

Prev
LegacyReplay
Next
LegacyShellCore