Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spritening #284

Merged
merged 29 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/__DEFINES/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

// Consider these images/atoms as part of the UI/HUD (apart of the appearance_flags)
/// Used for progress bars and chat messages
#define APPEARANCE_UI_IGNORE_ALPHA (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA|PIXEL_SCALE)
#define APPEARANCE_UI_IGNORE_ALPHA (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA|PIXEL_SCALE|TILE_BOUND) // monkestation edit
/// Used for HUD objects
#define APPEARANCE_UI (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|PIXEL_SCALE)
#define APPEARANCE_UI (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|PIXEL_SCALE|TILE_BOUND) // monkestation edit

/*
These defines specificy screen locations. For more information, see the byond documentation on the screen_loc var.
Expand Down
66 changes: 46 additions & 20 deletions code/_onclick/hud/parallax.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

#define PARALLAX_ICON_SIZE 672 // monkestation edit
/datum/hud/proc/create_parallax(mob/viewmob)
var/mob/screenmob = viewmob || mymob
var/client/C = screenmob.client
Expand All @@ -14,11 +15,15 @@
if(!length(C.parallax_layers_cached))
C.parallax_layers_cached = list()
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/layer_1(null, screenmob)
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/stars(null, screenmob) //monkestation edit
/* monkestation removal
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/layer_2(null, screenmob)
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/planet(null, screenmob)
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/nebula(null, screenmob)
if(SSparallax.random_layer)
C.parallax_layers_cached += new SSparallax.random_layer(null, screenmob)
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/layer_3(null, screenmob)
*/ //monkestation removal end

C.parallax_layers = C.parallax_layers_cached.Copy()

Expand Down Expand Up @@ -113,8 +118,7 @@
var/animatedir = new_parallax_movedir
if(new_parallax_movedir == FALSE)
var/animate_time = 0
for(var/thing in C.parallax_layers)
var/atom/movable/screen/parallax_layer/L = thing
for(var/atom/movable/screen/parallax_layer/L as anything in C.parallax_layers) //monkestation edit
L.icon_state = initial(L.icon_state)
L.update_o(C.view)
var/T = PARALLAX_LOOP_TIME / L.speed
Expand All @@ -126,18 +130,18 @@
var/matrix/newtransform
switch(animatedir)
if(NORTH)
newtransform = matrix(1, 0, 0, 0, 1, 480)
newtransform = matrix(1, 0, 0, 0, 1, PARALLAX_ICON_SIZE) // monkestation edit
if(SOUTH)
newtransform = matrix(1, 0, 0, 0, 1,-480)
newtransform = matrix(1, 0, 0, 0, 1,-PARALLAX_ICON_SIZE) // monkestation edit
if(EAST)
newtransform = matrix(1, 0, 480, 0, 1, 0)
newtransform = matrix(1, 0, PARALLAX_ICON_SIZE, 0, 1, 0) // monkestation edit
if(WEST)
newtransform = matrix(1, 0,-480, 0, 1, 0)
newtransform = matrix(1, 0,-PARALLAX_ICON_SIZE, 0, 1, 0) // monkestation edit

var/shortesttimer
if(!skip_windups)
for(var/thing in C.parallax_layers)
var/atom/movable/screen/parallax_layer/L = thing
for(var/atom/movable/screen/parallax_layer/L as anything in C.parallax_layers) // monkestation edit
//var/atom/movable/screen/parallax_layer/L = thing monkestation removal

var/T = PARALLAX_LOOP_TIME / L.speed
if (isnull(shortesttimer))
Expand Down Expand Up @@ -227,14 +231,16 @@

// This is how we tile parralax sprites
// It doesn't use change because we really don't want to animate this
if(parallax_layer.offset_x - change_x > 240)
parallax_layer.offset_x -= 480
else if(parallax_layer.offset_x - change_x < -240)
parallax_layer.offset_x += 480
if(parallax_layer.offset_y - change_y > 240)
parallax_layer.offset_y -= 480
else if(parallax_layer.offset_y - change_y < -240)
parallax_layer.offset_y += 480
//monkestation edit start
if(parallax_layer.offset_x - change_x > PARALLAX_ICON_SIZE/2)
parallax_layer.offset_x -= PARALLAX_ICON_SIZE
else if(parallax_layer.offset_x - change_x < -PARALLAX_ICON_SIZE/2)
parallax_layer.offset_x += PARALLAX_ICON_SIZE
if(parallax_layer.offset_y - change_y > PARALLAX_ICON_SIZE/2)
parallax_layer.offset_y -= PARALLAX_ICON_SIZE
else if(parallax_layer.offset_y - change_y < -PARALLAX_ICON_SIZE/2)
parallax_layer.offset_y += PARALLAX_ICON_SIZE
//monkestation edit end

