Skip to content

Theme API

Euphoriahh edited this page Oct 31, 2023 · 2 revisions

Theme API

Synapse X contains a extendable and easy to use Theme API. The documentation for the API are below:

Base Objects

TImage

  • String - Path: A path to the image. If 'Online' is true, it will be the URL to the image. If 'Online' is false, it will be the path to the image. (note: local paths must be escaped, use \\ for \)
  • Boolean - Online: If the image is online or not. See path for more details.

TFont

  • String - Name: The name of the font. Font's in Synapse are in WinForms style, so use Comic Sans MS for example.
  • Float - Size: The size of the font. (13.75 for example)

TColor

  • Byte - A: The opacity (visibility) of the color. (0-255)
  • Byte - R: The red value of the color. (0-255)
  • Byte - G: The green value of the color. (0-255)
  • Byte - B: The blue value of the color. (0-255)

Control Objects

TButton

  • TImage - Image: The image of the button. If Path is empty, an image will not be displayed.
  • TFont - Font: The font of the button.
  • TColor - BackColor: The background color of the button.
  • TColor - TextColor: The text color of the button.
  • String - Text: The text the button displays.

TGlyphButton

  • TColor - BackColor: The background color of the button.
  • TColor - GlyphColor: The color of the glyph (the 'X' or '-' in the minimize/close buttons)

TYieldButton

  • TImage - Image: The image of the button. If Path is empty, an image will not be displayed.
  • TFont - Font: The font of the button.
  • TColor - BackColor: The background color of the button.
  • TColor - TextColor: The text color of the button.
  • String - TextNormal: The text the button displays while its not triggered. ("Execute" in the script hub for example)
  • String - TextYield: The text the button displays when its triggered ("Executing..." in the script hub after you try to run a script for example)

TListBox

  • TFont - Font: The font of the ListBox.
  • TColor - BackColor: The background color of the ListBox.
  • TColor - TextColor: The text color of the ListBox.

TLogo

  • TImage - Image: The image of the button. If Path is empty, the image will be the default Synapse logo.

TSeperator

  • Boolean - Enabled: If disabled, the seperator will not show. Useful if you want a full UI theme.
  • TColor - BackColor: The background color of the seperator.

TForm

  • TImage - Image: The image of the button. If Path is empty, the image will be the default Synapse logo.
  • TColor - BackColor: The background color of the ListBox.
  • Boolean - TopMost: If the UI should be in front of all other windows.
  • Double - Opacity: The transparency of the UI. (0-1)

TEditor

  • Boolean - Light: If the editor should use light mode.
  • TColor - FixPixel: This field is now unused. It was used to prevent flickering of the Monaco text editor, but is now un-needed.

TLabel

  • Boolean - Enabled: If disabled, the label will not show. Useful if you want a full UI theme.
  • TFont - Font: The font of the label.
  • String - Text: The text of the label.
  • TColor - BackColor: The background color of the label.
  • TColor - TextColor: The text color of the label.

TFormatLabel

  • Boolean - Enabled: If disabled, the label will not show. Useful if you want a full UI theme.
  • TFont - Font: The font of the label.
  • String - FormatString: The formatting string the label will view (Synapse X {version}, {version} will be replaced by the current version.)
  • TColor - BackColor: The background color of the label.
  • TColor - TextColor: The text color of the label.

Descriptor Objects

TAttachStrings:

  • String - Checking: The string will be displayed during the "checking..." phase of Synapse attaching.
  • String - Injecting: The string will be displayed during the "injecting..." phase of Synapse attaching.
  • String - CheckingWhitelist: The string will be displayed during the "checking whitelist..." phase of Synapse attaching.
  • String - Scanning: The string will be displayed during the "scanning..." phase of Synapse attaching.
  • String - Ready: The string will be displayed when Synapse attaching completes.
  • String - FailedToFindRoblox: The string will be displayed when Synapse attaching fails with "failed to find roblox!"
  • String - NotRunningLatestVersion: The string will be displayed when Synapse attaching fails with "not running latest version!"
  • String - NotInjecting: The string will be displayed when Synapse executing fails with "not injected!"
  • String - AlreadyInjected: The string will be displayed when Synapse attaching fails with "already injected!"

