Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1.     local nationStat = ufox.datatable.build(rootNode, {
  2.         name = "nationslist",
  3.         pos = {465, 75},
  4.         size = {545, 235},
  5.     })
  6.  
  7.     nationStat:add_headerFields({
  8.         { name = "flag",        width =  20, },
  9.         { name = "nation_name", width = 270, text = "_Nation", },
  10.         { name = "funding",     width = 100, text = "_Funding",   contentalign = ufo.ALIGN_CR, },
  11.         { name = "happiness",   width = 135, text = "_Happiness", contentalign = ufo.ALIGN_CR, },
  12.     })
  13.  
  14.     local nations_add = ufox.build({
  15.         name = "ui_nations_fill",
  16.         class = "confunc",
  17.  
  18.         on_click = function (sender, nationID, nationName, monthIDX, nationHappiness, nationHappinessString, nationFunding, nationColor)
  19.             if (monthIDX ~= "0") then
  20.                 return
  21.             end
  22.  
  23.             -- ufo.print(string.format("Got data for nation %s month %s\n", nationID, monthIDX))
  24.             local row = sender:parent():child("nationslist"):add_dataRow({name = nationID}, {
  25.                 { name = "flag",        source = "nations/" .. nationID, class = "image", keepratio = true, ghost = true, },
  26.                 { name = "nation_name", text = nationName, },
  27.                 { name = "funding",     text = nationFunding,            contentalign = ufo.ALIGN_CR, },
  28.                 { name = "happiness",   text = nationHappinessString,    contentalign = ufo.ALIGN_CR, },
  29.             })
  30.         end,
  31.     }, rootNode);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement