TwitchListOverlay
A simple OBS overlay to allow a Twitch channel's broadcaster or mods to add a list of items, with a title.
Install / Use
/learn @matthewjohnston4/TwitchListOverlayREADME
TwitchListOverlay
A simple OBS overlay to allow a Twitch channel's broadcaster or mods to add a titled list of items to their stream, via Twitch chat commands or an OBS broadcast dock.
Ideal for objective lists, todo lists, schedules or whatever else comes in list form.
This overlay includes use of local browser storage — lists are saved and can be re-used on subsequent streams on the same channel.
Check out this endorsement:
https://user-images.githubusercontent.com/986185/138435028-cd8ac51b-180b-43b4-8b8f-bf11c264c514.mp4
Installation
If you want to use this overlay, you'll need OBS or similar and be comfortable editing a settings file for configuration.
- Download the ZIP archive of the latest stable release and extract to your local machine or just clone this repo.
- In the extracted files, rename
config-local.js.sampletoconfig-local.js. - Fill in
twitchUserinconfig-local.jswith your Twitch channel username. - Optional Fill in
passwordandbotUsernameinconfig-local.jsto enable chat-based errors for command users (see the comments inconfig-local.js.samplefor a longer explanation). - Open OBS or whatever you're using, and add
twitchOverlays.htmlas a Browser Source. Setheightandwidthto the same dimensions as the resolution of your stream. - Optional: Enable "Shutdown source when not visible" to reload the overlay when you toggle its visibility — this is useful if you're making adjustments to the CSS or color variables.
- Position the overlay by dragging it to your preferred vertical location within OBS. Check out the
fillDirectionsetting below for more on how you can customise how the overlay will expand vertically. - Optional: Enable an broadcaster-only admin mode OBS dock view as shown below.
You're done! Now you can test this out by typing !list:new Hello, World! in your Twitch channel chat.
Usage
All these subcommands can vary based on the value of commandNameBase in config-general.js:
List and title commands:
- Creating a new list:
!list:new <title>creates a new list with the specified title. Overwrites any stored list. - Deleting and hiding the list:
!list:deletedeletes all content from the overlay and hides it — you may want to just hide it with!list:hideas below. - Hiding the overlay:
!list:hidehides the overlay, but retains all of the entered items and titles. Useful if you want to come back to the same list later in a stream. - Showing the overlay:
!list:showshows the overlay, if it was previously hidden, with any previous values for title and items retained. - Changing list title:
!list:title <title>sets a new title for the list using the specified text.
Item commands:
- Adding a new item:
!list:add <text>adds an item to the list with the specified text. - Marking an item as complete:
!list:complete <itemNumber>completes an item using its numbered position in the list (just count its position, this is not 0-indexed like an array). - Removing a specific item:
!list:remove <identifier>removes an item from the list, by specifying some identifier. The default identifier is to type the exact string of text of the item you want to remove, but you can customise this as shown below (in "Handler Options"). - Removing all items without hiding list:
!list:clearor!list:emptyempties a list of all items, while keeping the title and leaving the overlay active.
Advanced commands
!list:removeIndex <itemNumber>removes an item from the list, by specifying a 1-based index.!list:addSilent <text>adds an item to the list with the specified text, but doesn't 'show' the overlay if it is hidden.
Some notes about usage: the list of items, and the title, are stored locally by your browser, and will not clear by themselves. This can be very useful, if you want to retain a list over multiple streams, but if you can't remember whether you had a previous list, and want to start afresh, remember to use !list:new instead of add or show.
Admin mode OBS dock
This overlay can be put into a special admin mode which allows editing of the list items and status directly in a browser. If you're using OBS, you can use this admin mode in a custom browser dock, which means it'll be visible and usable only by you.
To enable this admin mode dock:
-
Open
twitchOverlays.htmlin a web browser, and copy the "URL" of the file location (ie. the address that startsfile:///). -
Open OBS
-
Click the 'View' menu and select Docks > Custom Browser Docks...
-
Add the copied URL from step 1 as a Dock URL, then change it a little bit. First, you'll need to change
file:///tohttp://absolute/(I don't know why, it's some weird OBS thing). Second, append?adminto the URL. For example:http://absolute/Users/matthewjohnston4/TwitchTodoOverlay/twitchOverlays.htm?admin -
Click
ApplythenClose
You should now have a resizeable dock window like this:
<img width="281" alt="Screenshot 2021-10-14 at 21 41 18" src="https://user-images.githubusercontent.com/986185/137392314-14541cb1-066d-4c15-afe3-9ede295482a9.png">There are controls here for showing/hiding the list, clearing it, removing or completing items, and adding new items. You can also rename the title or the text of existing items by just clicking on them (they're in a disguised input box) and editing them with your keyboard.
NOTE that unlike with the chat commands, edits to titles or item text will be shown in real-time. So you might still prefer to use the chat commands.
Customising
There are a few common settings to edit in config-general.js in order to adjust how the overlay looks and sounds:
commandNameBase: The base command name that all the subcommands are derived fromhandlerOptions:removalMethod: Determines how users use the:removecommand, see below for more details. One of "fullText", "startsWithText", or "index".removalDebounce: How many seconds to wait between allowingindex-based:removecommands.useListSymbols: Change this setting if you want to enable or disable the display of list item bullets.listSymbol: Adjust to modify what symbol gets used as the 'bullet'. You can use any unicode symbol (https://www.toptal.com/designers/htmlarrows/punctuation/) or standard emoji (not Twitch emotes).
position:horizontal: Where to put the list item within the entire overlay bounds. One ofleft,right, ormiddle. You can also ignore this setting and drag the position of the overlay in OBS, but if you want to quickly flip the list from one side of the stream to another, this setting will help you do that.fillMethod: Determines how the list will expand as you add items. You can still position your overlay manually by dragging it in OBS, but thefillMethodwill ensure your list will expand in the right direction for where you place it.fromCentremeans the height will expand vertically in equal amounts for each added items.downwardsmeans the height will always expand downwards.upwardsmeans the height will always expand upwards.
hMargin: Horizontal margins around the list (include CSS units). Margins are useful if you want to snap the overlay, but still have a gap from the edge of your stream video.vMargin: Vertical margins around list (include CSS units).padding: Padding inside the list, around the content (include CSS units).width: Width that the list should fill within the overlay bounds. Can be a static value like400pxor a proportional one like25vw.
font:baseSize: Base font size. Include a CSS unit.titleSize: Title font size. Include a CSS unit.textAlign: One ofleftorrightfamily: A valid font-family string.
colors:foreground: RGB value of the text and line colors within the list.foregroundOpacity: Decimal value (to one place) between 0 and 1.0 of the opacity of the text.background: RGB value of the background of the list.backgroundOpacity: Decimal value (to one place) between 0 and 1.0 of the opacity of the background of the list.
style:rounded: Set a px value for rounded corners of the overlay
twitchEmotes: Set to false to leave emote text as text, true to try and convert it to an image (GIFs do not work yet).sounds: All sound options can be left as a blank string ("") if you don't want any sounds to play.activate: Sound that plays when the commands:newor:showare used.newItem: Sound that plays when an item is added to the list using:add.completeItem: Sound that plays when an item is completed using:complete(does not play for:removecommands).
You can also replace the sound files in assets/sounds with your own files to customise the alert sounds.
Custom CSS
If you want to customise further, please add a file in assets/styles_extra.css and add CSS rules to it. This file is included in the .gitignore, so it will not be overwritten when you want to upgrade your version of the overlay.
Removal methods
The removalMethod setting determines how the :remove subcommand works:
fullText- anyone using the command will need to type the exact text of an item to remove it.startsWithText- a best attempt will be made to pick an item that starts with the string used. If more than one item matches, none will be removed and an error message will be sent back to the command user.index- uses a one-based index (ie. starts from 1) to identify the item to remove. When this setting is used,removalDebounceis active - this disables additional use of the:removecommand for a number of seconds. This can be useful to prevent collisions between multiple users calling the same command,
