private void AppendWeather() { WeatherMetadata weather = weatherList[0]; weatherList.RemoveAt(0); Rectangle rS1 = WeatherIconPresets[weather.Weather]; Rectangle rS2 = WeatherIconPresets[weather.Weather + (int)WeatherType.GForce]; Point offset = new Point(rS1.Width, rS1.Height); Point originS1 = new Point(rS1.X, rS1.Y); Point originS2 = new Point(rS2.X, rS2.Y); weatherRouletteColored.Texture2D.AppendTexture(originS1, originS1 + offset, weatherTexture, new Point(24 * 6, 0)); weatherRouletteGrayscale.Texture2D.AppendTexture(originS2, originS2 + offset, weatherTexture, new Point(24 * 6, 0)); weatherRouletteColored.Texture2D.ShiftLeft(24, Color.Transparent); weatherRouletteGrayscale.Texture2D.ShiftLeft(24, Color.Transparent); currentOffset = 24; movingAnimationTime = 0; colorFadeAnimationTime = 0; weatherRouletteColored.SourceRectangle = weatherRouletteGrayscale.SourceRectangle = weatherRouletteRectangle; if (displayingWeatherList.Count > 0) { previousWeather = ActiveWeather; } displayingWeatherList.Add(weather); if (weather.Weather != WeatherType.Thor && NetworkObjectParameters.ActiveWeatherEffectList.Contains(weather.Weather)) { incomingWeatherPointers.Enqueue(new IncomingWeatherPointer(weather)); } if (displayingWeatherList.Count > 5) { displayingWeatherList.RemoveAt(0); } if (displayingWeatherList.Count >= 4) { ApplyCurrentWeatherEffect(); } }
public IncomingWeatherPointer(WeatherMetadata weatherMetadata) { WeatherMetadata = weatherMetadata; fadeAnimation = 0; position = Topography.FromNormalizedPositionToRelativePosition(weatherMetadata.Position); flipbook = new Flipbook(Vector2.Zero, new Vector2(9, -11), 19, 27, "Interface/InGame/HUD/Blue/IncomingWeather/Pointer", new AnimationInstance { EndingFrame = 6, TimePerFrame = 1 / 15f }, 0.95f, 0); string text; switch (weatherMetadata.Weather) { case WeatherType.Force: text = Language.WeatherForce; break; case WeatherType.Tornado: text = Language.WeatherTornado; break; case WeatherType.Electricity: text = Language.WeatherElectricity; break; case WeatherType.Weakness: text = Language.WeatherWeakness; break; case WeatherType.Mirror: text = Language.WeatherMirror; break; default: text = Language.WeatherRandom; break; } spriteText = new SpriteText(FontTextType.Consolas10, text, Color.White, Alignment.Center, layerDepth: 1); flipbook.Position = new Vector2(position.X, -(GameScene.Camera.CameraOffset + Parameter.ScreenResolution / 2).Y); spriteText.Position = flipbook.Position + new Vector2(0, 0); flipbook.Color = spriteText.Color = spriteText.OutlineColor = Color.Transparent; }
public void AppendWeatherToList(WeatherMetadata weather) { weatherList.Add(weather); }