Skip to content

Commit

Permalink
Add a code example for Spring.Yield()
Browse files Browse the repository at this point in the history
  • Loading branch information
sprunk committed Sep 23, 2023
1 parent 474f829 commit bcba7cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rts/Lua/LuaUnsyncedCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4837,6 +4837,13 @@ int LuaUnsyncedCtrl::SetClipboard(lua_State* L)
*
* Should be called after each widget/unsynced gadget is loaded in widget/gadget handler. Use it to draw screen updates and process windows events.
*
* @usage#
* local wantYield = Spring.Yield and Spring.Yield() -- nil check: not present in synced
* for wupget in pairs(wupgetsToLoad) do
* loadWupget(wupget)
* wantYield = wantYield and Spring.Yield()
* end
*
* @number sleep time in milliseconds.
* @treturn bool when true caller should continue calling `Spring.Yield` during the widgets/gadgets load, when false it shouldn't call it any longer.
*/
Expand Down

0 comments on commit bcba7cc

Please sign in to comment.