File: ui.lua

package info (click to toggle)
widelands 2%3A1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 684,084 kB
  • sloc: cpp: 196,737; ansic: 19,395; python: 8,515; sh: 1,734; xml: 700; makefile: 46; lisp: 25
file content (25 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- TODO(GunChleoc): Document more fully

-- Close the newest story message box window if there is one
function close_story_messagebox()
   if wl.ui.MapView().windows.story_message_box ~= nil then
      wl.ui.MapView().windows.story_message_box:close()
   end
end


function clean_up_message_boxes_and_indicators()
   wl.Game().map:get_field(0, 0):indicate(false)
   wl.ui.MapView():indicate(false)
   while wl.ui.MapView().windows.story_message_box ~= nil do
      wl.ui.MapView().windows.story_message_box:close()
   end
end

-- Waits for a field action tab to be there
function wait_for_field_action_tab(name)
   local mapview = wl.ui.MapView()
   while not mapview.windows.field_action or not mapview.windows.field_action.tabs[name] do
      sleep(100)
   end
end