Upgrades Planetary Weather to vis_contents (#5170)

* Upgrades Planetary Weather to vis_contents
Makes the weather on Sif use vis_contents instead of overlays, which should fix all weather-related icon issues, and may or may not be faster.
Weather updates instantly now.
Fixes indoor PoIs having outdoor weather.

* Tries to appease Travis
This commit is contained in:
Neerti
2018-04-28 23:40:11 -04:00
committed by Atermonera
parent 81c19c62a3
commit e3e1a7ad9c
6 changed files with 16 additions and 36 deletions

View File

@@ -8,6 +8,9 @@
var/list/roundstart_weather_chances = list()
var/next_weather_shift = null
// Holds the weather icon, using vis_contents. Documentation says an /atom/movable is required for placing inside another atom's vis_contents.
var/atom/movable/weather_visuals/visuals = null
/datum/weather_holder/New(var/source)
..()
our_planet = source
@@ -15,6 +18,7 @@
var/datum/weather/W = allowed_weather_types[A]
if(istype(W))
W.holder = src
visuals = new()
/datum/weather_holder/proc/change_weather(var/new_weather)
var/old_light_modifier = null
@@ -41,7 +45,7 @@
current_weather.process_effects()
/datum/weather_holder/proc/update_icon_effects()
our_planet.needs_work |= PLANET_PROCESS_WEATHER
visuals.icon_state = current_weather.icon_state
/datum/weather_holder/proc/update_temperature()
temperature = Interpolate(current_weather.temp_low, current_weather.temp_high, weight = our_planet.sun_position)
@@ -65,3 +69,9 @@
/datum/weather/proc/process_effects()
return
// All this does is hold the weather icon.
/atom/movable/weather_visuals
icon = 'icons/effects/weather.dmi'
mouse_opacity = 0
plane = PLANE_PLANETLIGHTING