Fork of https://github.com/modality/charred-black.
Short term, has some fixes.
Long term, may include a tool to create and edit stock/lifepath/skill/trait data.
http://charred.obscuritus.ca:8080/#/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
832 B
27 lines
832 B
require 'json'
|
|
|
|
module Charred
|
|
module Custom
|
|
def load_custom(data)
|
|
Dir.glob("data/custom/**/*") { |file|
|
|
if File.file?(file)
|
|
case File.extname(file)
|
|
when ".skills"
|
|
verbose_merge data[:skills], json_get(file)
|
|
when ".traits"
|
|
verbose_merge data[:traits], json_get(file)
|
|
when ".stock"
|
|
stock = Stock.new(json_get(file))
|
|
data[:stocks].deep_merge!({ stock.key => stock })
|
|
when ".lifepaths"
|
|
contents = json_get(file)
|
|
data[:lifepaths].deep_merge!({ contents["stock"] => contents["settings"]})
|
|
when ".resources"
|
|
contents = json_get(file)
|
|
data[:resources].deep_merge!({ contents["stock"] => contents["resources"]})
|
|
end
|
|
end
|
|
}
|
|
end
|
|
end
|
|
end
|
|
|