Loading...
  OR  Zero-K Name:    Password:   

How to create simple widget?

5 posts, 397 views
Post comment
Filter:    Player:  
sort
4 years ago
Hello.
How to create simple widget?

Settings -> Misc -> Enable local widgets -> Yes.
Add test.lua to Steam\steamapps\common\Zero-K\LuaUI\Widgets .
LuaUi reloaded.

No my widget in Widgets List. :(
+0 / -0


4 years ago
Your widget probably has an error then. Check the infolog.txt
+0 / -0


4 years ago
You should probably start by installing an already made widget from springfiles to check you have enabled widgets correctly. Also remember to save them as .lua files.

A simple widget example that should show up as "Test" in your widget list.
quote:

function widget:GetInfo()
return {
name = "Test",
desc = "Just a test",
author = "terve886",
date = "Now",
license = "PD", -- should be compatible with Spring
layer = 0,
handler = true, --for adding customCommand into UI, not needed for all widgets so you can probably just remove this line
enabled = true -- loaded by default?
}
end
+1 / -0

4 years ago
terve wouldn't that piece have a file directory to a lua file that does the work in the /widgets/test?
+0 / -0
No. You only need the lua source file (eg: test.lua) in the Zero-K\LuaUI\widgets folder.
+2 / -1