I've ported the widgetHandler LuaUI code so that it can be used in
synced scripts. To make it easier to tell the two types of code apart,
I've used the name "gadgets".
Here is a simple example:
http://trepan.homelinux.net/spring/shar ... allies.lua
To use the gadgetHandler, all you'll have to do is:
include('LuaRules/gadgets.lua')
in LuaRules/main.lua (actually, that will probably be the entire
contents of the file). You will also have to do the same for
LuaRules/draw.lua if you want gadgets used with the unsynced
part of the code.
You can keep the synced and unsynced code in the same gadget
source file by using the gadgetHandler:IsSyncedCode() to separate
them into functional blocks. I'll probably post an example of how this
can be done once I get some more calls tested.
The code currently loads all gadget files in the LuaRules/Gadgets
directory. The is no graphical selector interface for enabling/disabling
them (it would mess with the synced code to do so directly). It is
possible to do it indirectly (/say .luarules ... would work).
Synced Script GadgetHandler
Synced Script GadgetHandler
Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)
Moderator: Moderators
Jump to
- Community
- ↳ General Discussion
- ↳ Help & Bugs
- ↳ Ingame Community
- ↳ Spring Clans
- ↳ Tournaments
- ↳ Linux
- ↳ Mac OS X
- ↳ Off Topic Discussion
- Content Development
- ↳ Game Development
- ↳ Game Development Tutorials & Resources
- ↳ Game Releases
- ↳ Map Creation
- ↳ Map Tutorials & Resources
- ↳ Map Releases
- ↳ Lua Scripts
- ↳ Art & Modelling
- ↳ Modelling & Texturing Tutorials & Resources
- ↳ Sound Effects & Music
- ↳ Project Subforums
- ↳ Balanced Annihilation
- ↳ Balanced Annihilation Reloaded
- ↳ Conflict Terra
- ↳ The Cursed
- ↳ Evolution RTS
- ↳ Jauria RTS
- ↳ Kernel Panic
- ↳ Journeywar
- ↳ Ludum Dare
- ↳ MechCommander: Legacy
- ↳ Metal Factions
- ↳ MOSAIC
- ↳ NOTA
- ↳ Phoenix Annihilation
- ↳ SpringBoard
- ↳ Spring: 1944
- ↳ Star Wars: Imperial Winter
- ↳ TA Prime
- ↳ Tech Annihilation
- ↳ XTA
- ↳ Zero-K
- ↳ Project Archive
- ↳ Argh's Projects
- ↳ Caydr's Projects
- ↳ Damned
- ↳ Dune: Evolution
- ↳ Engines Of War
- ↳ Evolution RTS
- ↳ Progressive Annihilation
- ↳ Supreme Annihilation
- ↳ Spring Tanks
- ↳ PanzerStahl
- Development
- ↳ News
- ↳ Engine
- ↳ Dedicated Developer Discussion
- ↳ New Developer Discussion
- ↳ Meeting Minutes
- ↳ AI
- ↳ Lobby Clients & Server
- ↳ Infrastructure Development
- ↳ Lobby Meeting Minutes
- ↳ SPADS AutoHost
- ↳ SpringLobby Client
- ↳ Feature Requests
- ↳ Bounty Offers
- ↳ The Werewolf Game
- ↳ News Submissions
- Site content
- ↳ Community Blog
- ↳ Site content
- ↳ Banners
- ↳ Welcome images
- ↳ Videos
- ↳ Videos - contributions
- ↳ Screenshots
- ↳ Screenshots - contributions