Changes

no edit summary
Line 26: Line 26:  
|style="${style}"|${item1}
 
|style="${style}"|${item1}
 
|style="${style}"|${item2}]=]
 
|style="${style}"|${item2}]=]
 +
 +
local template2 = [=[|-
 +
|style="${style}"|${id}
 +
|style="${style}"|${name}
 +
|style="${style}"|${time}
 +
|style="${style}"|${sum}
 +
|style="${style}"|${level}
 +
|style="${style}"|${fleet}
 +
|style="${style}"|${drums}
 +
|style="${style}"|${fuel_cost}
 +
|style="${style}"|${ammo_cost}]=]
    
-- todo: use modules
 
-- todo: use modules
Line 70: Line 81:  
!style="cellpadding:10px;" |Time
 
!style="cellpadding:10px;" |Time
 
!style="cellpadding:10px;width:1px;" rowspan="100" |
 
!style="cellpadding:10px;width:1px;" rowspan="100" |
!style="cellpadding:10px;width:7%;" |HQ
+
]=]
 +
 
 +
local tableHeader2 = [=[!style="cellpadding:10px;width:7%;" |HQ
 
!style="cellpadding:10px;width:7%;" |Ship
 
!style="cellpadding:10px;width:7%;" |Ship
 
!style="cellpadding:10px;width:1px;" rowspan="100" |
 
!style="cellpadding:10px;width:1px;" rowspan="100" |
Line 81: Line 94:  
|-
 
|-
 
|style="background:gray;" colspan="14"|
 
|style="background:gray;" colspan="14"|
 +
]=]
 +
 +
local tableHeader2Req = [=[!style="cellpadding:10px;width:7%;"|Σ(Lv)
 +
!style="cellpadding:10px;width:7%;" align="center"|[[File:Flagship icon.png|link=]]
 +
!style="cellpadding:10px;width:1px;" rowspan="100"|
 +
!style="cellpadding:10px;width:21%;" align="center"|Minimum Fleet Size
 +
!style="cellpadding:10px;width:7%;" align="center"|[[File:Drum.png|30px|link=]]
 +
!style="cellpadding:10px;width:1px;" rowspan="100"|
 +
!style="cellpadding:10px;width:10%;" align="center"|[[File:Fuel.png|30px|link=]]
 +
!style="cellpadding:10px;width:10%;" align="center"|[[File:Ammunition.png|30px|link=]]
 
]=]
 
]=]
   Line 151: Line 174:  
</tabber>]=]
 
</tabber>]=]
   −
local function formatTable(args, es, hourly)
+
local function formatTable(args, es, hourly, req)
 
   local world = tonumber(args.explicit.world)
 
   local world = tonumber(args.explicit.world)
 
   return U.format{
 
   return U.format{
Line 158: Line 181:  
     background = headerBackgrounds[world],
 
     background = headerBackgrounds[world],
 
     name = worldNames[world],
 
     name = worldNames[world],
   } .. U.joinLines(U.imap(es, function(e, i)
+
   } .. (req and tableHeader2Req or tableHeader2) .. U.joinLines(U.imap(es, function(e, i)
 
     local id = e.disp_no
 
     local id = e.disp_no
 
     return U.format{
 
     return U.format{
       template,
+
       (req and template2 or template),
 
       style = string.format(
 
       style = string.format(
 
         'text-align: center; height: 35px; background: #%s; color:#000',
 
         'text-align: center; height: 35px; background: #%s; color:#000',
Line 177: Line 200:  
       item1 = e.win_item1[1] > 0 and formatItem(e.win_item1[1], e.win_item1[2]) or '',
 
       item1 = e.win_item1[1] > 0 and formatItem(e.win_item1[1], e.win_item1[2]) or '',
 
       item2 = e.win_item2[1] > 0 and formatItem(e.win_item2[1], e.win_item2[2]) or '',
 
       item2 = e.win_item2[1] > 0 and formatItem(e.win_item2[1], e.win_item2[2]) or '',
 +
      sum = args.explicit[id .. ' sum'] or '??',
 +
      level = args.explicit[id .. ' level'] or '??',
 +
      fleet = args.explicit[id .. ' fleet'] or '??',
 +
      drums = args.explicit[id .. ' drums'] or '??',
 +
      fuel_cost = args.explicit[id .. ' fuel cost'] or '??',
 +
      ammo_cost = args.explicit[id .. ' ammo cost'] or '??',
 
     }
 
     }
 
   end)) .. "\n|}"
 
   end)) .. "\n|}"
Line 188: Line 217:  
     total = formatTable(args, es),
 
     total = formatTable(args, es),
 
     hourly = formatTable(args, es, true),
 
     hourly = formatTable(args, es, true),
     requirements = '',
+
     requirements = formatTable(args, es, false, true),
 
   })
 
   })
 
end
 
end
cssedit, gkautomate
7,064

edits