Author Topic: Support_Prefs v3.1 - now with keybind  (Read 10749 times)

Support_Prefs v3.1

Description
Server_Prefs replaces the default server settings GUI with this extensible one:



In addition to supporting many pref types, this new GUI also supports subcategories; instead of getting their own section, your mods get their own menu.
It also supports RTB prefs registered with RTB_RegisterPref, and icons - with more features to come.

Documentation
Very similar to RTB. To add a pref, do
registerPref(category,subcategory,title,type,variable,default,params,callback,legacy,private,hostonly);

- Name names the pref.
- Category chooses what submenu it's in.
- Subcategory chooses what seperator it's under.
- Variable chooses what global represents it.
- Type chooses what the input box looks like with the same syntax as RTB's types, and %perams are the options for the type.
    - "string" "[max]" is a string with a maximum length of [max].
    - "int" "[min] [max]" is an intiger with a maximum of [max] and minimum of [min].
    - "bool" "" is a checkbox.
    - "list" "[option1name] [option1val] [option2name] [option2val] etc.." is a pop up menu with those options.
    - "playerlist" "[min] [max]" is a convenience type that just displays 1 to [size] players in a pop up menu.
    - "button" "" is a button that calls your callback when pressed.
    - "wordlist" "[delimiter] [maxwords]" is a list of words.
    - "BL_IDlist" "[delimiter] [maxids]" is a list of users.
    - "datablocklist" "[delimiter] [maxdatablocks] [type]" is a list of datablocks. (note: not fully functional yet)
    - "float" "[min] [max]" is a slider
    - "num" "[min] [max]" is a decimal OR non decimal number in a box.
    - "datablock" "[type]" is a data type
- Legacy is whether the var is from an old RTB mod. Should always be 0.
- Default is your variable's default value.
- IsHostOnly defines whether this option can be changed by anyone who can access the menu or just the host.
- Callback defines a function that will be called when your value is changed.
- Private defines whether the change can ever be displayed to the server (for passwords and such)

The old RTB_registerPref syntax works fine too but be aware you can't do as much with it.

For setting your category's icon, there's also:
registerPrefGroupIcon(category, icon);
- Category defines your category's name again.
- icon defines what your icon is - select from the folder at Support_Prefs/client/prefmanager/resources/icons/*.

Remember to check that $BLPrefs::Version !$= "" before registering anything.

Download
Here.

Note: v2 and v3 are not compatible with each other as v3 uses the glass back end.
« Last Edit: January 01, 2016, 01:41:27 PM by chrisbot6 »

does this support oRBs prefs too? I kinda converted a lot of add-ons due to a name change with System_ReturntoBlockland/System_oRBs

does this support oRBs prefs too? I kinda converted a lot of add-ons due to a name change with System_ReturntoBlockland/System_oRBs
If oRBS changed it from RTB_RegisterPref to oRBS_registerPref then no. I'll do an update now.


v1.1:
Code: [Select]
- The mod can now load oRBs prefs. I'm not sure the oRBs menu still works but you shouldn't try to use this in parallel anyway.

Is that server sided or client?


Looks great, will download.

I wish you had worked alongside BLG, to get this out as a Glass feature. It needs more publicity, since it's the only way forward for Blockland.

I wish you had worked alongside BLG, to get this out as a Glass feature. It needs more publicity, since it's the only way forward for Blockland.
Agreed.

I wish you had worked alongside BLG, to get this out as a Glass feature. It needs more publicity, since it's the only way forward for Blockland.
Whoops.

Sorry guys. I always intended for this to be standalone. It can be embedded as part of Glass if you'd like?

If oRBS changed it from RTB_RegisterPref to oRBS_registerPref then no. I'll do an update now.
oRBs prefs don't seem to be working for me. I can only see prefs of add-ons that I haven't converted (RTB prefs).

oRBs prefs don't seem to be working for me. I can only see prefs of add-ons that I haven't converted (RTB prefs).
Assuming you've downloaded the update, can you send me some mods that register oRBs prefs to check?

Assuming you've downloaded the update, can you send me some mods that register oRBs prefs to check?
I have to wait a couple hours now that I'm on a mobile device. When I can I will pm you a converted add-on.

I always intended for this to be standalone.
The problem with that is, and don't misunderstand, I'm not criticizing you or anything, standalone mods won't make nearly as much advancements towards a generalized platform that will eventually benefit Blockland as a community more.