Primitive Colorgrading (#17844)

* extremely basic color grading for areas

* fixes

* tint

* dmm

* colorgrading weather

* did it for the meme

* outdoor transition fix
This commit is contained in:
Will
2025-06-12 11:13:48 -04:00
committed by GitHub
parent 238ae79e6c
commit da577085aa
7 changed files with 60 additions and 5 deletions
+5
View File
@@ -1195,6 +1195,11 @@
return
colors_to_blend += M.client_color
if(!colors_to_blend.len) // Modifiers take priority over passive area blending, to prevent changes on every area entered
var/location_grade = get_location_color_tint() // Area or weather!
if(location_grade)
colors_to_blend += location_grade
if(colors_to_blend.len)
var/final_color
if(colors_to_blend.len == 1) // If it's just one color we can skip all of this work.
+6 -4
View File
@@ -273,14 +273,12 @@ default behaviour is:
handle_footstep(loc)
if(!forced && movetime && !is_incorporeal())
SSmotiontracker?.ping(src) // Incase of before init "turf enter gravity" this is ?, unfortunately.
// Begin VOREstation edit
if(is_shifted)
is_shifted = FALSE
pixel_x = default_pixel_x
pixel_y = default_pixel_y
layer = initial(layer)
plane = initial(plane)
// End VOREstation edit
if(pulling) // we were pulling a thing and didn't lose it during our move.
var/pull_dir = get_dir(src, pulling)
@@ -307,11 +305,9 @@ default behaviour is:
return
else if(lastarea?.get_gravity() == 0)
inertial_drift()
//VOREStation Edit Start
else if(flying)
inertial_drift()
make_floating(1)
//VOREStation Edit End
else if(!isspace(loc))
inertia_dir = 0
make_floating(0)
@@ -319,6 +315,12 @@ default behaviour is:
layer = HIDING_LAYER
plane = OBJ_PLANE
// Update client color if we're moving from an indoor turf to an outdoor one or vice versa. Needed to make weather blending update in mixed indoor/outdoor turfed areas
var/turf/old_turf = oldloc
var/turf/new_turf = loc
if(istype(old_turf) && old_turf.is_outdoors() != new_turf.is_outdoors())
update_client_color()
/mob/living/proc/inertial_drift()
if(x > 1 && x < (world.maxx) && y > 1 && y < (world.maxy))
if(Process_Spacemove(1))
+16 -1
View File
@@ -1235,9 +1235,24 @@
// This is for inheritence since /mob/living will serve most cases. If you need ghosts to use this you'll have to implement that yourself.
/mob/proc/update_client_color()
if(client && client.color)
animate(client, color = null, time = 10)
animate(client, color = get_location_color_tint(), time = 10)
return
/mob/proc/get_location_color_tint()
PROTECTED_PROC(TRUE)
SHOULD_NOT_OVERRIDE(TRUE)
var/turf/T = get_turf(src)
var/area/A = get_area(src)
if(!T || !A)
return null
if(T.is_outdoors()) // check weather
var/datum/planet/P = LAZYACCESS(SSplanets.z_to_planet, T.z)
var/weather_tint = P?.weather_holder.current_weather.get_color_tint()
if(weather_tint) // But not if the weather has no blending!
return weather_tint
// If not weather based then just area's
return A.get_color_tint()
/mob/proc/swap_hand()
return
+7
View File
@@ -160,6 +160,7 @@
if(!T.is_outdoors())
continue
to_chat(M, message)
M.update_client_color() // Passively done here instead of its own loop, the only issue is that if you enter an outdoor area to an indoor turf you won't get a blend update till your first message.
/datum/weather_holder/proc/get_weather_datum(desired_type)
return allowed_weather_types[desired_type]
@@ -204,6 +205,8 @@
var/indoor_sounds_type = null
var/effect_flags = NONE
VAR_PRIVATE/color_grading = null // Color blending for weather to feel hotter, colder, or stranger
/datum/weather/New()
if(outdoor_sounds_type)
outdoor_sounds = new outdoor_sounds_type(list(), FALSE, TRUE)
@@ -305,6 +308,10 @@
return
indoor_sounds.output_atoms -= M
/// Gets a hex color value for blending with a player's client.color.
/datum/weather/proc/get_color_tint()
return color_grading
// All this does is hold the weather icon.
/atom/movable/weather_visuals
icon = 'icons/effects/weather.dmi'