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
Rhials committed Feb 18, 2024
2 parents 2c281d8 + 8d305e5 commit 9f0c54d
Show file tree
Hide file tree
Showing 75 changed files with 718 additions and 283 deletions.
1 change: 0 additions & 1 deletion _maps/RandomZLevels/museum.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -3147,7 +3147,6 @@
/obj/structure/transport/linear/tram/slow,
/obj/structure/thermoplastic,
/obj/effect/spawner/random/structure/closet_empty/crate/with_loot,
/obj/effect/spawner/random/maintenance/five,
/turf/open/chasm/true/no_smooth,
/area/awaymission/museum)
"Cc" = (
Expand Down
6 changes: 1 addition & 5 deletions _maps/map_files/Birdshot/birdshot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -19620,13 +19620,9 @@
/obj/effect/turf_decal/siding/wood{
dir = 9
},
/obj/structure/rack{
icon = 'icons/obj/fluff/general.dmi';
icon_state = "minibar";
name = "skeletal minibar"
},
/obj/item/storage/fancy/candle_box,
/obj/machinery/light_switch/directional/west,
/obj/structure/rack/skeletal,
/turf/open/floor/iron/grimy,
/area/station/service/library)
"hei" = (
Expand Down
10 changes: 1 addition & 9 deletions _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -24819,13 +24819,9 @@
/turf/open/floor/iron/white,
/area/station/science/ordnance/storage)
"iWB" = (
/obj/structure/rack{
icon = 'icons/obj/fluff/general.dmi';
icon_state = "minibar";
name = "skeletal minibar"
},
/obj/item/storage/fancy/candle_box,
/obj/machinery/light/small/directional/east,
/obj/structure/rack/skeletal,
/turf/open/floor/engine/cult,
/area/station/service/library)
"iWD" = (
Expand Down Expand Up @@ -56637,10 +56633,6 @@
"uhI" = (
/obj/structure/cable,
/obj/effect/landmark/event_spawn,
/obj/machinery/requests_console/directional/north{
department = "Security";
name = "Security Requests Console"
},
/turf/open/floor/iron,
/area/station/security/checkpoint/customs)
"uhP" = (
Expand Down
6 changes: 1 addition & 5 deletions _maps/shuttles/emergency_monastery.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2433,16 +2433,12 @@
/turf/open/floor/carpet,
/area/shuttle/escape)
"Ju" = (
/obj/structure/rack{
icon = 'icons/obj/fluff/general.dmi';
icon_state = "minibar";
name = "skeletal minibar"
},
/obj/item/book/codex_gigas,
/obj/machinery/camera/directional/south{
c_tag = "Monastery Archives Aft";
network = list("ss13","monastery")
},
/obj/structure/rack/skeletal,
/turf/open/floor/iron/dark,
/area/shuttle/escape)
"Jv" = (
Expand Down
12 changes: 2 additions & 10 deletions _maps/shuttles/pirate_dutchman.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,11 @@
/obj/effect/turf_decal/siding/wood{
dir = 8
},
/obj/structure/rack{
icon = 'icons/obj/fluff/general.dmi';
icon_state = "minibar";
name = "skeletal minibar"
},
/obj/item/food/grown/sugarcane,
/obj/item/food/grown/sugarcane,
/obj/item/food/grown/sugarcane,
/obj/item/reagent_containers/cup/bucket/wooden,
/obj/structure/rack/skeletal,
/turf/open/floor/wood/airless,
/area/shuttle/pirate/flying_dutchman)
"vT" = (
Expand Down Expand Up @@ -550,17 +546,13 @@
dir = 10
},
/obj/machinery/light/floor,
/obj/structure/rack{
icon = 'icons/obj/fluff/general.dmi';
icon_state = "minibar";
name = "skeletal minibar"
},
/obj/item/reagent_containers/condiment/milk{
pixel_x = -5
},
/obj/item/reagent_containers/condiment/milk{
pixel_x = 5
},
/obj/structure/rack/skeletal,
/turf/open/floor/wood/airless,
/area/shuttle/pirate/flying_dutchman)
"zE" = (
Expand Down
6 changes: 1 addition & 5 deletions _maps/virtual_domains/pirates.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,10 @@
/area/virtual_domain/fullbright)
"AF" = (
/obj/effect/mapping_helpers/burnt_floor,
/obj/structure/rack{
icon = 'icons/obj/fluff/general.dmi';
icon_state = "minibar";
name = "skeletal minibar"
},
/obj/item/storage/bag/money/dutchmen{
pixel_y = 13
},
/obj/structure/rack/skeletal,
/turf/open/floor/wood/parquet,
/area/virtual_domain)
"AP" = (
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,6 @@

/// from /mob/proc/slip(): (knockdown_amonut, obj/slipped_on, lube_flags [mobs.dm], paralyze, force_drop)
#define COMSIG_MOB_SLIPPED "mob_slipped"

/// from /mob/proc/key_down(): (key, client/client, full_key)
#define COMSIG_MOB_KEYDOWN "mob_key_down"
7 changes: 7 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_DEL_ON_SPACE_DUMP "del_on_hyperspace_leave"
/// We can walk up or around cliffs, or at least we don't fall off of it
#define TRAIT_CLIFF_WALKER "cliff_walker"
/// This means the user is currently holding/wearing a "tactical camouflage" item (like a potted plant).
#define TRAIT_TACTICALLY_CAMOUFLAGED "tactically_camouflaged"
/// Gets double arcade prizes
#define TRAIT_GAMERGOD "gamer-god"
#define TRAIT_GIANT "giant"
Expand All @@ -357,6 +359,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NO_EXTINGUISH "no_extinguish"
/// Indicates if the mob is currently speaking with sign language
#define TRAIT_SIGN_LANG "sign_language"
/// Trait given to mobs to indicate that they can catch papers thrown at them midair without trying,
/// and make syndicate airplanes when folding paper up.
#define TRAIT_PAPER_MASTER "paper_master"
/// This mob is able to use sign language over the radio.
#define TRAIT_CAN_SIGN_ON_COMMS "can_sign_on_comms"
/// nobody can use martial arts on this mob
Expand Down Expand Up @@ -634,6 +639,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai

/// Used by the honkspam element to avoid spamming the sound. Amusing considering its name.
#define TRAIT_HONKSPAMMING "trait_honkspamming"
/// Required by the waddling element since there are multiple sources of it.
#define TRAIT_WADDLING "trait_waddling"

///Used for managing KEEP_TOGETHER in [/atom/var/appearance_flags]
#define TRAIT_KEEP_TOGETHER "keep-together"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/traits/sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
/// Trait from light debugging
#define LIGHT_DEBUG_TRAIT "light-debug"

/// Trait given by an Action datum
#define ACTION_TRAIT "action"

#define CLOTHING_TRAIT "clothing"
#define HELMET_TRAIT "helmet"
/// inherited from the mask
Expand Down
3 changes: 3 additions & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_UNIQUE_IMMERSE" = TRAIT_UNIQUE_IMMERSE,
"TRAIT_VOIDSTORM_IMMUNE" = TRAIT_VOIDSTORM_IMMUNE,
"TRAIT_WAS_RENAMED" = TRAIT_WAS_RENAMED,
"TRAIT_WADDLING" = TRAIT_WADDLING,
"TRAIT_WEATHER_IMMUNE" = TRAIT_WEATHER_IMMUNE,
"TRAIT_CHASM_STOPPER" = TRAIT_CHASM_STOPPER,
),
Expand Down Expand Up @@ -399,6 +400,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_SHOCKIMMUNE" = TRAIT_SHOCKIMMUNE,
"TRAIT_SHOVE_KNOCKDOWN_BLOCKED" = TRAIT_SHOVE_KNOCKDOWN_BLOCKED,
"TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG,
"TRAIT_PAPER_MASTER" = TRAIT_PAPER_MASTER,
"TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS,
"TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE,
"TRAIT_SKITTISH" = TRAIT_SKITTISH,
Expand Down Expand Up @@ -428,6 +430,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_TACKLING_FRAIL_ATTACKER" = TRAIT_TACKLING_FRAIL_ATTACKER,
"TRAIT_TACKLING_TAILED_DEFENDER" = TRAIT_TACKLING_TAILED_DEFENDER,
"TRAIT_TACKLING_WINGED_ATTACKER" = TRAIT_TACKLING_WINGED_ATTACKER,
"TRAIT_TACTICALLY_CAMOUFLAGED" = TRAIT_TACTICALLY_CAMOUFLAGED,
"TRAIT_TAGGER" = TRAIT_TAGGER,
"TRAIT_TEMPORARY_BODY" = TRAIT_TEMPORARY_BODY,
"TRAIT_TENACIOUS" = TRAIT_TENACIOUS,
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/admin_tooling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list(
"TRAIT_SHIFTY_EYES" = TRAIT_SHIFTY_EYES,
"TRAIT_SHOCKIMMUNE" = TRAIT_SHOCKIMMUNE,
"TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG,
"TRAIT_PAPER_MASTER" = TRAIT_PAPER_MASTER,
"TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS,
"TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE,
"TRAIT_SKITTISH" = TRAIT_SKITTISH,
Expand Down
24 changes: 23 additions & 1 deletion code/_onclick/hud/action_button.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
/// A weakref of the last thing we hovered over
/// God I hate how dragging works
var/datum/weakref/last_hovored_ref
/// overlay for keybind maptext
var/mutable_appearance/keybind_maptext

/atom/movable/screen/movable/action_button/Destroy()
if(our_hud)
Expand Down Expand Up @@ -48,6 +50,9 @@
return FALSE

var/list/modifiers = params2list(params)
if(LAZYACCESS(modifiers, ALT_CLICK))
begin_creating_bind(usr)
return TRUE
if(LAZYACCESS(modifiers, SHIFT_CLICK))
var/datum/hud/our_hud = usr.hud_used
our_hud.position_action(src, SCRN_OBJ_DEFAULT)
Expand All @@ -61,6 +66,14 @@
linked_action.Trigger(trigger_flags = trigger_flags)
return TRUE

/atom/movable/screen/movable/action_button/proc/begin_creating_bind(mob/user)
if(!isnull(linked_action.full_key))
linked_action.full_key = null
linked_action.update_button_status(src)
return
linked_action.full_key = tgui_input_keycombo(user, "Please bind a key for this action.")
linked_action.update_button_status(src)

// Entered and Exited won't fire while you're dragging something, because you're still "holding" it
// Very much byond logic, but I want nice behavior, so we fake it with drag
/atom/movable/screen/movable/action_button/MouseDrag(atom/over_object, src_location, over_location, src_control, over_control, params)
Expand Down Expand Up @@ -149,6 +162,15 @@
return
user.client.prefs.action_buttons_screen_locs -= "[name]_[id]"

/atom/movable/screen/movable/action_button/proc/update_keybind_maptext(key)
cut_overlay(keybind_maptext)
if(!key)
return
keybind_maptext = new
keybind_maptext.maptext = MAPTEXT("<span style='text-align: right'>[key]</span>")
keybind_maptext.transform = keybind_maptext.transform.Translate(-4, length(key) > 1 ? -6 : 2) //with modifiers, its placed lower so cooldown is visible
add_overlay(keybind_maptext)

/**
* This is a silly proc used in hud code code to determine what icon and icon state we should be using
* for hud elements (such as action buttons) that don't have their own icon and icon state set.
Expand Down Expand Up @@ -241,7 +263,7 @@
action.HideFrom(src)

/atom/movable/screen/button_palette
desc = "<b>Drag</b> buttons to move them<br><b>Shift-click</b> any button to reset it<br><b>Alt-click</b> this to reset all buttons"
desc = "<b>Drag</b> buttons to move them<br><b>Shift-click</b> any button to reset it<br><b>Alt-click any button</b> to begin binding it to a key<br><b>Alt-click this</b> to reset all buttons"
icon = 'icons/hud/64x16_actions.dmi'
icon_state = "screen_gen_palette"
screen_loc = ui_action_palette
Expand Down
36 changes: 27 additions & 9 deletions code/controllers/subsystem/atoms.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define SUBSYSTEM_INIT_SOURCE "subsystem init"
SUBSYSTEM_DEF(atoms)
name = "Atoms"
init_order = INIT_ORDER_ATOMS
Expand Down Expand Up @@ -41,11 +40,16 @@ SUBSYSTEM_DEF(atoms)
if(initialized == INITIALIZATION_INSSATOMS)
return

set_tracked_initalized(INITIALIZATION_INNEW_MAPLOAD, SUBSYSTEM_INIT_SOURCE)
// Generate a unique mapload source for this run of InitializeAtoms
var/static/uid = 0
uid = (uid + 1) % (SHORT_REAL_LIMIT - 1)
var/source = "subsystem init [uid]"
set_tracked_initalized(INITIALIZATION_INNEW_MAPLOAD, source)

// This may look a bit odd, but if the actual atom creation runtimes for some reason, we absolutely need to set initialized BACK
CreateAtoms(atoms, atoms_to_return)
clear_tracked_initalize(SUBSYSTEM_INIT_SOURCE)
CreateAtoms(atoms, atoms_to_return, source)
clear_tracked_initalize(source)
SSicon_smooth.free_deferred(source)

if(late_loaders.len)
for(var/I in 1 to late_loaders.len)
Expand All @@ -72,7 +76,7 @@ SUBSYSTEM_DEF(atoms)
#endif

/// Actually creates the list of atoms. Exists soley so a runtime in the creation logic doesn't cause initalized to totally break
/datum/controller/subsystem/atoms/proc/CreateAtoms(list/atoms, list/atoms_to_return = null)
/datum/controller/subsystem/atoms/proc/CreateAtoms(list/atoms, list/atoms_to_return = null, mapload_source = null)
if (atoms_to_return)
LAZYINITLIST(created_atoms)

Expand All @@ -90,7 +94,12 @@ SUBSYSTEM_DEF(atoms)
for(var/I in 1 to atoms.len)
var/atom/A = atoms[I]
if(!(A.flags_1 & INITIALIZED_1))
CHECK_TICK
// Unrolled CHECK_TICK setup to let us enable/disable mapload based off source
if(TICK_CHECK)
clear_tracked_initalize(mapload_source)
stoplag()
if(mapload_source)
set_tracked_initalized(INITIALIZATION_INNEW_MAPLOAD, mapload_source)
PROFILE_INIT_ATOM_BEGIN()
InitAtom(A, TRUE, mapload_arg)
PROFILE_INIT_ATOM_END(A)
Expand All @@ -107,7 +116,11 @@ SUBSYSTEM_DEF(atoms)
#ifdef TESTING
++count
#endif
CHECK_TICK
if(TICK_CHECK)
clear_tracked_initalize(mapload_source)
stoplag()
if(mapload_source)
set_tracked_initalized(INITIALIZATION_INNEW_MAPLOAD, mapload_source)

testing("Initialized [count] atoms")

Expand All @@ -117,6 +130,13 @@ SUBSYSTEM_DEF(atoms)
/datum/controller/subsystem/atoms/proc/map_loader_stop(source)
clear_tracked_initalize(source)

/// Returns the source currently modifying SSatom's init behavior
/datum/controller/subsystem/atoms/proc/get_initialized_source()
var/state_length = length(initialized_state)
if(!state_length)
return null
return initialized_state[state_length][1]

/// Use this to set initialized to prevent error states where the old initialized is overriden, and we end up losing all context
/// Accepts a state and a source, the most recent state is used, sources exist to prevent overriding old values accidentially
/datum/controller/subsystem/atoms/proc/set_tracked_initalized(state, source)
Expand Down Expand Up @@ -199,5 +219,3 @@ SUBSYSTEM_DEF(atoms)
var/initlog = InitLog()
if(initlog)
text2file(initlog, "[GLOB.log_directory]/initialize.log")

#undef SUBSYSTEM_INIT_SOURCE
15 changes: 15 additions & 0 deletions code/controllers/subsystem/icon_smooth.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SUBSYSTEM_DEF(icon_smooth)
var/list/blueprint_queue = list()
var/list/smooth_queue = list()
var/list/deferred = list()
var/list/deferred_by_source = list()

/datum/controller/subsystem/icon_smooth/fire()
// We do not want to smooth icons of atoms whose neighbors are not initialized yet,
Expand Down Expand Up @@ -61,16 +62,30 @@ SUBSYSTEM_DEF(icon_smooth)

return SS_INIT_SUCCESS

/// Releases a pool of delayed smooth attempts from a particular source
/datum/controller/subsystem/icon_smooth/proc/free_deferred(source_to_free)
smooth_queue += deferred_by_source[source_to_free]
deferred_by_source -= source_to_free
if(!can_fire)
can_fire = TRUE

/datum/controller/subsystem/icon_smooth/proc/add_to_queue(atom/thing)
if(thing.smoothing_flags & SMOOTH_QUEUED)
return
thing.smoothing_flags |= SMOOTH_QUEUED
// If we're currently locked into mapload BY something
// Then put us in a deferred list that we release when this mapload run is finished
if(initialized && length(SSatoms.initialized_state) && SSatoms.initialized == INITIALIZATION_INNEW_MAPLOAD)
var/source = SSatoms.get_initialized_source()
LAZYADD(deferred_by_source[source], thing)
return
smooth_queue += thing
if(!can_fire)
can_fire = TRUE

/datum/controller/subsystem/icon_smooth/proc/remove_from_queues(atom/thing)
// Lack of removal from deferred_by_source is safe because the lack of SMOOTH_QUEUED will just free it anyway
// Hopefully this'll never cause a harddel (dies)
thing.smoothing_flags &= ~SMOOTH_QUEUED
smooth_queue -= thing
if(blueprint_queue)
Expand Down
3 changes: 0 additions & 3 deletions code/controllers/subsystem/timer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#define BUCKET_POS(timer) (((ROUND_UP((timer.timeToRun - timer.timer_subsystem.head_offset) / world.tick_lag)+1) % BUCKET_LEN) || BUCKET_LEN)
/// Gets the maximum time at which timers will be invoked from buckets, used for deferring to secondary queue
#define TIMER_MAX(timer_ss) (timer_ss.head_offset + TICKS2DS(BUCKET_LEN + timer_ss.practical_offset - 1))
/// Max float with integer precision
#define TIMER_ID_MAX (2**24)

/**
* # Timer Subsystem
Expand Down Expand Up @@ -731,4 +729,3 @@ SUBSYSTEM_DEF(timer)
#undef BUCKET_LEN
#undef BUCKET_POS
#undef TIMER_MAX
#undef TIMER_ID_MAX
Loading

0 comments on commit 9f0c54d

Please sign in to comment.