Changes

Max-width added to prevent stretch
Line 62: Line 62:  
|style="${style}"|${fuel_cost}
 
|style="${style}"|${fuel_cost}
 
|style="${style}"|${ammo_cost}]=]
 
|style="${style}"|${ammo_cost}]=]
 +
 +
local template3 = [=[|-
 +
|style="${style}" nowrap|${id}
 +
|style="${style}"|${name}
 +
|style="${style}"|${time}
 +
|style="${style}" colspan="10"|${desc}]=]
    
-- todo: use modules
 
-- todo: use modules
Line 94: Line 100:  
}
 
}
   −
local tableHeader = [=[<div style="width:90%;margin-left:20px">
+
local tableHeader = [=[<div style="max-width:1400px;width:90%;margin-left:20px">
 
{|style="width:100%"
 
{|style="width:100%"
 
|style="width:50px"|[[File:${icon}.png|link=]]
 
|style="width:50px"|[[File:${icon}.png|link=]]
Line 100: Line 106:  
|}
 
|}
 
</div>
 
</div>
<div style="position:relative;border:solid 1px lightgray;width:95%;border-radius:10px;padding:10px;margin:10px;margin-top:0px">
+
<div style="position:relative;border:solid 1px lightgray;max-width:1500px;width:95%;border-radius:10px;padding:10px;margin:10px;margin-top:0px">
{|style="margin:0 auto;radius:10px;cellpadding:10px;width:100%" cellspacing="0"
+
{|style="margin:0 auto;radius:10px;cellpadding:10px;width:100%" cellspacing="0" class="sortable"
 
!style="cellpadding:10px;width:4%;" |#
 
!style="cellpadding:10px;width:4%;" |#
 
!style="cellpadding:10px;width:24%;" |Name
 
!style="cellpadding:10px;width:24%;" |Name
 
!style="cellpadding:10px;" |Time
 
!style="cellpadding:10px;" |Time
!style="cellpadding:10px;width:1px;" rowspan="100" |
   
]=]
 
]=]
    
local tableHeader2 = [=[!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:7%;" |[[File:Fuel.png|30px|link=]]
 
!style="cellpadding:10px;width:7%;" |[[File:Fuel.png|30px|link=]]
 
!style="cellpadding:10px;width:7%;" |[[File:Ammunition.png|30px|link=]]
 
!style="cellpadding:10px;width:7%;" |[[File:Ammunition.png|30px|link=]]
 
!style="cellpadding:10px;width:7%;" |[[File:Steel.png|30px|link=]]
 
!style="cellpadding:10px;width:7%;" |[[File:Steel.png|30px|link=]]
 
!style="cellpadding:10px;width:7%;" |[[File:Bauxite.png|30px|link=]]
 
!style="cellpadding:10px;width:7%;" |[[File:Bauxite.png|30px|link=]]
!style="cellpadding:10px;width:1px;" rowspan="100" |
   
!style="cellpadding:10px;width:20%;" colspan="2" |Rewards
 
!style="cellpadding:10px;width:20%;" colspan="2" |Rewards
|-
  −
|style="background:gray;" colspan="14"|
   
]=]
 
]=]
    
local tableHeader2Req = [=[!style="cellpadding:10px;width:7%;"|Σ(Lv)
 
local tableHeader2Req = [=[!style="cellpadding:10px;width:7%;"|Σ(Lv)
 
!style="cellpadding:10px;width:7%;" align="center"|[[File:Flagship icon.png|link=]]
 
!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"|Requirements
 
!style="cellpadding:10px;width:21%;" align="center"|Requirements
 
!style="cellpadding:10px;width:7%;" align="center"|[[File:Drum.png|30px|link=]]
 
!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:Fuel.png|30px|link=]]
 
!style="cellpadding:10px;width:10%;" align="center"|[[File:Ammunition.png|30px|link=]]
 
!style="cellpadding:10px;width:10%;" align="center"|[[File:Ammunition.png|30px|link=]]
 
]=]
 
]=]
 +
 +
-- !style="cellpadding:10px;width:1px;" rowspan="100" class="unsortable"|
    
local function pad(n)
 
local function pad(n)
Line 146: Line 147:     
local itemFiles = {
 
local itemFiles = {
   [1] = 'Instant_repair.jpg',
+
   [1] = 'Item Icon Instant Repair Material.png',
   [2] = 'Instant_construction.jpg',
+
   [2] = 'Item Icon Instant Construction Material.png',
   [3] = 'Development_material.jpg',
+
   [3] = 'Item Icon Development Material.png',
   [4] = 'Improvement_material.png',
+
   [4] = 'Item Icon Improvement Material.png',
   [10] = 'Furniture_box_small.png',
+
   [10] = 'Item Icon Furniture Box (Small).png',
   [11] = 'Furniture_box_medium.png',
+
   [11] = 'Item Icon Furniture Box (Medium).png',
   [12] = 'Furniture_box_large.jpg',
+
   [12] = 'Item Icon Furniture Box (Large).png',
   [59] = 'Food_supply_ship_irako.png',
+
   [59] = 'Item Icon Food Supply Ship Irako.png',
 
}
 
}
   Line 222: Line 223:  