// Now that we have our offsets, let's do our positioning
parallax_layer.offset_x -= change_x
Expand All @@ -261,11 +267,12 @@
// We need parallax to always pass its args down into initialize, so we immediate init it
INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)
/atom/movable/screen/parallax_layer
icon = 'icons/effects/parallax.dmi'
icon = 'monkestation/icons/effects/skybox.dmi' //monkestation edit
var/speed = 1
var/offset_x = 0
var/offset_y = 0
var/absolute = FALSE
appearance_flags = APPEARANCE_UI | TILE_BOUND //monkestation edit
blend_mode = BLEND_ADD
plane = PLANE_SPACE_PARALLAX
screen_loc = "CENTER-7,CENTER-7"
Expand All @@ -290,7 +297,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)
if (!view)
view = world.view

var/static/parallax_scaler = world.icon_size / 480
var/static/parallax_scaler = world.icon_size / PARALLAX_ICON_SIZE //monkestation edit

// Turn the view size into a grid of correctly scaled overlays
var/list/viewscales = getviewsize(view)
Expand All @@ -302,12 +309,29 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)
if(x == 0 && y == 0)
continue
var/mutable_appearance/texture_overlay = mutable_appearance(icon, icon_state)
texture_overlay.transform = matrix(1, 0, x*480, 0, 1, y*480)
texture_overlay.transform = matrix(1, 0, x*PARALLAX_ICON_SIZE, 0, 1, y*PARALLAX_ICON_SIZE) //monkestation edit
new_overlays += texture_overlay
cut_overlays()
add_overlay(new_overlays)

//monkestation edit start
/atom/movable/screen/parallax_layer/layer_1
icon_state = "dyable" // monkestation edit
blend_mode = BLEND_OVERLAY
speed = 0.5
layer = 1

/atom/movable/screen/parallax_layer/layer_1/Initialize(mapload, mob/owner)
. = ..()
src.add_atom_colour(GLOB.starlight_color, ADMIN_COLOUR_PRIORITY)

/atom/movable/screen/parallax_layer/stars
icon_state = "stars"
blend_mode = BLEND_OVERLAY
layer = 1
speed = 0.5
//monkestation edit end
/* monkestation removal start
icon_state = "layer1"
speed = 0.6
layer = 1
Expand Down Expand Up @@ -337,7 +361,6 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)
/atom/movable/screen/parallax_layer/random/asteroids
icon_state = "asteroids"
layer = 4

/atom/movable/screen/parallax_layer/planet
icon_state = "planet"
blend_mode = BLEND_OVERLAY
Expand Down Expand Up @@ -371,3 +394,6 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)

/atom/movable/screen/parallax_layer/planet/update_o()
return //Shit won't move
*/ //monkestation removal end

#undef PARALLAX_ICON_SIZE
6 changes: 4 additions & 2 deletions code/controllers/subsystem/parallax.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ SUBSYSTEM_DEF(parallax)
var/list/currentrun
var/planet_x_offset = 128
var/planet_y_offset = 128
var/random_layer
var/random_parallax_color
//var/random_layer //monkestation removal
//var/random_parallax_color //monkestation removal


//These are cached per client so needs to be done asap so people joining at roundstart do not miss these.
/datum/controller/subsystem/parallax/PreInit()
. = ..()
/* monkestation removal
if(prob(70)) //70% chance to pick a special extra layer
random_layer = pick(/atom/movable/screen/parallax_layer/random/space_gas, /atom/movable/screen/parallax_layer/random/asteroids)
random_parallax_color = pick(COLOR_TEAL, COLOR_GREEN, COLOR_SILVER, COLOR_YELLOW, COLOR_CYAN, COLOR_ORANGE, COLOR_PURPLE)//Special color for random_layer1. Has to be done here so everyone sees the same color.
monkestation removal end */
planet_y_offset = rand(100, 160)
planet_x_offset = rand(100, 160)

Expand Down
2 changes: 1 addition & 1 deletion code/datums/greyscale/config_types/greyscale_configs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@

/datum/greyscale_config/buckets_cleanbot
name = "Buckets - Cleanbot"
icon_file = 'icons/mob/silicon/aibots.dmi'
icon_file = 'monkestation/code/modules/aesthetics/icons/cleanbot.dmi' //monkestation edit
json_config = 'code/datums/greyscale/json_configs/buckets_bot.json'

