Page 1 of 1

Documentation

Posted: 30 Apr 2007, 12:40
by TechnoTone
I've got the Lua 5.0 reference manual, the "Programming in Lua" manual and I've looked in the API.txt file in my LuaUI folder but I still can't find many commands that people are using in their Lua scripts. An example is the widgetHandler:GetHourTimer() function. I can find no mention of this in any documentation.

What have I missed?

I'm finding it difficult writing the simplest of scripts because I cannot identify the objects/functions that I need.

Posted: 30 Apr 2007, 13:27
by Boirunner
i believe the idea is that you learn by reading the provided examples. read working scripts and see how the commands work.

of course, i too wish for better documentation :)

Posted: 30 Apr 2007, 13:29
by Ling_Lover
if you know some C++ you could look at the source? or learn enough to know what you're looking at atleast...

seems the best way, to me

Posted: 30 Apr 2007, 15:14
by TechnoTone
I'm doing this for fun - it's not supposed to be this difficult/stressful. :(

Posted: 01 May 2007, 06:25
by Dragon45
Oh, it will be. LUA on Spring is still a bit of a maze right now.

Best way is to download what other people have made and tweak with it.

Posted: 01 May 2007, 06:36
by trepan
TechnoTone:

There's only one dev working on the lua stuff, and so documentation updates
have been taking a backseat to the new synced LUA scripts features for a while.

As for your specific query, the widgetHandler:GetHourTimer() call isn't part of the
raw LuaUI interface, it is provided by widgetHandler (which is completely written
in lua). You can find the source code for widgetHandler in LuaUI/widgets.lua. That
particular call is defined in NewWidget(), along with some other widget specific calls.

P.S. Don't forget: I, too, am only doing this for fun...

Posted: 01 May 2007, 13:29
by TechnoTone
Thanks for the info. I'm starting to find my way around it - but it's taking some time.

As a developer I completely understand that documentation is often neglected but all I'm really looking for is just a list of the functions that are available.

Am I right in thinking that all the widgetHandler: functions are defined in this widgets.lua file and all the Spring functions are defined in the LuaUI API.txt file? If so then that is exactly what was looking for.

Posted: 02 May 2007, 07:11
by Dragon45
Aww comeon TT. If you're a developer then surely you understand there is no such thing as truly stress-free coding :P

Posted: 02 May 2007, 08:59
by TechnoTone
:lol: - Too true.