end
 
end
   −
local function formatRow(args, e, i, hourly, req)
+
local function formatRow(args, e, i, hourly, req, supp)
 
   local id = e.disp_no
 
   local id = e.disp_no
 
   return U.format{
 
   return U.format{
     (req and template2 or template),
+
     (supp and template3 or 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 231: Line 232:  
     ),
 
     ),
 
     id = tooltip(id, 'ID number as displayed in game') .. string.format(' (%s)', diffs[e.difficulty]),
 
     id = tooltip(id, 'ID number as displayed in game') .. string.format(' (%s)', diffs[e.difficulty]),
     name = (e.damage_type == 1 and string.format('<span style="color:red">%s</span>', tooltip(e.name, e.details)) or tooltip(e.name, e.details)) .. (e.reset_type == 1 and string.format(' (%s)', tooltip('M', 'Monthly expedtion')) or ''),
+
     name = (e.damage_type == 2 and string.format('<span style="color:#b00000">%s</span>', tooltip(e.name, e.details)) or e.damage_type == 1 and string.format('<span style="color:red">%s</span>', tooltip(e.name, e.details)) or tooltip(e.name, e.details)) .. (e.reset_type == 1 and string.format(' (%s)', tooltip('M', 'Monthly expedtion')) or ''),
 
     time = tooltip(formatTime(e.time), 'Time required for expedition'),
 
     time = tooltip(formatTime(e.time), 'Time required for expedition'),
 
     hq = tooltip(formatAmount(args.explicit[id .. ' hq'], hourly and e.time, e.reset_type), 'Admiral experience gained upon completion from this expedition'),
 
     hq = tooltip(formatAmount(args.explicit[id .. ' hq'], hourly and e.time, e.reset_type), 'Admiral experience gained upon completion from this expedition'),
Line 243: Line 244:  
     sum = formatAmount(args.explicit[id .. ' sum']),
 
     sum = formatAmount(args.explicit[id .. ' sum']),
 
     level = formatAmount(args.explicit[id .. ' level']),
 
     level = formatAmount(args.explicit[id .. ' level']),
     fleet = (e.reset_type == 1 and 'Monthly expedtion<br>' or '') .. (e.damage_type == 1 and 'Reduces HP<br>' or '') .. (args.explicit[id .. ' fleet'] or '??') .. string.format('<br>Eg %s', formatSampleFleet(e.sample_fleet)),
+
     fleet = (e.reset_type == 1 and 'Monthly expedtion<br>' or '') .. (e.damage_type == 2 and 'Reduces lots of HP<br>' or e.damage_type == 1 and 'Reduces some HP<br>' or '') .. (args.explicit[id .. ' fleet'] or '??') .. string.format('<br>Eg %s', formatSampleFleet(e.sample_fleet)),
 
     drums = formatAmount(args.explicit[id .. ' drums']),
 
     drums = formatAmount(args.explicit[id .. ' drums']),
 
     fuel_cost = e.use_fuel > 0 and '-' .. 10 * e.use_fuel or '',
 
     fuel_cost = e.use_fuel > 0 and '-' .. 10 * e.use_fuel or '',
 
     ammo_cost = e.use_bull > 0 and '-' .. 10 * e.use_bull or '',
 
     ammo_cost = e.use_bull > 0 and '-' .. 10 * e.use_bull or '',
 +
    desc = string.format('%s', args.explicit[id .. ' desc'] or ''),
 
   }
 
   }
 
end
 
end
Line 252: Line 254:  
local function formatTable(args, es, hourly, req)
 
local function formatTable(args, es, hourly, req)
 
   local world = tonumber(args.explicit.world)
 
   local world = tonumber(args.explicit.world)
 +
  local supp = args.explicit.support
 
   return U.format{
 
   return U.format{
 
     tableHeader,
 
     tableHeader,
Line 258: Line 261:  
     name = worldNames[world],
 
     name = worldNames[world],
 
   } .. (req and tableHeader2Req or tableHeader2) .. U.joinLines(U.imap(es, function(e, i)
 
   } .. (req and tableHeader2Req or tableHeader2) .. U.joinLines(U.imap(es, function(e, i)
     return formatRow(args, e, i, hourly, req)
+
     return formatRow(args, e, i, hourly, req, supp)
   end)) .. "\n|}"
+
   end)) .. "\n|}\n</div>"
 
end
 
end
   Line 266: Line 269:  
   if id then
 
   if id then
 
     local e = U.ifilter(data, function(e) return e.disp_no == id end)[1]
 
     local e = U.ifilter(data, function(e) return e.disp_no == id end)[1]
     return formatRow(args, e, args.explicit.odd and 1 or 0, args.explicit.hourly, args.explicit.requirements)
+
     return formatRow(args, e, args.explicit.odd and 1 or 0, args.explicit.hourly, args.explicit.requirements, args.explicit.support)
 
   end
 
   end
 
   local world = tonumber(args.explicit.world)
 
   local world = tonumber(args.explicit.world)
advmod, cssedit, janitor, Moderators, prechecked, Widget editors
6,955

edits