Skip to content
Snippets Groups Projects
Commit 4e4977f5 authored by DarkGod's avatar DarkGod
Browse files

stuff

parent 45b18ca4
No related branches found
No related tags found
No related merge requests found
......@@ -585,6 +585,10 @@ function _M:updateDescriptors()
self.c_options.hide = #self.cosmetic_unlocks == 0
end
function _M:isDescriptorSet(key, val)
return self.descriptors_by_type[key] == val
end
function _M:setDescriptor(key, val)
if key then
self.descriptors_by_type[key] = val
......@@ -655,7 +659,7 @@ function _M:generateCampaigns()
if self:isDescriptorAllowed(d, {difficulty=true, permadeath=true, race=true, subrace=true, class=true, subclass=true}) then
local locked = self:getLock(d)
if locked == true then
list[#list+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}:toString(), id=d.name, locked=true, desc=d.locked_desc..locktext }
list[#list+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}:toString(), id=d.name, locked=true, desc=util.getval(d.locked_desc, self)..locktext }
elseif locked == false then
local desc = d.desc
if type(desc) == "table" then desc = table.concat(d.desc, "\n") end
......@@ -682,7 +686,7 @@ function _M:generateDifficulties()
if self:isDescriptorAllowed(d, {permadeath=true, race=true, subrace=true, class=true, subclass=true}) then
local locked = self:getLock(d)
if locked == true then
list[#list+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}:toString(), id=d.name, locked=true, desc=d.locked_desc..locktext }
list[#list+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}:toString(), id=d.name, locked=true, desc=util.getval(d.locked_desc, self)..locktext }
elseif locked == false then
local desc = d.desc
if type(desc) == "table" then desc = table.concat(d.desc, "\n") end
......@@ -714,7 +718,7 @@ function _M:generatePermadeaths()
if self:isDescriptorAllowed(d, {race=true, subrace=true, class=true, subclass=true}) then
local locked = self:getLock(d)
if locked == true then
list[#list+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}:toString(), id=d.name, locked=true, desc=d.locked_desc..locktext, locked_select=d.locked_select }
list[#list+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}:toString(), id=d.name, locked=true, desc=util.getval(d.locked_desc, self)..locktext, locked_select=d.locked_select }
elseif locked == false then
local desc = d.desc
if type(desc) == "table" then desc = table.concat(d.desc, "\n") end
......@@ -749,7 +753,7 @@ function _M:generateRaces()
if d.descriptor_choices.subrace[sd.name] == "allow" then
local locked = self:getLock(sd)
if locked == true then
nodes[#nodes+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=sd.name, pid=d.name, locked=true, desc=sd.locked_desc..locktext }
nodes[#nodes+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=sd.name, pid=d.name, locked=true, desc=util.getval(sd.locked_desc, self)..locktext }
elseif locked == false then
local desc = sd.desc
if type(desc) == "table" then desc = table.concat(sd.desc, "\n") end
......@@ -761,7 +765,7 @@ function _M:generateRaces()
local locked = self:getLock(d)
if locked == true then
tree[#tree+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=d.name, shown = oldtree[d.name], nodes = nodes, locked=true, desc=d.locked_desc..locktext }
tree[#tree+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=d.name, shown = oldtree[d.name], nodes = nodes, locked=true, desc=util.getval(d.locked_desc, self)..locktext }
elseif locked == false then
local desc = d.desc
if type(desc) == "table" then desc = table.concat(d.desc, "\n") end
......@@ -802,7 +806,7 @@ function _M:generateClasses()
if (d.descriptor_choices.subclass[sd.name] == "allow" or d.descriptor_choices.subclass[sd.name] == "allow-nochange" or d.descriptor_choices.subclass[sd.name] == "nolore") and self:isDescriptorAllowed(sd, {subclass=true, class=true}) then
local locked = self:getLock(sd)
if locked == true then
nodes[#nodes+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=sd.name, pid=d.name, locked=true, desc=sd.locked_desc..locktext }
nodes[#nodes+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=sd.name, pid=d.name, locked=true, desc=util.getval(sd.locked_desc, self)..locktext }
elseif locked == false then
local old = self.descriptors_by_type.subclass
self.descriptors_by_type.subclass = nil
......@@ -821,7 +825,7 @@ function _M:generateClasses()
local locked = self:getLock(d)
if locked == true then
tree[#tree+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=d.name, shown=oldtree[d.name], nodes = nodes, locked=true, desc=d.locked_desc..locktext }
tree[#tree+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=d.name, shown=oldtree[d.name], nodes = nodes, locked=true, desc=util.getval(d.locked_desc, self)..locktext }
elseif locked == false then
local desc = d.desc
if type(desc) == "table" then desc = table.concat(d.desc, "\n") end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment