about summary refs log tree commit diff stats
path: root/data/maps/the_talented/rooms/Main Area.txtpb
Commit message (Expand)AuthorAgeFilesLines
* Added display names to portsStar Rauchenberger2025-09-281-0/+1
* [Data] Annotate shuffleable portsStar Rauchenberger2025-09-211-0/+2
* Added keyholder sanityStar Rauchenberger2025-09-021-0/+1
* Added the_talentedStar Rauchenberger2025-08-251-0/+114
25'>25 26 27 28 29 30 31
32
33
34
35
36
37
38
39
40
41
42
43























                                                             






                                                               











                                               
require 'yaml'

configpath = ARGV[0]
outputpath = ARGV[1]

config = YAML.load_file(configpath)
output = config.map do |panel|
  ret = panel
  if ret["color"].kind_of? String
    ret["color"] = [ret["color"]]
  end
  ret
end.map do |panel|
  ret = {}
  ret["id"] = "\"#{panel["id"]}\""
  ret["color"] = "[\"" + panel["color"].join("\",\"") + "\"]"
  ret["tag"] = "\"#{panel["tag"]}\""
  if panel.include? "subtag"
    ret["subtag"] = "\"#{panel["subtag"]}\""
  end
  if panel.include? "link"
    ret["link"] = "\"#{panel["link"]}\""
  end
  if panel.include? "copy_to_sign"
    copytos = []
    if panel["copy_to_sign"].kind_of? String
      copytos = [panel["copy_to_sign"]]
    else
      copytos = panel["copy_to_sign"]
    end
    ret["copy_to_sign"] = "[\"" + copytos.join("\",\"") + "\"]"
  end
    ret
end.map do |panel|
  "{" + panel.to_a.map do |element|
    "\"#{element[0]}\":#{element[1]}"
  end.join(",") + "}"
end.join(",")

header = "extends Node\n\nvar panels = ["
footer = "]"

File.write(outputpath, header + output + footer)