diff --git a/code/__DEFINES/layers_planes.dm b/code/__DEFINES/layers_planes.dm index 64d8b5f02cf0..376c4586f870 100644 --- a/code/__DEFINES/layers_planes.dm +++ b/code/__DEFINES/layers_planes.dm @@ -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 diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index d01ba13595ad..dbc6ffe4c58c 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -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 @@ -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 @@ -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 diff --git a/code/_onclick/hud/plane_master_controller.dm b/code/_onclick/hud/plane_master_controller.dm new file mode 100644 index 000000000000..e27bd3bc5551 --- /dev/null +++ b/code/_onclick/hud/plane_master_controller.dm @@ -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]"] + 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 + 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) diff --git a/code/game/machinery/announcement_system.dm b/code/game/machinery/announcement_system.dm index 69cdabe65fff..632e9af9307d 100644 --- a/code/game/machinery/announcement_system.dm +++ b/code/game/machinery/announcement_system.dm @@ -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) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 4ca642843bf9..f6856437f8b9 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -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. diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 5280bac0ce95..afe9609ee3df 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -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 diff --git a/code/modules/admin/view_variables/debug_variable_appearance.dm b/code/modules/admin/view_variables/debug_variable_appearance.dm index 8bc9979a7d10..31d387efb333 100644 --- a/code/modules/admin/view_variables/debug_variable_appearance.dm +++ b/code/modules/admin/view_variables/debug_variable_appearance.dm @@ -63,6 +63,13 @@ 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 @@ -70,12 +77,15 @@ GLOBAL_DATUM_INIT(pluto, /atom/movable, new /atom/movable(null)) 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 ..() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index bfad3339f160..7fd8bb5317f3 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -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 diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm index da1919443a97..6b47d016e5ee 100644 --- a/code/modules/mob/status_procs.dm +++ b/code/modules/mob/status_procs.dm @@ -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) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 106de6474644..786b3add5370 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -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" diff --git a/tgstation.dme b/tgstation.dme index 4b19b4da8bb9..969c9e6a2bca 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -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"