So I removed 4/5ths of my UI as a test, and I did get a compile. Interesting though - I have two issues with what remains in AU vs what's in preview.
- Combo boxes do not have contents. Their contents should be coming from an array converted to a string with new lines.
- Some images I put on the GUI have incorrect X values when they use a global integer in their calculation.
For 1, here is the code: Anything jump out to anyone?
const resetJSON = Engine.loadFromJSON("../Reset.json");
const presetsJSON = Engine.loadFromJSON("../Presets.json");
const jsonObj = { "Reset": resetJSON, "Presets": presetsJSON };
var resetChoices = [];
var presetsChoices = [];
for (choice in resetJSON) resetChoices.push(choice);
for (choice in presetsJSON) presetsChoices.push(choice);
resetChoices = resetChoices.join("\n");
presetsChoices = presetsChoices.join("\n");
const comboH = 22;
const resetCombo = Content.addComboBox("Reset", 10, 4);
Content.setPropertiesFromJSON("Reset", {
"width": 60,
"items": resetChoices,
"height": comboH,
"parentComponent": "Header",
"bgColour": 0,
"itemColour": defaultColour,
"itemColour2": 0,
"textColour": defaultColour,
});
const presetsCombo = Content.addComboBox("Presets", 76, 4);
Content.setPropertiesFromJSON("Presets", {
"width": 68,
"items": presetsChoices,
"height": comboH,
"parentComponent": "Header",
"bgColour": 0,
"itemColour": defaultColour,
"itemColour2": 0,
"textColour": defaultColour,
});
inline function setValues(json, c) {
for (k in json) {
if (k.contains("FaderPack")) {
Content.getComponent(k).setAllValues(json[k]);
} else {
Content.getComponent(k).setValue(json[k]);
}
}
c.setValue(0);
}
inline function onSetControl(c, value) {
if (value > 0) {
local id = c.getId();
local selection = c.getItemText();
local json = jsonObj[id][selection];
setValues(json, c);
}
}
Content.getComponent("Reset").setControlCallback(onSetControl);
Content.getComponent("Presets").setControlCallback(onSetControl);