public static void DrawAreas(CLRScriptBase script, User currentUser) { script.ClearListBox(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_AREAS"); if (ALFA.Shared.Modules.InfoStore.ActiveAreas.Keys.Contains(script.GetArea(currentUser.Id))) { ALFA.Shared.ActiveArea currentArea = ALFA.Shared.Modules.InfoStore.ActiveAreas[script.GetArea(currentUser.Id)]; string currentName = "<Color=DarkOrange>" + currentArea.DisplayName + "________"; DisplayString.ShortenStringToWidth(currentName, 250); currentName = currentName.Trim('_') + "</color>"; script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_AREAS", currentArea.Id.ToString(), "LISTBOX_ITEM_TEXT= "+currentName, "", "5="+currentArea.Id.ToString(), ""); List<ALFA.Shared.ActiveArea> adjAreas = new List<ALFA.Shared.ActiveArea>(); foreach (ALFA.Shared.ActiveArea adjacentArea in currentArea.ExitTransitions.Values) { if (!adjAreas.Contains(adjacentArea)) { string adjName = "<Color=DarkGoldenRod>" + adjacentArea.DisplayName + "________"; DisplayString.ShortenStringToWidth(adjName, 250); adjName = adjName.Trim('_') + "</color>"; script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_AREAS", adjacentArea.Id.ToString(), "LISTBOX_ITEM_TEXT= " + adjName, "", "5=" + adjacentArea.Id.ToString(), ""); adjAreas.Add(adjacentArea); } } } foreach (ALFA.Shared.ActiveArea area in AreaList) { script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_AREAS", area.Id.ToString(), "LISTBOX_ITEM_TEXT= " + area.DisplayName, "", "5=" + area.Id.ToString(), ""); } currentUser.LastSeenArea = script.GetArea(currentUser.Id); }
public static void JumpToArea(CLRScriptBase script, User currentUser) { uint currentArea = script.GetArea(currentUser.Id); if (!ALFA.Shared.Modules.InfoStore.ActiveAreas.Keys.Contains(currentUser.Id)) { } // If this is an adjacent area, jump the DM to one of the ATs connecting the areas. foreach (ALFA.Shared.ActiveTransition exitTranstion in ALFA.Shared.Modules.InfoStore.ActiveAreas[currentArea].ExitTransitions.Keys) { if (exitTranstion.AreaTarget.Id == currentUser.FocusedArea) { script.JumpToLocation(script.GetLocation(exitTranstion.Target)); return; } } // If these aren't adjacent areas, grab an AT if we can find one. if (ALFA.Shared.Modules.InfoStore.ActiveAreas[currentUser.FocusedArea].ExitTransitions.Count > 0) { foreach(ALFA.Shared.ActiveTransition enterTransition in ALFA.Shared.Modules.InfoStore.ActiveAreas[currentUser.FocusedArea].ExitTransitions.Keys) { script.JumpToLocation(script.GetLocation(enterTransition.Id)); return; } } // If we can't find one, just try the middle of the area. float x = script.GetAreaSize(AREA_WIDTH, currentUser.FocusedArea) / 2; float y = script.GetAreaSize(AREA_HEIGHT, currentUser.FocusedArea) / 2; float z = 0.0f; NWLocation loc = script.Location(currentUser.FocusedArea, script.Vector(x, y, z), 0.0f); script.JumpToLocation(loc); }
public static void SearchAreas(CLRScriptBase script, User currentUser, string searchString) { script.ClearListBox(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_AREAS"); foreach (ALFA.Shared.ActiveArea area in AreaList) { if (area.LocalizedName.ToLower().Contains(searchString.ToLower())) { script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_CHOOSER_AREAS", area.Id.ToString(), "LISTBOX_ITEM_TEXT= " + area.DisplayName, "", "5=" + area.Id.ToString(), ""); } } }
public static void WaitForSearch(CLRScriptBase script, User currentUser, ACR_ChooserCreator.ACR_CreatorCommand currentTab, CreatorSearch awaitedSearch) { if (awaitedSearch == null) { // Search has been removed. Abort. return; } if (awaitedSearch.CancellationPending) { // Search has been canceled. Abort. return; } if (currentUser.openCommand != currentTab) { // User has switched tabs. Kill the search. return; } if (currentUser.CreatorSearchResponse != null) { // Looks like we've finished. Draw a list! CreatorSearch oldSearch = currentUser.CurrentSearch; currentUser.CurrentSearch = null; oldSearch.Dispose(); Waiter.DrawNavigatorCategory(script, currentUser.CreatorSearchResponse); switch (currentUser.openCommand) { case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_CREATURE_TAB: currentUser.CurrentCreatureCategory = currentUser.CreatorSearchResponse; break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_ITEM_TAB: currentUser.CurrentItemCategory = currentUser.CreatorSearchResponse; break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_LIGHTS_TAB: currentUser.CurrentLightCategory = currentUser.CreatorSearchResponse; break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_PLACEABLE_TAB: currentUser.CurrentPlaceableCategory = currentUser.CreatorSearchResponse; break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_TRAP_TAB: currentUser.CurrentTrapCategory = currentUser.CreatorSearchResponse; break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_VFX_TAB: currentUser.CurrentVisualEffectCategory = currentUser.CreatorSearchResponse; break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_WAYPOINT_TAB: currentUser.CurrentWaypointCategory = currentUser.CreatorSearchResponse; break; } return; } script.DelayCommand(1.0f, delegate { WaitForSearch(script, currentUser, currentTab, awaitedSearch); }); }
public static void InitializeButtons(CLRScriptBase script, User currentUser) { script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_AOE", currentUser.ChooserShowAOE ? "trap.tga" : "notrap.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_CREATURE", currentUser.ChooserShowCreature ? "creature.tga" : "nocreature.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_DOOR", currentUser.ChooserShowDoor ? "door.tga" : "nodoor.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_ITEM", currentUser.ChooserShowItem ? "item.tga" : "noitem.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_LIGHT", currentUser.ChooserShowLight ? "light.tga" : "nolight.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_PLACEABLE", currentUser.ChooserShowPlaceable ? "placeable.tga" : "noplaceable.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_STORE", currentUser.ChooserShowStore ? "store.tga" : "nostore.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_TRIGGER", currentUser.ChooserShowTrigger ? "trigger.tga" : "notrigger.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_VFX", currentUser.ChooserShowPlacedEffect ? "vfx.tga" : "novfx.tga"); script.SetGUITexture(currentUser.Id, "SCREEN_DMC_CHOOSER", "SHOW_WAYPOINT", currentUser.ChooserShowWaypoint ? "waypoint.tga" : "nowaypoint.tga"); }
public static User GetUser(uint userId) { if(TrackedUsers.Keys.Contains(userId)) { return TrackedUsers[userId]; } else { User newUser = new User() { Id = userId, CurrentCreatureCategory = Navigators.CreatureNavigator.bottomCategory, CurrentItemCategory = Navigators.ItemNavigator.bottomCategory, CurrentLightCategory = Navigators.LightNavigator.bottomCategory, CurrentPlaceableCategory = Navigators.PlaceableNavigator.bottomCategory, CurrentVisualEffectCategory = Navigators.VisualEffectNavigator.bottomCategory, CurrentWaypointCategory = Navigators.WaypointNavigator.bottomCategory, CurrentTrapCategory = Navigators.TrapNavigator.bottomCategory, SortingColumn = 1 }; TrackedUsers.Add(userId, newUser); return newUser; } }
public static void FocusTabs(CLRScriptBase script, User currentUser, ACR_ChooserCreator.ACR_CreatorCommand command) { switch (command) { case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_CREATURE_TAB: script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", FALSE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", FALSE); currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_CREATURE_TAB; script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "Fac"); script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "CR"); if (currentUser.CurrentCreatureCategory == Navigators.CreatureNavigator.bottomCategory) { Waiter.WaitForNavigator(script, Navigators.CreatureNavigator); } else { if (currentUser.CurrentCreatureCategory == null) { currentUser.CurrentCreatureCategory = Navigators.CreatureNavigator.bottomCategory; } Waiter.DrawNavigatorCategory(script, currentUser.CurrentCreatureCategory); } break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_ITEM_TAB: script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", FALSE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", FALSE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE); currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_ITEM_TAB; script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "Value"); script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "Lvl"); if (currentUser.CurrentItemCategory == Navigators.ItemNavigator.bottomCategory) { Waiter.WaitForNavigator(script, Navigators.ItemNavigator); } else { if (currentUser.CurrentItemCategory == null) { currentUser.CurrentItemCategory = Navigators.ItemNavigator.bottomCategory; } Waiter.DrawNavigatorCategory(script, currentUser.CurrentItemCategory); } break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_PLACEABLE_TAB: script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", FALSE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE); currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_PLACEABLE_TAB; script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "Lck/Trp"); script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "Inv?"); if (currentUser.CurrentPlaceableCategory == Navigators.PlaceableNavigator.bottomCategory) { Waiter.WaitForNavigator(script, Navigators.PlaceableNavigator); } else { if (currentUser.CurrentPlaceableCategory == null) { currentUser.CurrentPlaceableCategory = Navigators.PlaceableNavigator.bottomCategory; } Waiter.DrawNavigatorCategory(script, currentUser.CurrentPlaceableCategory); } break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_TRAP_TAB: script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", FALSE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE); currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_TRAP_TAB; script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "DC"); script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "CR"); if (currentUser.CurrentTrapCategory == Navigators.TrapNavigator.bottomCategory) { Waiter.WaitForNavigator(script, Navigators.TrapNavigator); } else { if (currentUser.CurrentTrapCategory == null) { currentUser.CurrentTrapCategory = Navigators.TrapNavigator.bottomCategory; } Waiter.DrawNavigatorCategory(script, currentUser.CurrentTrapCategory); } break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_VFX_TAB: script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", FALSE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE); currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_VFX_TAB; script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, " "); script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, " "); if (currentUser.CurrentVisualEffectCategory == Navigators.VisualEffectNavigator.bottomCategory) { Waiter.WaitForNavigator(script, Navigators.VisualEffectNavigator); } else { if (currentUser.CurrentVisualEffectCategory == null) { currentUser.CurrentVisualEffectCategory = Navigators.VisualEffectNavigator.bottomCategory; } Waiter.DrawNavigatorCategory(script, currentUser.CurrentVisualEffectCategory); } break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_WAYPOINT_TAB: script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", FALSE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE); currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_WAYPOINT_TAB; script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, " "); script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, " "); if (currentUser.CurrentWaypointCategory == Navigators.WaypointNavigator.bottomCategory) { Waiter.WaitForNavigator(script, Navigators.WaypointNavigator); } else { if (currentUser.CurrentWaypointCategory == null) { currentUser.CurrentWaypointCategory = Navigators.WaypointNavigator.bottomCategory; } Waiter.DrawNavigatorCategory(script, currentUser.CurrentWaypointCategory); } break; case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_LIGHTS_TAB: script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", FALSE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE); script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE); currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_LIGHTS_TAB; script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "Brt/Rd"); script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "Shd"); if (currentUser.CurrentWaypointCategory == Navigators.LightNavigator.bottomCategory) { Waiter.WaitForNavigator(script, Navigators.LightNavigator); } else { if (currentUser.CurrentLightCategory == null) { currentUser.CurrentLightCategory = Navigators.LightNavigator.bottomCategory; } Waiter.DrawNavigatorCategory(script, currentUser.CurrentLightCategory); } break; } }
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(), ""); } }); } }); }
public static void DrawLimbo(CLRScriptBase script, User currentUser) { script.ClearListBox(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_LIMBO_OBJECTS"); int max = script.GetLimboCreatureCount(); int count = 0; while (count < max) { uint thing = script.GetCreatureInLimbo(count); if (script.GetIsObjectValid(thing) == TRUE) { script.AddListBoxRow(currentUser.Id, "SCREEN_DMC_CHOOSER", "LISTBOX_ACR_LIMBO_OBJECTS", thing.ToString(), "LISTBOX_ITEM_TEXT= " + script.GetName(thing), "LISTBOX_ITEM_ICON=creature.tga", "5=" + thing.ToString(), ""); } count++; } }