about summary refs log tree commit diff stats
path: root/data/maps/the_revitalized/rooms/Hide Room.txtpb
blob: 92b29bfc03929e2f097542e3a9f3081e5df6d46c (plain) (blame)
1
2
3
4
5
6
7
8
name: "Hide Room"
panels {
  name: "HIDE"
  path: "Panels/panel_2"
  clue: "hide"
  answer: "hi"
  symbols: SPARKLES
}
teral.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
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"
    ret["copy_to_sign"] = "\"#{panel["copy_to_sign"]}\""
  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)