beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
205 stars 98 forks source link

Consider doing something about WG, GG, the other GG, and _G #1392

Open sprunk opened 5 months ago

sprunk commented 5 months ago

They are completely separate entities but have a similar role and extremely similar name, see https://beyond-all-reason.github.io/spring/articles/wupget-communication

Caveats:

WatchTheFort commented 5 months ago

We could go with Spring style global, so Widget and Gadget.

_G should stay the same, that's just how Lua is.

sprunk commented 5 months ago

We could go with Spring style global, so Widget and Gadget.

widget and gadget are already taken (consider how it's gadget:GameFrame etc like https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/luarules/gadgets/game_boombox_spawner.lua#L53 )

Damgam commented 5 months ago

WidgetGlobal / GadgetGlobal then?

sprunk commented 5 months ago

Another common source of confusion is that the synced luarules GG, the unsynced luarules GG, and maybe a further two GGs from un/synced LuaGaias all have the same name and role but are actually completely separate and cannot be used to share data with each other. GadgetGlobal keeps this problem