Author Topic: GUI that lists datablocks?  (Read 870 times)

Like the wrench events dlg, where you can select an emitter for the brick and stuff like that, how would I go about setting the datablock for the list to get?

You use a GUIPopupMenuCtrl and then add all the DBs to it.

You use a GUIPopupMenuCtrl and then add all the DBs to it.
This didn't help at all, you basicly just repeated exactly what I want to do

I have no idea HOW to add all the datablocks to it ._.
« Last Edit: October 30, 2011, 08:11:53 PM by soba »

So would this be like a scroll/list ctrl?


I remember on my old searching script for Scavenger mod, Munk made me a loop that would get all the datablocks.

Code: [Select]
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");
  }
}

Anyway, to make it add to the list, I think you can just do

Code: [Select]
function AddToModule(%obj)
{
  for(%i=0;%i<DataBlockGroup.getCount();%i++)
  {
    %obj=DataBlockGroup.getObject(%i);
    list.addRow(%obj);
  }
}

That should work. I'm not good with GUIs, but this will probably work. Just call the function somewhere in your script.


I remember on my old searching script for Scavenger mod, Munk made me a loop that would get all the datablocks.

Code: [Select]
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");
  }
}

Anyway, to make it add to the list, I think you can just do

Code: [Select]
function AddToModule(%obj)
{
  for(%i=0;%i<DataBlockGroup.getCount();%i++)
  {
    %obj=DataBlockGroup.getObject(%i);
    list.addRow(%obj);
  }
}

That should work. I'm not good with GUIs, but this will probably work. Just call the function somewhere in your script.


ty, locked