Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
MosleyTheMalO committed Jan 15, 2025
2 parents d931db8 + e3a3ca5 commit f700fd6
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 49 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/layers_planes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,8 @@
// Admin popup layer
#define ADMIN_POPUP_LAYER 1

///Plane master controller keys
#define PLANE_MASTERS_GAME "plane_masters_game"

///Layer for screentips
#define SCREENTIP_LAYER 40
8 changes: 7 additions & 1 deletion code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
var/list/inv_slots[SLOTS_AMT] // /atom/movable/screen/inventory objects, ordered by their slot ID.
var/list/hand_slots // /atom/movable/screen/inventory/hand objects, assoc list of "[held_index]" = object
var/list/atom/movable/screen/plane_master/plane_masters = list() // see "appearance_flags" in the ref, assoc list of "[plane]" = object

///Assoc list of controller groups, associated with key string group name with value of the plane master controller ref
var/list/atom/movable/plane_master_controller/plane_master_controllers = list()

///UI for screentips that appear when you mouse over things
var/atom/movable/screen/screentip/screentip_text
Expand Down Expand Up @@ -114,6 +115,10 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
plane_masters["[instance.plane]"] = instance
instance.backdrop(mymob)

for(var/mytype in subtypesof(/atom/movable/plane_master_controller))
var/atom/movable/plane_master_controller/controller_instance = new mytype(src)
plane_master_controllers[controller_instance.name] = controller_instance

screentip_text = new(null, src)
static_inventory += screentip_text

Expand Down Expand Up @@ -161,6 +166,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
combo_display = null

QDEL_LIST_ASSOC_VAL(plane_masters)
QDEL_LIST_ASSOC_VAL(plane_master_controllers)
QDEL_LIST(screenoverlays)
mymob = null

Expand Down
87 changes: 87 additions & 0 deletions code/_onclick/hud/plane_master_controller.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
///Atom that manages and controls multiple planes. It's an atom so we can hook into add_filter etc. Multiple controllers can control one plane.
/atom/movable/plane_master_controller
///List of planes in this controllers control. Initially this is a normal list, but becomes an assoc list of plane numbers as strings | plane instance
var/list/controlled_planes = list()
///hud that owns this controller
var/datum/hud/owner_hud

///Ensures that all the planes are correctly in the controlled_planes list.
/atom/movable/plane_master_controller/New(hud)
. = ..()
owner_hud = hud
var/assoc_controlled_planes = list()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/instance = owner_hud.plane_masters["[i]"]

Check failure on line 14 in code/_onclick/hud/plane_master_controller.dm

View workflow job for this annotation

GitHub Actions / Integration Tests

Box Station: /datum/unit_test/create_and_destroy

[22:16:11] Runtime in code/_onclick/hud/plane_master_controller.dm,14: undefined variable /turf/open/floor/plasteel/var/plane_masters proc name: New (/atom/movable/plane_master_controller/New) src: the plane_masters_game (/atom/movable/plane_master_controller/game) src.loc: the floor (172,10,10) (/turf/open/floor/plasteel) call stack: the plane_masters_game (/atom/movable/plane_master_controller/game): New(the floor (172,10,10) (/turf/open/floor/plasteel)) /datum/unit_test/create_and_de... (/datum/unit_test/create_and_destroy): Run() RunUnitTest(/datum/unit_test/create_and_de... (/datum/unit_test/create_and_destroy), /list (/list)) RunUnitTests() /datum/callback (/datum/callback): InvokeAsync()
if(!instance) //If we looked for a hud that isn't instanced, just keep going
stack_trace("[i] isn't a valid plane master layer for [owner_hud.type], are you sure it exists in the first place?")
continue
assoc_controlled_planes["[i]"] = instance
controlled_planes = assoc_controlled_planes

// From BeeStation
/atom/movable/plane_master_controller/Destroy()
if(owner_hud)
owner_hud.plane_master_controllers -= src

