public static void DrawObjects(CLRScriptBase script, User currentUser, uint currentArea)
{
float fDelay = 0.1f;
List<uint> ChooserAoEs = new List<uint>();
List<uint> ChooserCreatures = new List<uint>();
List<uint> ChooserDoors = new List<uint>();
List<uint> ChooserItems = new List<uint>();
List<uint> ChooserLights = new List<uint>();
List<uint> ChooserPlaceables = new List<uint>();
List<uint> ChooserPlacedEffects = new List<uint>();
List<uint> ChooserStores = new List<uint>();
List<uint> ChooserTriggers = new List<uint>();
List<uint> ChooserWaypoints = new List<uint>();
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in script.GetObjectsInArea(currentArea))
{
int objectType = script.GetObjectType(thing);
switch (objectType)
{
case OBJECT_TYPE_AREA_OF_EFFECT:
ChooserAoEs.Add(thing);
break;
case OBJECT_TYPE_CREATURE:
ChooserCreatures.Add(thing);
break;
case OBJECT_TYPE_DOOR:
ChooserDoors.Add(thing);
break;
case OBJECT_TYPE_ITEM:
ChooserItems.Add(thing);
break;
case OBJECT_TYPE_LIGHT:
ChooserLights.Add(thing);
break;
case OBJECT_TYPE_PLACEABLE:
ChooserPlaceables.Add(thing);
break;
case OBJECT_TYPE_PLACED_EFFECT:
ChooserPlacedEffects.Add(thing);
break;
case OBJECT_TYPE_STORE:
ChooserStores.Add(thing);
break;
case OBJECT_TYPE_TRIGGER:
ChooserTriggers.Add(thing);
break;
case OBJECT_TYPE_WAYPOINT:
ChooserWaypoints.Add(thing);
break;
}
}
script.ClearListBox(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS");
if (ChooserAoEs.Count > 0 && currentUser.ChooserShowAOE)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserAoEs)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetTag(thing), "LISTBOX_ITEM_ICON=trap.tga", "5="+thing.ToString(), "");
}
});
}
if (ChooserCreatures.Count > 0 && currentUser.ChooserShowCreature)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserCreatures)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing), "LISTBOX_ITEM_ICON=creature.tga", "5=" + thing.ToString(), "");
}
});
}
if (ChooserDoors.Count > 0 && currentUser.ChooserShowDoor)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserDoors)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing), "LISTBOX_ITEM_ICON=door.tga", "5=" + thing.ToString(), "");
}
});
}
if (ChooserItems.Count > 0 && currentUser.ChooserShowItem)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserItems)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing), "LISTBOX_ITEM_ICON=item.tga", "5=" + thing.ToString(), "");
}
});
}
if (ChooserLights.Count > 0 && currentUser.ChooserShowLight)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserLights)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing) + ";LISTBOX_ITEM_TEXT2= Light", "LISTBOX_ITEM_ICON=light.tga", "5=" + thing.ToString(), "");
}
});
}
if (ChooserPlaceables.Count > 0 && currentUser.ChooserShowPlaceable)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserPlaceables)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing) + ";LISTBOX_ITEM_TEXT2= Placeable", "LISTBOX_ITEM_ICON=placeable.tga", "5=" + thing.ToString(), "");
}
});
}
if (ChooserPlacedEffects.Count > 0 && currentUser.ChooserShowPlacedEffect)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserPlacedEffects)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing) + ";LISTBOX_ITEM_TEXT2= Placed Effect", "LISTBOX_ITEM_ICON=vfx.tga", "5=" + thing.ToString(), "");
}
});
}
if (ChooserStores.Count > 0 && currentUser.ChooserShowStore)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserStores)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing) + ";LISTBOX_ITEM_TEXT2= Store", "LISTBOX_ITEM_ICON=store.tga", "5=" + thing.ToString(), "");
}
});
}
if (ChooserTriggers.Count > 0 && currentUser.ChooserShowTrigger)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserTriggers)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing) + ";LISTBOX_ITEM_TEXT2= Trigger", "LISTBOX_ITEM_ICON=trigger.tga", "5=" + thing.ToString(), "");
}
});
}
if (ChooserWaypoints.Count > 0 && currentUser.ChooserShowWaypoint)
{
fDelay += 0.1f;
script.DelayCommand(fDelay, delegate
{
foreach (uint thing in ChooserWaypoints)
{
script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing) + ";LISTBOX_ITEM_TEXT2= Waypoint", "LISTBOX_ITEM_ICON=waypoint.tga", "5=" + thing.ToString(), "");
}
});
}
});
}