TInitStrings:

  • String - CheckingWhitelist: The string will be displayed during the "Checking Whitelist..." phase of Synapse initialization.
  • String - ChangingWhitelist: The string will be displayed during the "Changing Whitelist..." phase of Synapse initialization.
  • String - DownloadingData: The string will be displayed during the "Downloading Data..." phase of Synapse initialization.
  • String - CheckingData: The string will be displayed during the "Checking Data..." phase of Synapse initialization.
  • String - DownloadingDlls: The string will be displayed during the "Downloading DLLs..." phase of Synapse initialization.
  • String - DownloadingMonaco: The string will be displayed during the "Downloading Monaco..." phase of Synapse initialization.
  • String - DownloadingSQLite: The string will be displayed during the "Downloading SQLite..." phase of Synapse initialization.'
  • String - JoiningDiscord: The string will be displayed during the "Joining Discord..." phase of Synapse initialization.
  • String - Ready: The string will be displayed when Synapse attaching completes.

TRightClickStrings:

  • String - Execute: The string will be displayed when a script is right clicked.
  • String - LoadToEditor: The string will be displayed when a script is right clicked.
  • String - Refresh: The string will be displayed when a script is right clicked.

TWebSocket

  • Boolean - Enabled: This will enable the WebSocket connection to Synapse X. Do not enable this unless you know what you are doing. (WebSocket API)
  • Boolean - DebugMode: This will relax some security checks within the WebSocket connection. Also do NOT enable this unless you know what you are doing. (or developing a plugin to use the WebSocket API)

Form Objects

TMain:

  • TForm - Base: The base form object.
  • TWebSocket - WebSocket - The WebSocket settings object.
  • TEditor - Editor - The editor settings object.
  • TAttachStrings - BaseStrings: The base strings object.
  • TLogo - Logo: The base logo object. (24x24)
  • TSeperator - TopBox: The object for the top box.
  • TFormatLabel - TitleBox: The formatted label for the Synapse title label. (Synapse X v1.1.0b)
  • TListBox - ScriptBox: The script list box object.
  • TGlyphButton - MinimizeButton: The - button object.
  • TGlyphButton - ExitButton: The X button object.
  • TButton - ExecuteButton: The Execute button object. (75x30)
  • TButton - ClearButton: The Clear button object. (75x30)
  • TButton - OpenFileButton: The Open File button object. (75x30)
  • TButton - ExecuteFileButton: The Execute File button object. (75x30)
  • TButton - SaveFileButton: The Save File button object. (75x30)
  • TButton - OptionsButton: The Save File button object. (75x30)
  • TButton - AttachButton: The Attach Button button object. (75x30)
  • TYieldButton - ScriptHubButton: The Script Hub yield-button object. (75x30)

TScriptHub:

  • TForm - Base: The base form object.
  • TLogo - Logo: The base logo object. (24x24)
  • TSeperator - TopBox: The object for the top box.
  • TLabel - TitleBox: The Synapse title label. (Synapse X Script Hub)
  • TListBox - ScriptBox: The script list box object.
  • TListBox - DescriptionBox: The description box object. (note: even though this isn't a list box, the same properties are shared, so it keeps the list box object)
  • TGlyphButton - MinimizeButton: The - button object.
  • TYieldButton - ScriptHubButton: The Execute yield-button object. (145x30)
  • TButton - CloseButton: The Close button object. (145x30)

TLoad:

  • TForm - Base: The base form object.
  • TInitStrings - BaseStrings: The base strings object.
  • TLogo - Logo: The base logo object. (24x24)
  • TSeperator - TopBox: The object for the top box.
  • TLabel - TitleBox: The Synapse title label. (Synapse X Loader)
  • TLabel - StatusBox: The Synapse status label. (Checking Whitelist...)

Container Objects

TBase:

  • UInt - Version: The current version of the Synapse Theme API. Currently, it is 2.
  • TLoad - Load: The Synapse X Loader UI object. (325x104)
  • TMain - Main: The main Synapse UI object. (770x355)
  • TScriptHub - ScriptHub: The Synapse X Script Hub UI object. (439x336)

Notes

  • The base object for themes is TBase.