Check failure on line 24 in code/_onclick/hud/plane_master_controller.dm

View workflow job for this annotation

GitHub Actions / Integration Tests

Box Station: /datum/unit_test/create_and_destroy

[22:16:11] Runtime in code/_onclick/hud/plane_master_controller.dm,24: undefined variable /turf/open/floor/plasteel/var/plane_master_controllers proc name: Destroy (/atom/movable/plane_master_controller/Destroy) src: the plane master controller (/atom/movable/plane_master_controller) src.loc: the floor (172,10,10) (/turf/open/floor/plasteel) call stack: the plane master controller (/atom/movable/plane_master_controller): Destroy(1) qdel(the plane master controller (/atom/movable/plane_master_controller), 1) /datum/unit_test/create_and_de... (/datum/unit_test/create_and_destroy): Run() RunUnitTest(/datum/unit_test/create_and_de... (/datum/unit_test/create_and_destroy), /list (/list)) RunUnitTests() /datum/callback (/datum/callback): InvokeAsync()

Check failure on line 24 in code/_onclick/hud/plane_master_controller.dm

View workflow job for this annotation

GitHub Actions / Integration Tests

Box Station: /datum/unit_test/create_and_destroy

[22:16:11] Runtime in code/_onclick/hud/plane_master_controller.dm,24: undefined variable /turf/open/floor/plasteel/var/plane_master_controllers proc name: Destroy (/atom/movable/plane_master_controller/Destroy) src: the plane_masters_game (/atom/movable/plane_master_controller/game) src.loc: the floor (172,10,10) (/turf/open/floor/plasteel) call stack: the plane_masters_game (/atom/movable/plane_master_controller/game): Destroy(1) qdel(the plane_masters_game (/atom/movable/plane_master_controller/game), 1) /datum/unit_test/create_and_de... (/datum/unit_test/create_and_destroy): Run() RunUnitTest(/datum/unit_test/create_and_de... (/datum/unit_test/create_and_destroy), /list (/list)) RunUnitTests() /datum/callback (/datum/callback): InvokeAsync()
controlled_planes.Cut()
return ..()

///Full override so we can just use filterrific
/atom/movable/plane_master_controller/add_filter(name, priority, list/params)
. = ..()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i]
pm_iterator.add_filter(name, priority, params)

///Full override so we can just use filterrific
/atom/movable/plane_master_controller/remove_filter(name_or_names)
. = ..()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i]
pm_iterator.remove_filter(name_or_names)

/atom/movable/plane_master_controller/update_filters()
. = ..()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i]
pm_iterator.update_filters()

///Gets all filters for this controllers plane masters
/atom/movable/plane_master_controller/proc/get_filters(name)
. = list()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i]
. += pm_iterator.get_filter(name)

///Transitions all filters owned by this plane master controller
/atom/movable/plane_master_controller/transition_filter(name, time, list/new_params, easing, loop)
. = ..()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i]
pm_iterator.transition_filter(name, time, new_params, easing, loop)

///Full override so we can just use filterrific
/atom/movable/plane_master_controller/add_atom_colour(coloration, colour_priority)
. = ..()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i]
pm_iterator.add_atom_colour(coloration, colour_priority)


///Removes an instance of colour_type from the atom's atom_colours list
/atom/movable/plane_master_controller/remove_atom_colour(colour_priority, coloration)
. = ..()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i]
pm_iterator.remove_atom_colour(colour_priority, coloration)


///Resets the atom's color to null, and then sets it to the highest priority colour available
/atom/movable/plane_master_controller/update_atom_colour()
for(var/i in controlled_planes)
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i]
pm_iterator.update_atom_colour()


/atom/movable/plane_master_controller/game
name = PLANE_MASTERS_GAME
controlled_planes = list(FLOOR_PLANE, GAME_PLANE, WALL_PLANE, ABOVE_WALL_PLANE, LIGHTING_PLANE, EMISSIVE_PLANE)
2 changes: 1 addition & 1 deletion code/game/machinery/announcement_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
else if(message_type == "ARRIVALS_BROKEN")
message = "The arrivals shuttle has been damaged. Docking for repairs..."

