Changes

Line 24: Line 24:  
|style="background-color:#eef2f7;font-size:18px"|%s
 
|style="background-color:#eef2f7;font-size:18px"|%s
 
|style="background-color:#eef2f7;font-size:18px"|%s]=],
 
|style="background-color:#eef2f7;font-size:18px"|%s]=],
item_row_choice1 = [=[|-
+
item_style = [=[|-
|data-sort-value="%s" style="background-color:#eef2f7;font-size:12px;line-height:14px;border-top:4px solid grey"|%s<br>[[%s]]
+
|data-sort-value="%s" style="background-color:#eef2f7;color:red;font-size:12px;line-height:14px;width:auto;border-bottom:4px solid grey;border-top:4px solid grey"|]=],
|style="background-color:#eef2f7;font-size:18px;border-top:4px solid grey"|%s
+
item_amount_style = [=[
|style="background-color:#eef2f7;font-size:18px;border-top:4px solid grey"|%s
+
|style="background-color:#eef2f7;font-size:18px;border-bottom:4px solid grey;border-top:4px solid grey"|]=],
|style="background-color:#eef2f7;font-size:18px;border-top:4px solid grey"|%s
  −
|style="background-color:#eef2f7;font-size:18px;border-top:4px solid grey"|%s]=],
  −
item_row_choice2 = [=[|-
  −
|data-sort-value="%s" style="background-color:#eef2f7;font-size:12px;line-height:14px;border-bottom:4px solid grey"|%s<br>[[%s]]
  −
|style="background-color:#eef2f7;font-size:18px;border-bottom:4px solid grey"|%s
  −
|style="background-color:#eef2f7;font-size:18px;border-bottom:4px solid grey"|%s
  −
|style="background-color:#eef2f7;font-size:18px;border-bottom:4px solid grey"|%s
  −
|style="background-color:#eef2f7;font-size:18px;border-bottom:4px solid grey"|%s]=],
   
}
 
}
   Line 135: Line 127:  
if types[name] == 'choice' then
 
if types[name] == 'choice' then
 
local names = U.split(name, '||')
 
local names = U.split(name, '||')
local name1 = names[1]:sub(1, -2)
+
local name2 = names[2]:sub(1, -2)
+
local reward = {}
table.insert(result, string.format(template.item_row_choice1, 0, getAsset(name1), name1,
+
local difficulty = {'Casual', 'Easy', 'Medium', 'Hard'}
getCell(name, 'Casual', 1), getCell(name, 'Easy', 1), getCell(name, 'Medium', 1), getCell(name, 'Hard', 1)))
+
table.insert(result, template.choice)
+
--Output the reward items
table.insert(result, string.format(template.item_row_choice2, 0, getAsset(name2), name2,
+
table.insert(result, template.item_style)
getCell(name, 'Casual', 2), getCell(name, 'Easy', 2), getCell(name, 'Medium', 2), getCell(name, 'Hard', 2)))
+
local str = "%s"
 +
for c=1, #names do
 +
if c>1 then str = str .. " OR %s " end
 +
str = string.format(str, getAsset(names[c]:sub(1, -2)))
 +
end
 +
table.insert(result, str)
 +
 +
--Output the amounts of reward for each difficulty & item
 +
for d=1, #difficulty do
 +
str = template.item_amount_style .. "%s "
 +
for c=1, #names do
 +
if c>1 then if getCell(name, difficulty[d], c) == '' then str = str .. " %s " else str = str .. " / %s " end end
 +
if getCell(name, difficulty[d], c) == '' then str = string.format(str, "") else str = string.format(str, getCell(name, difficulty[d], c)) end
 +
end
 +
table.insert(result, str)
 +
end
 
else
 
else
 
table.insert(result, string.format(template.item_row, 0, getAsset(name), name,
 
table.insert(result, string.format(template.item_row, 0, getAsset(name), name,
1,034

edits