/datum/greyscale_config/buttondown_slacks
Expand Down
10 changes: 6 additions & 4 deletions code/game/area/areas/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
static_lighting = FALSE

base_lighting_alpha = 255
base_lighting_color = COLOR_STARLIGHT
base_lighting_color = "#FFFFFF"

power_light = FALSE
power_equip = FALSE
power_environ = FALSE
Expand All @@ -18,13 +19,14 @@
sound_environment = SOUND_AREA_SPACE
ambient_buzz = null //Space is deafeningly quiet

/area/space/Initialize(mapload)
. = ..()
set_base_lighting(GLOB.starlight_color, alpha)

/area/space/nearstation
icon_state = "space_near"
area_flags = UNIQUE_AREA | AREA_USES_STARLIGHT
static_lighting = TRUE
base_lighting_alpha = 0
base_lighting_color = COLOR_WHITE

/area/misc/start
name = "start area"
icon_state = "start"
Expand Down
4 changes: 4 additions & 0 deletions code/game/area/areas/station.dm
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,10 @@
airlock_wires = /datum/wires/airlock/engineering
sound_environment = SOUND_AREA_SPACE

/area/station/solars/Initialize(mapload)
. = ..()
set_base_lighting(new_base_lighting_color = GLOB.starlight_color, new_alpha = 255)

/area/station/solars/fore
name = "\improper Fore Solar Array"
icon_state = "panelsF"
Expand Down
15 changes: 13 additions & 2 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,21 @@
/// Someone, for the love of god, profile this. Is there a reason to cache mutable_appearance
/// if so, why are we JUST doing the airlocks when we can put this in mutable_appearance.dm for
/// everything
/proc/get_airlock_overlay(icon_state, icon_file, atom/offset_spokesman, em_block)
/proc/get_airlock_overlay(icon_state, icon_file, atom/offset_spokesman, em_block, state_color = null) // Monkestation Edit - Airlock accent greyscale color support - Added `state_color = null`
var/static/list/airlock_overlays = list()

var/base_icon_key = "[icon_state][REF(icon_file)]"
var/base_icon_key = "[icon_state][REF(icon_file)][state_color]" // Monkestation Edit- Airlock accent greyscale color support - ORIGINAL: var/base_icon_key = "[icon_state][REF(icon_file)]"
if(!(. = airlock_overlays[base_icon_key]))
/* Monkestation Edit - Airlock accent greyscale color support - ORIGINAL:
. = airlock_overlays[base_icon_key] = mutable_appearance(icon_file, icon_state)
*/ // Monkestation Edit START
var/mutable_appearance/airlock_overlay = mutable_appearance(icon_file, icon_state)
if(state_color)
airlock_overlay.color = state_color

. = airlock_overlays[base_icon_key] = airlock_overlay
// Monkestation Edit END

if(isnull(em_block))
return

Expand Down Expand Up @@ -416,6 +425,7 @@
if(AIRLOCK_DENY, AIRLOCK_OPENING, AIRLOCK_CLOSING, AIRLOCK_EMAG)
icon_state = "nonexistenticonstate" //MADNESS

/* monkestation edit
/obj/machinery/door/airlock/update_overlays()
. = ..()

Expand Down Expand Up @@ -494,6 +504,7 @@
floorlight.pixel_x = -32
floorlight.pixel_y = 0
. += floorlight
*/ //monkestation end

/obj/machinery/door/airlock/do_animate(animation)
switch(animation)
Expand Down
8 changes: 8 additions & 0 deletions code/game/objects/items/airlock_painter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@

if(isfloorturf(target) && use_paint(user))
paint_floor(target)
//monkestation edit start
if(iswallturf(target) && use_paint(user) && stored_custom_color)
var/turf/closed/wall/temp = target
if(user.istate & ISTATE_SECONDARY)
temp.change_trim_color(stored_custom_color)
else
temp.change_paint_color(stored_custom_color)
//monkestation edit end

