if i disable any plugin from the world plugins GUI, then save the world, load the world again, the plugins are enabled again, this happens not only to me but to other friends also, is this how it is supposed to be?
plugins dont stay disabled after quit?
Posted by Arana on Thu 26 Aug 2010 06:56 PM — 4 posts, 16,454 views.
It doesn't automatically do that, because it would need to save the disabled state somewhere.
However I have added it to some plugins.
First, make sure in the plugin header that it saves its state like this:
The rest is probably different, but make sure that the "save_state" line is there.
Then add a function to the plugin that remembers, when its state is saved, whether or not it is disabled:
Then when the plugin loads we check that "enabled" variable, and if false, call EnablePlugin to disable ourselves right now:
However I have added it to some plugins.
First, make sure in the plugin header that it saves its state like this:
<plugin
name="Aardwolf_Helplist"
author="Nick Gammon"
id="8a8e24942fe60f88bcaf1807"
language="Lua"
purpose="Makes a helper window with hyperlinks"
date_written="2008-06-26 12:21:22"
requires="4.29"
version="1.0"
save_state="y"
>
The rest is probably different, but make sure that the "save_state" line is there.
Then add a function to the plugin that remembers, when its state is saved, whether or not it is disabled:
function OnPluginSaveState ()
SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
end -- OnPluginSaveState
Then when the plugin loads we check that "enabled" variable, and if false, call EnablePlugin to disable ourselves right now:
function OnPluginInstall ()
-- any initialization here ...
if GetVariable ("enabled") == "false" then
ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.")
check (EnablePlugin(GetPluginID (), false))
return
end -- they didn't enable us last time
end -- OnPluginInstall
thank you, that will do it, even tho i have to edit all the plugins xD
hmmm
could it be possible to disable the plugins using another plugin? that way we could write a "plugin manager plugin"
that and only that one would need to keep record of what lpugins should be disabled and then turn them off or on accordingly.
hmmm
could it be possible to disable the plugins using another plugin? that way we could write a "plugin manager plugin"
that and only that one would need to keep record of what lpugins should be disabled and then turn them off or on accordingly.
Ah yes I think you could do that. You would need to get the plugin list (GetPluginList) and using the resulting list do the
for each one, and then save that as a variable (eg. plugin ID concatenated with "enabled").
Then when the plugin manager loads it could disable the other plugins as required.
GetPluginInfo (id, 17)
for each one, and then save that as a variable (eg. plugin ID concatenated with "enabled").
Then when the plugin manager loads it could disable the other plugins as required.