Loading...
Home
Home
Unlocks
Commanders
Map Bans
Polls
Play
Download Zero-K
Download the game, it's free! :)
Maps
Thousands of maps to pick
Replays
All your past victories, stored here!
Mods
Special game modes
Media
Screenshots
Videos
Presskit
Wiki
Index
Newbie guide
Don't know where to begin? Click here.
Video tutorials
Demonstrating both basic and advanced features
Units
Economy
Terraforming
Let's go play in the dirt!
FAQ
Frequently Asked Questions
PlanetWars
PlanetWars
Multiplayer online campaign
Ladder
Factions
The mighty factions controlling huge sectors of galaxy
Community
Forum
Discuss, ask for help, have fun!
Clans
Play with your friends or make friends while playing :)
Ladders
Statistics
Code of Conduct
Be nice, have fun!
Develop
Make the game with us
Privacy Policy
Contact
Contact the Zero-K team
Credits
Makers of Zero-K
Donate
Help cover the server costs!
OR
Zero-K Name:
Password:
Login
Forum index
>
General discussion
>
How to create simple widget?
5 posts, 715 views
Post comment
Filter:
Player:
sort
[i]MikelSV
5 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
sprang
5 years ago
Your widget probably has an error then. Check the infolog.txt
+0
/
-0
terve886
5 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
Lokisar
5 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
Shaman
5 years ago
(edited 5 years ago)
No. You only need the lua source file (eg: test.lua) in the Zero-K\LuaUI\widgets folder.
+2
/
-0