/**
* Actually add current decal to the floor.
Expand Down
20 changes: 11 additions & 9 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,16 @@
if (flags_1 & ON_BORDER_1)
AddElement(/datum/element/connect_loc, loc_connections)
//monkestation edit start
var/new_color = SSstation_coloring.get_default_color()
if(glass_color_blend_to_color && glass_color_blend_to_ratio)
glass_color = BlendRGB(new_color, glass_color_blend_to_color, glass_color_blend_to_ratio)
else
glass_color = new_color
if(fulltile)
color = glass_color
if(mapload && fulltile)
new /obj/structure/window_sill(get_turf(src))
if(uses_color)
var/new_color = SSstation_coloring.get_default_color()
if(glass_color_blend_to_color && glass_color_blend_to_ratio)
glass_color = BlendRGB(new_color, glass_color_blend_to_color, glass_color_blend_to_ratio)
else
glass_color = new_color
if(fulltile)
color = glass_color
if(mapload && fulltile)
new /obj/structure/window_sill(get_turf(src))
//monkestation edit end

/obj/structure/window/examine(mob/user)
Expand Down Expand Up @@ -927,6 +928,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/reinforced/plasma/spawner, 0)
icon = 'icons/obj/smooth_structures/clockwork_window.dmi'
icon_state = "clockwork_window_single"
glass_type = /obj/item/stack/sheet/bronze
uses_color // monkestation edit

/obj/structure/window/bronze/unanchored
anchored = FALSE
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/open/floor/glass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
. = ..()
AddElement(/datum/element/turf_z_transparency)
setup_glow()
starlight_color = GLOB.starlight_color

/turf/open/floor/glass/Destroy()
. = ..()
Expand Down
10 changes: 6 additions & 4 deletions code/game/turfs/open/space/space.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
GLOBAL_VAR_INIT(starlight_color, pick(COLOR_TEAL, COLOR_GREEN, COLOR_CYAN, COLOR_ORANGE, COLOR_PURPLE, COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_MAGENTA)) //monkestation addition
/turf/open/space
icon = 'icons/turf/space.dmi'
icon_state = "space"
Expand All @@ -21,7 +22,9 @@
plane = PLANE_SPACE
layer = SPACE_LAYER
light_power = 0.75
light_color = COLOR_STARLIGHT
light_inner_range = 0.1
light_outer_range = 4
light_falloff_curve = 5
space_lit = TRUE
bullet_bounce_sound = null
vis_flags = VIS_INHERIT_ID //when this be added to vis_contents of something it be associated with something on clicking, important for visualisation of turf in openspace and interraction with openspace that show you turf.
Expand Down Expand Up @@ -112,13 +115,12 @@
continue
enable_starlight()
return TRUE
set_light(0)
set_light(l_on = FALSE)
return FALSE

/// Turns on the stars, if they aren't already
/turf/open/space/proc/enable_starlight()
if(!light_outer_range)
set_light(2)
set_light(l_color = GLOB.starlight_color, l_on = TRUE)

/turf/open/space/attack_paw(mob/user, list/modifiers)
return attack_hand(user, modifiers)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/asset_cache/assets/pipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
name = "pipes"

/datum/asset/spritesheet/pipes/create_spritesheets()
for (var/each in list('icons/obj/atmospherics/pipes/pipe_item.dmi', 'icons/obj/atmospherics/pipes/disposal.dmi', 'icons/obj/atmospherics/pipes/transit_tube.dmi', 'icons/obj/plumbing/fluid_ducts.dmi'))
for (var/each in list('icons/obj/atmospherics/pipes/pipe_item.dmi', 'monkestation/icons/obj/atmospherics/pipes/disposal.dmi', 'icons/obj/atmospherics/pipes/transit_tube.dmi', 'icons/obj/plumbing/fluid_ducts.dmi'))
InsertAll("", each, GLOB.alldirs)
Insert(sprite_name = "gsensor1", I = 'icons/obj/stationobjs.dmi', icon_state = "gsensor1")
5 changes: 3 additions & 2 deletions code/modules/lighting/static_lighting_area.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
/// Fills with offsets as they are generated
GLOBAL_LIST_INIT_TYPED(fullbright_overlays, /mutable_appearance, list(create_fullbright_overlay(0)))

/proc/create_fullbright_overlay(offset)
/proc/create_fullbright_overlay(offset, color)
var/mutable_appearance/lighting_effect = mutable_appearance('icons/effects/alphacolors.dmi', "white")
SET_PLANE_W_SCALAR(lighting_effect, LIGHTING_PLANE, offset)
lighting_effect.layer = LIGHTING_PRIMARY_LAYER
lighting_effect.blend_mode = BLEND_ADD
lighting_effect.color = COLOR_STARLIGHT
if(color)
lighting_effect.color = color
return lighting_effect

/area
Expand Down
4 changes: 0 additions & 4 deletions code/modules/mob/living/simple_animal/slime/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
slime_user.current_mood = mood_key
slime_user.regenerate_icons()

/datum/emote/slime/mood/sneaky
key = "moodsneaky"
mood_key = "mischievous"

/datum/emote/slime/mood/smile
key = "moodsmile"
mood_key = ":3"
Expand Down
Loading
Loading