import Package from "../../data/Package"; import Path from '../../Path'; import { TemplateSystem } from "../../TemplateSystem"; import Ts3PathOut from "./Ts3PathOut"; import Ts3PathTemplate from "./Ts3PathTemplate"; export default class Ts3ExportGuiSoundKey { public static Export(pkg: Package) { let coms: any[] = []; for(let component of pkg.sounds) { if(!component.exported) continue; coms.push([component.soundKey,component.name,component.id,Path.GetExtension(component.name)]); } let template: TemplateSystem = new TemplateSystem(Path.ReadTxt(Ts3PathTemplate.FguiSoundKey)); template.AddVariable("packageName",pkg.name); template.AddVariable("packageId",pkg.id); template.AddVariable("list",coms); let content = template.Parse(); let path = Ts3PathOut.FguiSoundKey; Path.CheckPath(path); Path.WriteTxt(path,content); } }