Exemple #1
0
 void Awake()
 {
     Logger.LogInfo("In Awake for SocketAPI Plug-in");
     UnityEngine.Debug.Log("SocketAPI Plug-in loaded");
     ModdingUtils.Initialize(this, this.Logger, true);
     KnownEffects.Invalidate();              // References the KnownEffects class, which triggers its static constructor, which registers our KnownEffectsBuilder before we load any scenes.
     // TODO: Remove SceneManager.sceneLoaded event and the SceneManager_sceneLoaded handler when we have the explorer driver by commands.
     SceneManager.sceneLoaded             += SceneManager_sceneLoaded;
     CreatureManager.OnLineOfSightUpdated += CreatureManager_OnLineOfSightUpdated;
 }
Exemple #2
0
        private static void SetTargetingFire()
        {
            string targetingFireJson = KnownEffects.Get("SelectionFire")?.Effect;

            if (string.IsNullOrWhiteSpace(targetingFireJson))
            {
                Talespire.Log.Error($"BlueFireSmoke effect not found!!!");
                return;
            }
            Talespire.Target.SetTargetingFire(targetingFireJson);
        }
Exemple #3
0
        private static void SetTargetingSquare()
        {
            string targetingSquareJson = KnownEffects.Get("TargetSquare")?.Effect;

            if (string.IsNullOrWhiteSpace(targetingSquareJson))
            {
                Talespire.Log.Error($"TargetingSquare effect not found!!!");
                return;
            }
            TargetingSquare.SetTargetingEffect(targetingSquareJson);
        }
        private void LoadEntries()
        {
            if (lstItems.Items.Count > 0)
            {
                return;
            }

            try
            {
                lstItems.BeginUpdate();
                if (SelectionType == SelectionType.Prefabs)
                {
                    foreach (string item in Talespire.Prefabs.AllNames.Where(y => FilterCatches(y)).OrderBy(x => x).ToList())
                    {
                        lstItems.Items.Add(item);
                    }
                }
                else if (SelectionType == SelectionType.ExistingGameObjects)
                {
                    foreach (string item in Talespire.GameObjects.GetAllNames(topLevelOnly).Where(y => FilterCatches(y)).OrderBy(x => x).ToList())
                    {
                        //if (item.Contains("lb") || item.Contains("pot") || item.Contains("Pot") || item.Contains("Bottle") || item.Contains("bottle"))
                        //	Talespire.Log.Warning($"Found a \"{item}\"!");
                        lstItems.Items.Add(item);
                    }
                }
                else if (SelectionType == SelectionType.Minis)
                {
                    foreach (string miniId in Talespire.Minis.GetAllNamesAndIds().Where(y => FilterCatches(y)).OrderBy(x => x).ToList())
                    {
                        lstItems.Items.Add(miniId);
                    }
                }
                else if (SelectionType == SelectionType.EffectName)
                {
                    foreach (string effect in KnownEffects.GetAllNames().Where(y => FilterCatches(y)).OrderBy(x => x).ToList())
                    {
                        lstItems.Items.Add(effect);
                    }
                }
                else if (SelectionType == SelectionType.Script)
                {
                    foreach (string effect in KnownScripts.GetAllNames().Where(y => FilterCatches(y)).OrderBy(x => x).ToList())
                    {
                        lstItems.Items.Add(effect);
                    }
                }
            }
            finally
            {
                lstItems.EndUpdate();
            }
        }
        void RefreshEntries()
        {
            lstEntries.Items.Clear();

            List <string> allEntries;

            if (showingCategories)
            {
                allEntries = KnownEffects.GetAllCategories();
            }
            else
            {
                allEntries = KnownEffects.GetNamesFromCategory(selectedCategory);
            }

            allEntries.Sort();

            foreach (string knownEffect in allEntries)
            {
                lstEntries.Items.Add(knownEffect);
            }
        }
Exemple #6
0
 public GameObject Create(string effectName, string instanceId = null)
 {
     return(KnownEffects.Create(effectName, instanceId));
 }