Author Topic: [SOLVED] How to Register Preferences (Support_Preferences)?  (Read 950 times)

I can't seem to figure out how to create server preferences. All the examples I can find use RTB preferences, and I would prefer to use a more up-to-date standard. Namely, I want to create something that would work with Blockland Glass. I'm under the impression that Support_Preferences is the preference system that Blockland Glass uses, as per their documentation. But I can't get it to work. I tried mimicking the code found in this file. Here's my code:
Code: [Select]
registerPref("Test", "General", "Test", "number", "$Pref::Test::Test", "Support_Preferences", 50, "1 100 0", "updateServerSetting", 0, 0, 0);
I ran it, but it didn't work. I opened the Preferences tab in the Blockland Glass Server Settings. But nothing showed up. I tried
Code: [Select]
echo($Pref::Test::Test);
But it displayed nothing. However, when I run
Code: [Select]
echo(TestPrefs.getObject(0).variable);
it outputs $Pref::Test::Test. I did not get an error message when I ran registerPref, so I'm not sure what I did incorrectly.
« Last Edit: November 25, 2017, 03:44:13 AM by Platypi »

Also, I'm not sure why
Code: [Select]
ForceRequiredAddOn("Support_Preferences");
doesn't work. I returns -3 ($Error:AddOn_NotFound) tells me "Support_Preferences" is not a valid add-on, despite Support_Preferences.zip being obviously in my add-ons folder.
« Last Edit: November 17, 2017, 08:29:55 PM by Platypi »

So apparently, if I run
Code: [Select]
ForceRequiredAddOn("System_BlocklandGlass");
instead of
Code: [Select]
ForceRequiredAddOn("Support_Preferences");
then registerPref works just as expected.

*shrugs*
« Last Edit: November 25, 2017, 03:43:53 AM by Platypi »