Developing add-ons
Developing a nuken Add-on is pretty easy. Upon startup, nuken will scan the content/addons
directory for any .js
files you may have dropped there. You can use this to run custom scripts or files (like background add-ons) but creating an add-on that's a usable app takes a few more steps.
Pretty much what you're doing here is defining a JS object, and pushing it to the Add-ons Menu via the push_addon
function.
Required properties
These are most definitely required, we're not messing around. Your content will not function without them. 😐
codename
- Set this string to whatever you've called your declared add-on object. For example, setcodename
tocolor_picker
if you're eventually going topush_addon(color_picker)
. This just ensures that nuken can create page elements using the name of your add-on object.
index
- This is the location of your add-on's interface. It's loaded into aniframe
element, which the user can interact with in their workspace. nuken begins looking in theaddons/
directory for the.html
file you list here, so relative file paths are allowed. If your add-on is not web-based, your.html
file can act as a redirect or something.
Optional properties
Feel free to add these if you'd like, no pressure. 😎
Setting some of these properties to false
has the same effect as leaving them out entirely; so as a general rule of thumb, if you don't want it, just ignore the property.
title
- The name of your add-on.
pin
- Whether or not the add-on can be pinned to a user's workspace. If this is set tofalse
, or is omitted from the object entirely, the option to pin your add-on will be unavailable.
icon
- The location of your add-on's preview icon. nuken begins looking in thecontent/addons
directory, so relative file paths are allowed here.
description
- Tell us about your add-on. This will show up under "Info".
creator
- Your name, or whatever you'd like to be called. This appears under "Info".
donate
- The link to your addon's donation page. This appears under "Info".
link
- A link to your website. This appears under "Info".
online
- Set this totrue
if your Add-on is "always-on"; that is, requires an internet connection. If nuken is offline, your add-on is not displayed in its menu; instead, the default "no connection, check your settings" message is displayed. This is a neat feature if you don't want to worry about the user seeing your add-on in an offline state, having to put more work into your UI design.
version
- Your addon's version number. You can number / input your versions however you'd like - this is astring
, not a number.
shop_id
- If your add-on is listed on the nuken Shop, you'll receive anid
for your listing. This information is appended to the "Shop listing" button, taking the user directly to your Shop page.
fullscreen
- Setswidth
andheight
to the max values allowed by your screen, andresizable
to false. If this is set to true, the following options don't matter.
width
- Set the width of your addon in its menu, inpx
units.
height
- Set the height of your add-on in its menu, inpx
units.
resize
- If this is set tofalse
, the user will not be able to resize your add-on in its menu.
If you've created the object correctly, you should see your icon
in the Add-ons Menu. Clicking on it will open your nuken Add-on.
Make sure you've called push_addon
. nuken will not show the add-on in the Add-ons Menu if you only define it!
Feel free to show us what apps or background add-ons you've made for nuken. No matter what you create, we'll take a look at it if you @ us on social media, or submit it via nuken.xyz/submit.
Last updated