if(channels.len == 0)
if(!length(channels))
radio.talk_into(src, message, null)
else
for(var/channel in channels)
Expand Down
3 changes: 0 additions & 3 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
var/list/grind_results //A reagent list containing the reagents this item produces when ground up in a grinder - this can be an empty list to allow for reagent transferring only
var/list/juice_results //A reagent list containing blah blah... but when JUICED in a grinder!

//the outline filter on hover
var/outline_filter

/* Our block parry data. Should be set in init, or something if you are using it.
* This won't be accessed without ITEM_CAN_BLOCK or ITEM_CAN_PARRY so do not set it unless you have to to save memory.
* If you decide it's a good idea to leave this unset while turning the flags on, you will runtime. Enjoy.
Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/items/devices/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ GLOBAL_LIST_INIT(channel_tokens, list(
return ..(freq, level)
return FALSE

/obj/item/radio/headset/MouseDrop(mob/over, src_location, over_location)
var/mob/headset_user = usr
if((headset_user == over) && headset_user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return attack_self(headset_user)
return ..()

/obj/item/radio/headset/syndicate //disguised to look like a normal headset for stealth ops

/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
Expand Down
18 changes: 14 additions & 4 deletions code/modules/admin/view_variables/debug_variable_appearance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,29 @@ GLOBAL_DATUM_INIT(pluto, /atom/movable, new /atom/movable(null))
return FALSE
if(var_name == "realized_underlays")
return FALSE

#if (MIN_COMPILER_VERSION >= 515 && MIN_COMPILER_BUILD >= 1643)
#warn X/Y/Z and contents are now fully unviewable on our supported versions, remove the below check
#endif

// lummy removed these from the the MA/image type
#if (DM_VERSION <= 515 && DM_BUILD < 1643)
// Filtering out the stuff I know we don't care about
if(var_name == "x")
return FALSE
if(var_name == "y")
return FALSE
if(var_name == "z")
return FALSE
// Could make an argument for these but I think they will just confuse people, so yeeet
if(var_name == "contents")
#ifndef SPACEMAN_DMM // Spaceman doesn't believe in contents on appearances, sorry lads
if(var_name == NAMEOF(src, contents))
return FALSE
if(var_name == "loc")
#endif
if(var_name == NAMEOF(src, loc))
return FALSE
if(var_name == "vis_contents")
#endif
// Could make an argument for this but I think they will just confuse people, so yeeet
if(var_name == NAMEOF(src, vis_contents))
return FALSE
return ..()

Expand Down
5 changes: 1 addition & 4 deletions code/modules/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@
else if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
if(client)
if(!eye_blurry)
remove_eyeblur()
else
update_eyeblur()
update_eye_blur()

/mob/living/proc/update_damage_hud()
return
Expand Down
34 changes: 10 additions & 24 deletions code/modules/mob/status_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,28 @@
/mob/proc/blur_eyes(amount)
if(amount>0)
eye_blurry = max(amount, eye_blurry)
update_eyeblur()
update_eye_blur()

/**
* Adjust the current blurriness of the mobs vision by amount
*/
/mob/proc/adjust_blurriness(amount)
eye_blurry = max(eye_blurry+amount, 0)
update_eyeblur()
update_eye_blur()

///Set the mobs blurriness of vision to an amount
/mob/proc/set_blurriness(amount)
eye_blurry = max(amount, 0)
update_eyeblur()
update_eye_blur()

/mob/proc/update_eyeblur()
remove_eyeblur()
if(eye_blurry)
add_eyeblur()

