Guest User

Untitled

a guest
Nov 9th, 2009
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | None | 0 0
  1.  
  2. function widget:GetInfo()
  3.     return {
  4.         name = "Show AI names",
  5.         desc = "Test Hoiju code",
  6.         author = "zwzsg",
  7.         date = "nao",
  8.         license = "Mine",
  9.         layer = 0,
  10.         enabled = true
  11.     }
  12. end
  13.  
  14. function widget:GameFrame(f)
  15. -- widgetHandler:RemoveWidget()
  16. end
  17.  
  18. function widget:Update()
  19. end
  20.  
  21. function widget:DrawScreenEffects(vsx,vsy)
  22.     if true or Spring.IsDevLuaEnabled() then
  23.         local txt=""
  24.         for _,team in ipairs(Spring.GetTeamList()) do
  25.             teamID,skirmishAIID,name,hostingPlayerID,shortName,version,options=Spring.GetAIInfo(team)
  26.             txt=txt.."teamID="..tostring(teamID)
  27.             .."   skirmishAIID="..tostring(skirmishAIID)
  28.             .."   name="..tostring(name)
  29.             .."   hostingPlayerID="..tostring(hostingPlayerID)
  30.             .."\n"
  31.             .."   shortName="..tostring(shortName)
  32.             .."   version="..tostring(version)
  33.             .."   options="..tostring(options)
  34.             if type(options)=="table" then
  35.                 local optstr=nil
  36.                 for key,value in pairs(options) do
  37.                     optstr=(optstr and (optstr..",") or "")..tostring(key).."="..tostring(value)
  38.                 end
  39.                 txt=txt.."=\n{"..(optstr or "").."}"
  40.             end
  41.             txt=txt.."\n\n"
  42.         end
  43.         gl.Text(txt,8,vsy*4/5,16)
  44.     end
  45. end
  46.  
Advertisement
Add Comment
Please, Sign In to add comment