예제 #1
0
 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);
 }
예제 #2
0
 public static void DrawNavigatorCategory(CLRScriptBase script, NavigatorCategory nav)
 {
     if (nav != null)
     {
         script.ClearListBox(script.OBJECT_SELF, "SCREEN_DMC_CREATOR", "LISTBOX_ACR_CREATOR");
         if (nav.ParentCategory != null)
         {
             string textFields = "LISTBOX_ITEM_TEXT=  ..";
             string variables  = "5=Category:..";
             script.AddListBoxRow(script.OBJECT_SELF, "SCREEN_DMC_CREATOR", "LISTBOX_ACR_CREATOR", "Category:..", textFields, "LISTBOX_ITEM_ICON=folder.tga", variables, "unhide");
         }
         foreach (NavigatorCategory navCat in nav.ContainedCategories)
         {
             string textFields = String.Format("LISTBOX_ITEM_TEXT=  {0}", navCat.DisplayName);
             string variables  = String.Format("5={0}", "Category:" + navCat.Name);
             script.AddListBoxRow(script.OBJECT_SELF, "SCREEN_DMC_CREATOR", "LISTBOX_ACR_CREATOR", "Category:" + navCat.Name, textFields, "LISTBOX_ITEM_ICON=folder.tga", variables, "unhide");
         }
         foreach (IListBoxItem navItem in nav.ContainedItems)
         {
             script.AddListBoxRow(script.OBJECT_SELF, "SCREEN_DMC_CREATOR", "LISTBOX_ACR_CREATOR", navItem.RowName, navItem.TextFields, navItem.Icon, navItem.Variables, "unhide");
         }
     }
     else
     {
         script.SendMessageToPC(script.OBJECT_SELF, "Error: Navigator category is null. Cannot draw a list.");
     }
 }
 public void PopulateGUI(uint player, CLRScriptBase s)
 {
     s.ClearListBox(player, "SCREEN_INFESTATION", "LISTBOX_ACR_INF_BOSSES");
     s.SetGUIObjectText(player, "SCREEN_INFESTATION", "DISP_INFEST", -1, String.Format("Infestation: {0} areas, {1} spread, {2} peak.", InfestedAreaLevels.Count(), Fecundity, MaxTier));
     if (!String.IsNullOrEmpty(BossTemplate))
     {
         if (ALFA.Shared.Modules.InfoStore.ModuleCreatures.ContainsKey(BossTemplate))
         {
             s.AddListBoxRow(player, "SCREEN_INFESTATION", "LISTBOX_ACR_INF_BOSSES", BossTemplate, String.Format("LISTBOX_ITEM_TEXT=  {0};LISTBOX_ITEM_TEXT2= {1:0.0};LISTBOX_ITEM_TEXT3= {2}", ALFA.Shared.Modules.InfoStore.ModuleCreatures[BossTemplate].DisplayName, ALFA.Shared.Modules.InfoStore.ModuleCreatures[BossTemplate].ChallengeRating.ToString(), "Boss"), "", "5=" + BossTemplate, "");
         }
         else
         {
             s.AddListBoxRow(player, "SCREEN_INFESTATION", "LISTBOX_ACR_INF_BOSSES", BossTemplate, String.Format("LISTBOX_ITEM_TEXT=  Error: {0} is invalid", BossTemplate), "", "5=" + BossTemplate, "");
         }
     }
     if (MiniBoss != null)
     {
         foreach (string mini in MiniBoss)
         {
             if (ALFA.Shared.Modules.InfoStore.ModuleCreatures.ContainsKey(mini))
             {
                 s.AddListBoxRow(player, "SCREEN_INFESTATION", "LISTBOX_ACR_INF_BOSSES", mini, String.Format("LISTBOX_ITEM_TEXT=  {0};LISTBOX_ITEM_TEXT2= {1:0.0};LISTBOX_ITEM_TEXT3= {2}", ALFA.Shared.Modules.InfoStore.ModuleCreatures[mini].DisplayName, ALFA.Shared.Modules.InfoStore.ModuleCreatures[mini].ChallengeRating.ToString(), "Mini"), "", "5=" + mini, "");
             }
             else
             {
                 s.AddListBoxRow(player, "SCREEN_INFESTATION", "LISTBOX_ACR_INF_BOSSES", mini, String.Format("LISTBOX_ITEM_TEXT=  Error: {0} is invalid", mini), "", "5=" + mini, "");
             }
         }
     }
     s.ClearListBox(player, "SCREEN_INFESTATION", "LISTBOX_ACR_INF_TIERS");
     foreach (KeyValuePair <int, List <string> > tier in Spawns)
     {
         foreach (string creat in tier.Value)
         {
             if (ALFA.Shared.Modules.InfoStore.ModuleCreatures.ContainsKey(creat))
             {
                 s.AddListBoxRow(player, "SCREEN_INFESTATION", "LISTBOX_ACR_INF_TIERS", creat, String.Format("LISTBOX_ITEM_TEXT=  {0};LISTBOX_ITEM_TEXT2= {1:0.0};LISTBOX_ITEM_TEXT3= {2}", ALFA.Shared.Modules.InfoStore.ModuleCreatures[creat].DisplayName, ALFA.Shared.Modules.InfoStore.ModuleCreatures[creat].ChallengeRating.ToString(), tier.Key.ToString()), "", String.Format("5={0};6={1}", creat, tier.Key.ToString()), "");
             }
             else
             {
                 s.AddListBoxRow(player, "SCREEN_INFESTATION", "LISTBOX_ACR_INF_TIERS", creat, String.Format("LISTBOX_ITEM_TEXT=  Error: {0} is invalid", creat), "", "5=" + creat, "");
             }
         }
     }
 }
예제 #4
0
 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(), "");
         }
     }
 }
예제 #5
0
        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++;
            }
        }
예제 #6
0
        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(), "");
                        }
                    });
                }
            });
        }