Beispiel #1
0
            private static IEnumerator TestWeathers(WindManager windManager)
            {
                const int    waitSeconds = 6;
                const string spacer      = "################################################";

                var         weatherManager = GameManager.Instance.WeatherManager;
                WeatherType currentWeather = windManager.Weather;
                var         stringBuilder  = new StringBuilder();

                stringBuilder.AppendLine(spacer);

                foreach (var weather in Enum.GetValues(typeof(WeatherType)).Cast <WeatherType>().Distinct())
                {
                    weatherManager.SetWeather(weather);
                    DaggerfallUI.Instance.PopupMessage(weather.ToString());

                    stringBuilder.AppendLine(weather.ToString().ToUpperInvariant());
                    stringBuilder.AppendLine(string.Format("Terrain: {0}", windManager.TerrainWindStrength));
                    stringBuilder.AppendLine(string.Format("Ambient: {0}", windManager.AmbientWindStrength));

                    yield return(new WaitForSeconds(waitSeconds));
                }

                weatherManager.SetWeather(currentWeather);
                stringBuilder.Append(spacer);
                Debug.Log(stringBuilder);
                DaggerfallUI.Instance.PopupMessage("Test ended");
            }
Beispiel #2
0
            public static ConsoleCommandCallback Execute(VibrantWind vibrantWind)
            {
                WindManager windManager = vibrantWind.WindManager;

                return((args) =>
                {
                    if (args.Length < 1 || !int.TryParse(args[0], out int mode))
                    {
                        return usage;
                    }

                    switch (mode)
                    {
                    case 0:
                        return string.Format("Terrain: {0}\nAmbient: {1}", windManager.TerrainWindStrength, windManager.AmbientWindStrength);

                    case 1:
                        try
                        {
                            if (!int.TryParse(args[1], out int weather) || !Enum.IsDefined(typeof(WeatherType), weather))
                            {
                                return usage;
                            }

                            windManager.Weather = (WeatherType)weather;
                            return "weather set.";
                        }
                        catch
                        {
                            return usage;
                        }

                    case 2:
                        vibrantWind.StartCoroutine(TestWeathers(windManager));
                        return "Close console to start test.";
                    }

                    return usage;
                });
            }
Beispiel #3
0
 internal VibrantWindModMessages(WindManager vibrantWind)
 {
     this.windManager = vibrantWind;
 }