how to block external widgets for a game
Moderator: Moderators
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
how to block external widgets for a game
I hear lots of talk about it, but I haven't found which files do this and how this works. Any one have some working examples to show off? Black list/ white list could work too. I just want something to stop 3rd part widgets that conflict with a game's widget system.
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: how to block external widgets for a game
You probably mostly hear the rage of players that cry because their widgets don't work in some mods that block user widgets by default even if you can use your local widgets, just not by default. (And they also spread manybobthedinosaur wrote:I hear lots of talk about it,
In CA etc. it's done in the widget handler. When it starts it reads config if user widgets should be blocked or not (that's why you need to reload luaui when changing that option) by changing the virtual file system access mode (VFSMODE).but I haven't found which files do this and how this works. Any one have some working examples to show off?
If it should block local widgets it only reads the mod widgets (VFS.ZIP), else it reads both: either VFS.RAW_FIRST or VFS.ZIP_FIRST depending you want preference on local or mod widgets - that's configurable, too.
See e.g. http://trac.caspring.org/browser/trunk/ ... idgets.lua lines 63ff.
chili ui for changing options: http://trac.caspring.org/browser/trunk/ ... idgets.lua
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: how to block external widgets for a game
Sounds complicated. I'd settle for this
if I knew how.some mods that block user widgets by default even if you can use your local widgets, just not by default.
Re: how to block external widgets for a game
Easiest way* is to put a copy of the default widget handler widgets.lua into your mod, and then look for the following lines:bobthedinosaur wrote:Sounds complicated. I'd settle for thisif I knew how.some mods that block user widgets by default even if you can use your local widgets, just not by default.
Code: Select all
local autoUserWidgets = Spring.GetConfigInt('LuaAutoEnableUserWidgets', 1)
self.autoUserWidgets = (autoUserWidgets ~= 0)
Code: Select all
self.autoUserWidgets = false
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: how to block external widgets for a game
Are you talking about this widget handler? http://pastebin.com/9HqQssnw
I can't find any line in there that look like
I can't find any line in there that look like
local autoUserWidgets = Spring.GetConfigInt('LuaAutoEnableUserWidgets', 1)
self.autoUserWidgets = (autoUserWidgets ~= 0)
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: how to block external widgets for a game
Why use pastebin for something that is already online?
https://github.com/spring/spring/blob/0 ... idgets.lua
https://github.com/spring/spring/blob/H ... idgets.lua
https://github.com/spring/spring/blob/0 ... idgets.lua
https://github.com/spring/spring/blob/H ... idgets.lua
Re: how to block external widgets for a game
That one already loads user widgets as disabled from the looks of itbobthedinosaur wrote:Are you talking about this widget handler? http://pastebin.com/9HqQssnw