Blockland Forums > Modification Help
GUI that lists datablocks?
mp7964:
I remember on my old searching script for Scavenger mod, Munk made me a loop that would get all the datablocks.
--- Code: ---function AddToModule(%obj)
{
for(%i=0;%i<DataBlockGroup.getCount();%i++)
{
%obj=DataBlockGroup.getObject(%i);
%file = new fileObject();
%file.openForAppend("./test.cs");
%file.writeLine(%obj);
echo("Weapon datablocks added to ./test.cs");
}
}
--- End code ---
Anyway, to make it add to the list, I think you can just do
--- Code: ---function AddToModule(%obj)
{
for(%i=0;%i<DataBlockGroup.getCount();%i++)
{
%obj=DataBlockGroup.getObject(%i);
list.addRow(%obj);
}
}
--- End code ---
That should work. I'm not good with GUIs, but this will probably work. Just call the function somewhere in your script.
soba:
--- Quote from: mp7964 on November 01, 2011, 06:11:31 PM ---I remember on my old searching script for Scavenger mod, Munk made me a loop that would get all the datablocks.
--- Code: ---function AddToModule(%obj)
{
for(%i=0;%i<DataBlockGroup.getCount();%i++)
{
%obj=DataBlockGroup.getObject(%i);
%file = new fileObject();
%file.openForAppend("./test.cs");
%file.writeLine(%obj);
echo("Weapon datablocks added to ./test.cs");
}
}
--- End code ---
Anyway, to make it add to the list, I think you can just do
--- Code: ---function AddToModule(%obj)
{
for(%i=0;%i<DataBlockGroup.getCount();%i++)
{
%obj=DataBlockGroup.getObject(%i);
list.addRow(%obj);
}
}
--- End code ---
That should work. I'm not good with GUIs, but this will probably work. Just call the function somewhere in your script.
--- End quote ---
ty, locked