happy-agent-4114
09/16/2021, 8:00 PMhx
@:bind(rM, MouseEvent.CLICK)
function reloadMods(_) {
if (FileSystem.exists(modpath.text)) {
var a:Array<String> = FileSystem.readDirectory(modpath.text);
mods.dataSource.allowCallbacks = false;
for (i in 0...a.length) {
trace(a[i].split("_")[0]);
trace(!FileSystem.exists(modpath.text+'/'+a[i]+'/disable.it'));
mods.dataSource.add({
text: a[i].split("_")[0],
enabled: !FileSystem.exists(modpath.text+'/'+a[i]+'/disable.it')
});
}
mods.dataSource.allowCallbacks = true;
}
else {
modpath.text = 'unknown';
}
}
this outputs the traces but doesn't add anything to the mods scrollhappy-agent-4114
09/16/2021, 8:01 PMhappy-agent-4114
09/16/2021, 8:01 PMhappy-agent-4114
09/16/2021, 8:04 PMxml
<box text="Modpacks" style="background-color:#0f0f0f" width="100%" height="100%">
<hbox width="100%" height="100%">
<listview id="packs" width="50%" height="100%" selectedIndex="0">
<data></data>
</listview>
<listview id="mods" width="50%" height="100%">
<item-renderer layoutName="a" width="100%">
<checkbox id="enabled" />
<label width="100%" id="text" textAlign="center" style="font-size:10px" />
</item-renderer>
<data></data>
</listview>
</hbox>
</box>
this is the tabview that's shownbright-gpu-74537
09/16/2021, 8:06 PMlayoutName="a"happy-agent-4114
09/16/2021, 8:06 PMbright-gpu-74537
09/16/2021, 8:06 PMhappy-agent-4114
09/16/2021, 8:08 PMbright-gpu-74537
09/16/2021, 8:12 PMbright-gpu-74537
09/16/2021, 8:12 PMhappy-agent-4114
09/16/2021, 8:12 PMhappy-agent-4114
09/16/2021, 8:12 PMbright-gpu-74537
09/16/2021, 8:13 PMbright-gpu-74537
09/16/2021, 8:13 PMallowCallbacks (for now)happy-agent-4114
09/16/2021, 8:15 PMhappy-agent-4114
09/16/2021, 8:15 PMbright-gpu-74537
09/16/2021, 8:16 PMbright-gpu-74537
09/16/2021, 8:16 PMhappy-agent-4114
09/16/2021, 8:18 PMhappy-agent-4114
09/16/2021, 8:19 PMbright-gpu-74537
09/16/2021, 8:19 PMhappy-agent-4114
09/16/2021, 8:19 PMbright-gpu-74537
09/16/2021, 8:19 PMhappy-agent-4114
09/16/2021, 8:21 PMhappy-agent-4114
09/16/2021, 8:22 PMhappy-agent-4114
09/16/2021, 8:22 PMhappy-agent-4114
09/16/2021, 8:23 PMbright-gpu-74537
09/16/2021, 8:23 PMbright-gpu-74537
09/16/2021, 8:24 PMxml
<vbox text="Modpacks" style="__background-color:#0f0f0f;padding: 5px;" width="100%" height="100%">
<hbox width="100%" height="100%">
<listview id="packs" width="50%" height="100%" selectedIndex="0">
<data></data>
</listview>
<listview id="mods" width="50%" height="100%">
<item-renderer layoutName="horizontal" width="100%">
<checkbox id="enabled" />
<label width="100%" id="text" textAlign="left" style="__font-size:10px" />
</item-renderer>
<data></data>
</listview>
</hbox>
</vbox>bright-gpu-74537
09/16/2021, 8:24 PMhaxe
@:build(haxe.ui.ComponentBuilder.build("assets/main-view.xml"))
class MainView extends VBox {
public function new() {
super();
mods.dataSource.allowCallbacks = false;
for (i in 0...200) {
mods.dataSource.add({
enabled: Std.random(2) == 0,
text: "Item " + i
});
}
mods.dataSource.allowCallbacks = true;
}
}