Addons, widgets and gadgets.

Addons, widgets and gadgets.

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Addons, widgets and gadgets.

Post by smoth »

So I always saw things as the following.

Any actual gamerule that needs to be synced or something I want to NOT open for a user to override, I used gadgets. Gadgets have synced code

Something i want to allow a player to alter the unsynced code of, widget. Widgets are player side only.

What are addons for? What do we do with them? Can users override them? What makes them different from widgets/gadgets.

We have 3 different lua file types and I would love to understand what each is really meant for.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Addons, widgets and gadgets.

Post by Jools »

Gadgets can have both synced and unsynced code. Widgets also have synced code (for example GameFrame callin).

They are just names. Addon is a new name for both.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Addons, widgets and gadgets.

Post by FLOZi »

Gadgets are always loaded. They are game code, synced or unsynced.

Widgets are always unsynced though they may be able to read certain things from synced. Players can decide whether or not they are loaded.

Gadgets and widgets are a subset of addons.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Addons, widgets and gadgets.

Post by smoth »

Jools wrote:Gadgets can have both synced and unsynced code.
I am aware.
Jools wrote:Widgets also have synced code (for example GameFrame callin).
no widgets are always unsynced.
Jools wrote:They are just names. Addon is a new name for both.
This may be an english is a second language thing but if you say 1 and 2 are numbers that is ok but you cannot say numbers are the new name for 1 and 2. That is their name, one and two, numbers is just a set they belong to.
FLOZi wrote:certain things from synced. Players can decide whether or not they are loaded.
whoa, wait, players can outright disable widgets?
FLOZi wrote:Gadgets and widgets are a subset of addons.
Ok but what is an addon. What is the role? I don't get what they are for, they would not have been added without a reason.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Addons, widgets and gadgets.

Post by Silentwings »

Players can turn widgets on/off through the f11 widget selector. They can also replace widgets with their own local copies, which might behave differently to the ones included in the game. Players are only able to do both things because the widget handler/selector allows them; you could modify the widget handler to load only the game widgets and remove the widget selector entirely, but afaik no games do so.

An addon is just an umbrella term for any self contained of code that runs in a lua state. So any widget, gadget, etc. It's just a name, not anything materially new.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Addons, widgets and gadgets.

Post by gajop »

smoth wrote:
Jools wrote:They are just names. Addon is a new name for both.
This may be an english is a second language thing but if you say 1 and 2 are numbers that is ok but you cannot say numbers are the new name for 1 and 2. That is their name, one and two, numbers is just a set they belong to.
Confusing explanation .. :)
smoth wrote:
FLOZi wrote:certain things from synced. Players can decide whether or not they are loaded.
whoa, wait, players can outright disable widgets?
Of course, f11 opens up the widget manager. They can also override game widgets by putting stuff in their local LuaUI.
smoth wrote:
FLOZi wrote:Gadgets and widgets are a subset of addons.
Ok but what is an addon. What is the role? I don't get what they are for, they would not have been added without a reason.
Addon is just a name that's used when we want to refer to both widgets and gadgets. Example cases are "addon callins" (shared by both widgets and gadgets), addonhandler, and so on. Beats wupgets (spelling?) imo :mrgreen:

PS: Silentwings beat me to it, but meh.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Addons, widgets and gadgets.

Post by smoth »

There are addons though, say like in lua load screens.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Addons, widgets and gadgets.

Post by Jools »

smoth wrote:
Jools wrote:They are just names. Addon is a new name for both.
This may be an english is a second language thing but if you say 1 and 2 are numbers that is ok but you cannot say numbers are the new name for 1 and 2. That is their name, one and two, numbers is just a set they belong to.
Please do not resort into disproving my argument by attacking me as a person. And please do not attack me as a person anyway, it's a nicer environment if we all behave nicely.

Players can turn off widgets of course, and widgets can also be hidden so that players can't turn them off I believe.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Addons, widgets and gadgets.

Post by smoth »

Responded to personal matter in pm

So outside of the old f11 menu, can they outright disable widgets?
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Addons, widgets and gadgets.

Post by Silentwings »

Yes, iirc theres a /luaui <smth> <widgetname> command for it, can't remember exactly what. Widgets that are handlers, which just means they get given a pointer to the widgetHandler object, can also control turning on/off of other widgets. User widget can be handlers, and are loaded by default (in place of game widgets with the same name, if needed) if they exist.

To remove control from players of what widgets run you'd have to modify the widget handler (and remove the widget selector). It's not that difficult if you are already familiar with what goes on inside the widget handler - if not I'd be happy to help (but later in the week).
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Addons, widgets and gadgets.

Post by gajop »

gajop wrote:They can also override game widgets by putting stuff in their local LuaUI.
If they override them with empty widgets, it's equivalent to disabling them.
However, there might be an option to forbid local widgets, as I recall it being mentioned on the forums once. Someone more knowledgable would have to guide you on the how.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Addons, widgets and gadgets.

Post by smoth »

Nah, was worried about people going, what is this lua thing, IMMA DISABLE IT and then spending weeks with this one user trying to figure out where my code was wrong
Post Reply

Return to “Lua Scripts”