/mob/proc/add_eyeblur()
if(!client)
/mob/proc/update_eye_blur()
if(!hud_used)
return
var/list/screens = list(hud_used.plane_masters["[GAME_PLANE]"], hud_used.plane_masters["[FLOOR_PLANE]"],
hud_used.plane_masters["[WALL_PLANE]"], hud_used.plane_masters["[ABOVE_WALL_PLANE]"])
for(var/A in screens)
var/atom/movable/screen/plane_master/P = A
P.add_filter("blurry_eyes", 2, EYE_BLUR(clamp(eye_blurry*0.1,0.6,3)))

/mob/proc/remove_eyeblur()
if(!client)
return
var/list/screens = list(hud_used.plane_masters["[GAME_PLANE]"], hud_used.plane_masters["[FLOOR_PLANE]"],
hud_used.plane_masters["[WALL_PLANE]"], hud_used.plane_masters["[ABOVE_WALL_PLANE]"])
for(var/A in screens)
var/atom/movable/screen/plane_master/P = A
P.remove_filter("blurry_eyes")
var/atom/movable/plane_master_controller/game_plane_master_controller = hud_used.plane_master_controllers[PLANE_MASTERS_GAME]
if(eye_blurry)
game_plane_master_controller.add_filter("eye_blur", 1, gauss_blur_filter(clamp(eye_blurry * 0.1, 0.6, 3)))
else
game_plane_master_controller.remove_filter("eye_blur")

///Adjust the drugginess of a mob
/mob/proc/adjust_drugginess(amount)
Expand Down
20 changes: 8 additions & 12 deletions code/modules/reagents/chemistry/reagents/toxin_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -786,26 +786,22 @@
value = REAGENT_VALUE_VERY_RARE

/datum/reagent/toxin/rotatium/on_mob_life(mob/living/carbon/M)
return ..() // until fixed - the rotations never stop
/*
if(M.hud_used)
if(current_cycle >= 20 && current_cycle%20 == 0)
var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"],
M.hud_used.plane_masters["[LIGHTING_PLANE]"], M.hud_used.plane_masters["[WALL_PLANE]"],
M.hud_used.plane_masters["[ABOVE_WALL_PLANE]"])
var/atom/movable/plane_master_controller/pm_controller = M.hud_used.plane_master_controllers[PLANE_MASTERS_GAME]

var/rotation = min(round(current_cycle/20), 89) // By this point the player is probably puking and quitting anyway
for(var/whole_screen in screens)
animate(whole_screen, transform = matrix(rotation, MATRIX_ROTATE), time = 5, easing = QUAD_EASING, loop = -1)
for(var/key in pm_controller.controlled_planes)
animate(pm_controller.controlled_planes[key], transform = matrix(rotation, MATRIX_ROTATE), time = 5, easing = QUAD_EASING, loop = -1)
animate(transform = matrix(-rotation, MATRIX_ROTATE), time = 5, easing = QUAD_EASING)
return ..()

/datum/reagent/toxin/rotatium/on_mob_end_metabolize(mob/living/M)
if(M && M.hud_used)
var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"])
for(var/whole_screen in screens)
animate(whole_screen, transform = matrix(), time = 5, easing = QUAD_EASING)
if(M?.hud_used)
var/atom/movable/plane_master_controller/pm_controller = M.hud_used.plane_master_controllers[PLANE_MASTERS_GAME]
for(var/key in pm_controller.controlled_planes)
animate(pm_controller.controlled_planes[key], transform = matrix(), time = 5, easing = QUAD_EASING)
..()
*/

/datum/reagent/toxin/skewium
name = "Skewium"
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@
#include "code\_onclick\hud\new_player.dm"
#include "code\_onclick\hud\picture_in_picture.dm"
#include "code\_onclick\hud\plane_master.dm"
#include "code\_onclick\hud\plane_master_controller.dm"
#include "code\_onclick\hud\radial.dm"
#include "code\_onclick\hud\radial_persistent.dm"
#include "code\_onclick\hud\revenanthud.dm"
Expand Down

0 comments on commit f700fd6

Please sign in to comment.