private void OnWorldDayTimeUpdate(object source, WorldEventArgs args) { Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => { string iconPath = "pack://siteoforigin:,,,/HunterPie.Resources/UI/HUD/"; switch (args.DayTime) { case DayTime.Morning: DayTimeIcon = $"{iconPath}mr_time_morning.png"; break; case DayTime.Afternoon: DayTimeIcon = $"{iconPath}mr_time_day.png"; break; case DayTime.Evening: DayTimeIcon = $"{iconPath}mr_time_evening.png"; break; case DayTime.Night: DayTimeIcon = $"{iconPath}mr_time_night.png"; break; default: DayTimeIcon = null; break; } })); }
private static void OnGeneratorWorldEvents(WorldEventArgs e) { var chunkCoords = new ChunkCoords(e.blockLocation); if (!registrations.ContainsKey(chunkCoords)) { return; } foreach (var client in registrations[chunkCoords]) { MessageProcessor.SendMapUpdate(client, e.blockLocation, e.action, e.block); } }
private void World_TurnStart(object sender, WorldEventArgs e) { this.Image = this.WaitTexture; }
private void World_TurnEnd(object sender, WorldEventArgs e) { this.Image = this.EndedTexture; }