Skip to content

Commit

Permalink
Merge branch 'Monkestation:master' into qm-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DexeeXI authored Feb 29, 2024
2 parents 5faff0c + 90f7617 commit 3cf9d1a
Show file tree
Hide file tree
Showing 165 changed files with 3,462 additions and 343 deletions.
16 changes: 16 additions & 0 deletions code/__DEFINES/atmospherics/atmos_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@
/// Air alarm has all components but isn't completed
#define AIR_ALARM_BUILD_COMPLETE 2

// Fire alarm buildstage [/obj/machinery/firealarm/buildstage]
/// Fire alarm missing circuit
#define FIRE_ALARM_BUILD_NO_CIRCUIT 0
/// Fire alarm has circuit but is missing wires
#define FIRE_ALARM_BUILD_NO_WIRES 1
/// Fire alarm has all components but isn't completed
#define FIRE_ALARM_BUILD_SECURED 2

// Fault levels for air alarm display
/// Area faults clear
#define AREA_FAULT_NONE 0
/// Fault triggered by manual intervention (ie: fire alarm pull)
#define AREA_FAULT_MANUAL 1
/// Fault triggered automatically (ie: firedoor detection)
#define AREA_FAULT_AUTOMATIC 2

// threshold_type values for [/datum/tlv/proc/set_value] and [/datum/tlv/proc/reset_value]
/// [/datum/tlv/var/warning_min]
#define TLV_VAR_WARNING_MIN (1 << 0)
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/cleaning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@
#define CLEAN_SCRUB (CLEAN_WASH | CLEAN_TYPE_FINGERPRINTS | CLEAN_TYPE_FIBERS | CLEAN_TYPE_HARD_DECAL)
#define CLEAN_RAD CLEAN_TYPE_RADIATION
#define CLEAN_ALL ALL

// Footprint sprites to use when making footprints in blood, oil, etc.
#define FOOTPRINT_SPRITE_SHOES "shoes"
#define FOOTPRINT_SPRITE_PAWS "paws"
#define FOOTPRINT_SPRITE_CLAWS "claws"
8 changes: 8 additions & 0 deletions code/__DEFINES/fonts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@

/// Emoji icon set
#define EMOJI_SET 'icons/ui_icons/emoji/emoji.dmi'

// Font metrics bitfield
/// Include leading A width and trailing C width in GetWidth() or in DrawText()
#define INCLUDE_AC (1<<0)

DEFINE_BITFIELD(font_flags, list(
"INCLUDE_AC" = INCLUDE_AC,
))
36 changes: 35 additions & 1 deletion code/__DEFINES/text.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
/// Does 4 spaces. Used as a makeshift tabulator.
#define FOURSPACES "&nbsp;&nbsp;&nbsp;&nbsp;"

/// Standard maptext
/// Prepares a text to be used for maptext. Use this so it doesn't look hideous.
#define MAPTEXT(text) {"<span class='maptext'>[##text]</span>"}

/// Prepares a text to be used for maptext, using a font that can handle larger text better.
/**
* Pixel-perfect scaled fonts for use in the MAP element as defined in skin.dmf
*
* Four sizes to choose from, use the sizes as mentioned below.
* Between the variations and a step there should be an option that fits your use case.
* BYOND uses pt sizing, different than px used in TGUI. Using px will make it look blurry due to poor antialiasing.
*
* Default sizes are prefilled in the macro for ease of use and a consistent visual look.
* To use a step other than the default in the macro, specify it in a span style.
* For example: MAPTEXT_PIXELLARI("<span style='font-size: 24pt'>Some large maptext here</span>")
*/
/// Large size (ie: context tooltips) - Size options: 12pt 24pt.
#define MAPTEXT_PIXELLARI(text) {"<span style='font-family: \"Pixellari\"; font-size: 12pt; -dm-text-outline: 1px black'>[##text]</span>"}

/// Standard size (ie: normal runechat) - Size options: 6pt 12pt 18pt.
#define MAPTEXT_GRAND9K(text) {"<span style='font-family: \"Grand9K Pixel\"; font-size: 6pt; -dm-text-outline: 1px black'>[##text]</span>"}

/// Small size. (ie: context subtooltips, spell delays) - Size options: 12pt 24pt.
#define MAPTEXT_TINY_UNICODE(text) {"<span style='font-family: \"TinyUnicode\"; font-size: 12pt; line-height: 0.75; -dm-text-outline: 1px black'>[##text]</span>"}

/// Smallest size. (ie: whisper runechat) - Size options: 6pt 12pt 18pt.
#define MAPTEXT_SPESSFONT(text) {"<span style='font-family: \"Spess Font\"; font-size: 6pt; line-height: 1.4; -dm-text-outline: 1px black'>[##text]</span>"}

/**
* Prepares a text to be used for maptext, using a variable size font.
*
* More flexible but doesn't scale pixel perfect to BYOND icon resolutions.
* (May be blurry.) Can use any size in pt or px.
*
* You MUST Specify the size when using the macro
* For example: MAPTEXT_VCR_OSD_MONO("<span style='font-size: 24pt'>Some large maptext here</span>")
*/
/// Prepares a text to be used for maptext, using a variable size font.
/// Variable size font. More flexible but doesn't scale pixel perfect to BYOND icon resolutions. (May be blurry.) Can use any size in pt or px.
#define MAPTEXT_VCR_OSD_MONO(text) {"<span style='font-family: \"VCR OSD Mono\"'>[##text]</span>"}

/// Macro from Lummox used to get height from a MeasureText proc.
Expand Down
25 changes: 12 additions & 13 deletions code/__HELPERS/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@
var/textb = copytext(HTMLstring, 6, 8)
return rgb(255 - hex2num(textr), 255 - hex2num(textg), 255 - hex2num(textb))

///Flash a color on the client
///Flash a color on the passed mob
/proc/flash_color(mob_or_client, flash_color="#960000", flash_time=20)
var/client/flashed_client
var/mob/flashed_mob
if(ismob(mob_or_client))
var/mob/client_mob = mob_or_client
if(client_mob.client)
flashed_client = client_mob.client
else
return
flashed_mob = mob_or_client
else if(istype(mob_or_client, /client))
flashed_client = mob_or_client
var/client/flashed_client = mob_or_client
flashed_mob = flashed_client.mob

if(!istype(flashed_client))
if(!istype(flashed_mob))
return

var/animate_color = flashed_client.color
flashed_client.color = flash_color
animate(flashed_client, color = animate_color, time = flash_time)
var/datum/client_colour/temp/temp_color = new(flashed_mob)
temp_color.colour = flash_color
temp_color.fade_in = flash_time * 0.25
temp_color.fade_out = flash_time * 0.25
QDEL_IN(temp_color, (flash_time * 0.5) + 1)
flashed_mob.add_client_colour(temp_color)

/// Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode
/// Much like multiply, screen effects the brightness of the resulting color
Expand Down Expand Up @@ -94,4 +94,3 @@


#define RANDOM_COLOUR (rgb(rand(0,255),rand(0,255),rand(0,255)))

2 changes: 1 addition & 1 deletion code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ world
letter = lowertext(letter)

var/image/text_image = new(loc = A)
text_image.maptext = MAPTEXT("<font size = 4>[letter]</font>")
text_image.maptext = MAPTEXT("<span style='font-size: 24pt'>[letter]</span>")
text_image.pixel_x = 7
text_image.pixel_y = 5
qdel(atom_icon)
Expand Down
9 changes: 3 additions & 6 deletions code/__HELPERS/priority_announce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* * encode_title - if TRUE, the title will be HTML encoded
* * encode_text - if TRUE, the text will be HTML encoded
*/
/proc/priority_announce(text, title = "", sound, type, sender_override, has_important_message = FALSE, list/mob/players, encode_title = TRUE, encode_text = TRUE, color_override)
/proc/priority_announce(text, title = "", sound, type, sender_override, has_important_message = FALSE, list/mob/players = GLOB.player_list, encode_title = TRUE, encode_text = TRUE, color_override)
if(!text)
return

Expand Down Expand Up @@ -92,7 +92,7 @@

dispatch_announcement_to_players(finalized_announcement, players, sound)

if(isnull(sender_override))
if(isnull(sender_override) && players == GLOB.player_list)
if(length(title) > 0)
GLOB.news_network.submit_article(title + "<br><br>" + text, "[command_name()]", "Station Announcements", null)
else
Expand Down Expand Up @@ -192,10 +192,7 @@
return jointext(returnable_strings, "")

/// Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.
/proc/dispatch_announcement_to_players(announcement, list/players, sound_override = null, should_play_sound = TRUE)
if(!players)
players = GLOB.player_list

/proc/dispatch_announcement_to_players(announcement, list/players = GLOB.player_list, sound_override = null, should_play_sound = TRUE)
var/sound_to_play = !isnull(sound_override) ? sound_override : 'sound/misc/notice2.ogg'

for(var/mob/target in players)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/credits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
icon = I
parent = P
icon_state = credited
maptext = MAPTEXT(credited)
maptext = MAPTEXT_PIXELLARI(credited)
maptext_x = world.icon_size + 8
maptext_y = (world.icon_size / 2) - 4
maptext_width = world.icon_size * 3
Expand Down
10 changes: 5 additions & 5 deletions code/datums/actions/cooldown_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
/datum/action/cooldown/create_button()
var/atom/movable/screen/movable/action_button/button = ..()
button.maptext = ""
button.maptext_x = 6
button.maptext_x = 4
button.maptext_y = 2
button.maptext_width = 24
button.maptext_height = 12
button.maptext_width = 32
button.maptext_height = 16
return button

/datum/action/cooldown/update_button_status(atom/movable/screen/movable/action_button/button, force = FALSE)
Expand All @@ -79,9 +79,9 @@
button.maptext = ""
else
if (cooldown_rounding > 0)
button.maptext = MAPTEXT("<b>[round(time_left/10, cooldown_rounding)]</b>")
button.maptext = MAPTEXT_TINY_UNICODE("[round(time_left/10, cooldown_rounding)]")
else
button.maptext = MAPTEXT("<b>[round(time_left/10)]</b>")
button.maptext = MAPTEXT_TINY_UNICODE("[round(time_left/10)]")

if(!IsAvailable() || !is_action_active(button))
return
Expand Down
2 changes: 1 addition & 1 deletion code/datums/browser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
if ("number")
settings["mainsettings"][setting]["value"] = input(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]") as num
if ("color")
settings["mainsettings"][setting]["value"] = input(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]", settings["mainsettings"][setting]["value"]) as color
settings["mainsettings"][setting]["value"] = tgui_color_picker(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]", settings["mainsettings"][setting]["value"])
if ("boolean")
settings["mainsettings"][setting]["value"] = (settings["mainsettings"][setting]["value"] == "Yes") ? "No" : "Yes"
if ("ckey")
Expand Down
10 changes: 7 additions & 3 deletions code/datums/chatmessage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/// Approximate height in pixels of an 'average' line, used for height decay
#define CHAT_MESSAGE_APPROX_LHEIGHT 11
/// Max width of chat message in pixels
#define CHAT_MESSAGE_WIDTH 96
#define CHAT_MESSAGE_WIDTH 112
/// The dimensions of the chat message icons
#define CHAT_MESSAGE_ICON_SIZE 9

Expand Down Expand Up @@ -145,6 +145,10 @@
if (!ismob(target))
extra_classes |= "small"

// Why are you yelling?
if(copytext_char(text, -2) == "!!")
extra_classes |= SPAN_YELL

var/list/prefixes

// Append radio icon if from a virtual speaker
Expand All @@ -171,7 +175,7 @@
var/tgt_color = extra_classes.Find("italics") ? target.chat_color_darkened : target.chat_color

// Approximate text height
var/complete_text = "<span class='center [extra_classes.Join(" ")]' style='color: [tgt_color]'>[owner.say_emphasis(text)]</span>"
var/complete_text = "<span style='color: [tgt_color]'><span class='center [extra_classes.Join(" ")]'>[owner.say_emphasis(text)]</span></span>"

var/mheight
WXH_TO_HEIGHT(owned_by.MeasureText(complete_text, null, CHAT_MESSAGE_WIDTH), mheight)
Expand Down Expand Up @@ -235,7 +239,7 @@
message.pixel_y = target.maptext_height
message.pixel_x = -target.base_pixel_x
message.maptext_width = CHAT_MESSAGE_WIDTH
message.maptext_height = mheight
message.maptext_height = mheight * 1.25 // We add extra because some characters are superscript, like actions
message.maptext_x = (CHAT_MESSAGE_WIDTH - owner.bound_width) * -0.5
message.maptext = MAPTEXT(complete_text)

Expand Down
6 changes: 3 additions & 3 deletions code/datums/components/admin_popup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@

last_color_index = (last_color_index % colors.len) + 1

var/message = "<b style='color: [colors[last_color_index]]; text-align: center; font-size: 32px'>"
message += "HEY! An admin is trying to talk to you!<br>Check your chat window, and click their name to respond!"
message += "</b>"
var/message = "<span style='color: [colors[last_color_index]]; text-align: center; font-size: 24pt'>"
message += "HEY!<br>An admin is trying to talk to you!<br>Check your chat window,<br>and click their name to respond!"
message += "</span>"

maptext = MAPTEXT(message)
last_update_time = world.time
Expand Down
19 changes: 11 additions & 8 deletions code/datums/components/bloodysoles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
/// The world.time when we last picked up blood
var/last_pickup

var/footprint_sprite = FOOTPRINT_SPRITE_SHOES

/datum/component/bloodysoles/Initialize()
if(!isclothing(parent))
return COMPONENT_INCOMPATIBLE
Expand Down Expand Up @@ -100,9 +102,9 @@
/**
* Find a blood decal on a turf that matches our last_blood_state
*/
/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null)
/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null, footprint_sprite)
for(var/obj/effect/decal/cleanable/blood/pool in turfLoc)
if(pool.blood_state == last_blood_state && (!typeFilter || istype(pool, typeFilter)))
if(pool.blood_state == last_blood_state && pool.footprint_sprite == footprint_sprite && (!typeFilter || istype(pool, typeFilter)))
return pool

/**
Expand Down Expand Up @@ -158,23 +160,23 @@
return

var/half_our_blood = bloody_shoes[last_blood_state] / 2

var/footprint_sprite = wielder.get_footprint_sprite()
// Add footprints in old loc if we have enough cream
if(half_our_blood >= BLOOD_FOOTPRINTS_MIN)
var/turf/oldLocTurf = get_turf(OldLoc)
var/obj/effect/decal/cleanable/blood/footprints/oldLocFP = find_pool_by_blood_state(oldLocTurf, /obj/effect/decal/cleanable/blood/footprints)
var/obj/effect/decal/cleanable/blood/footprints/oldLocFP = find_pool_by_blood_state(oldLocTurf, /obj/effect/decal/cleanable/blood/footprints, footprint_sprite)
if(oldLocFP)
// Footprints found in the tile we left, add us to it
add_parent_to_footprint(oldLocFP)
if (!(oldLocFP.exited_dirs & wielder.dir))
oldLocFP.exited_dirs |= wielder.dir
oldLocFP.update_appearance()
else if(find_pool_by_blood_state(oldLocTurf))
else if(find_pool_by_blood_state(oldLocTurf, footprint_sprite = footprint_sprite))
// No footprints in the tile we left, but there was some other blood pool there. Add exit footprints on it
adjust_bloody_shoes(last_blood_state, half_our_blood)
update_icon()

oldLocFP = new(oldLocTurf)
oldLocFP = new(oldLocTurf, footprint_sprite)
if(!QDELETED(oldLocFP)) ///prints merged
oldLocFP.blood_state = last_blood_state
oldLocFP.exited_dirs |= wielder.dir
Expand All @@ -194,7 +196,7 @@
adjust_bloody_shoes(last_blood_state, half_our_blood)
update_icon()

var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom))
var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom), footprint_sprite)
if(!QDELETED(FP)) ///prints merged
FP.blood_state = last_blood_state
FP.entered_dirs |= wielder.dir
Expand Down Expand Up @@ -253,7 +255,8 @@
return COMPONENT_INCOMPATIBLE
parent_atom = parent
wielder = parent

if(footprint_sprite)
src.footprint_sprite = footprint_sprite
if(!bloody_feet)
bloody_feet = mutable_appearance('icons/effects/blood.dmi', "shoeblood", SHOES_LAYER)

Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/palette.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
var/is_right_clicking = (user.istate & ISTATE_SECONDARY)
var/index = text2num(choice)
if(is_right_clicking)
var/chosen_color = input(user, "Pick new color", "[parent]", colors[index]) as color|null
var/chosen_color = tgui_color_picker(user, "Pick new color", "[parent]", colors[index])
if(chosen_color && !QDELETED(src) && !IS_DEAD_OR_INCAP(user) && user.is_holding(parent))
colors[index] = chosen_color
update_radial_list()
Expand Down
4 changes: 2 additions & 2 deletions code/datums/elements/climbable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
vault_over_object(user, climbed_thing)
if(climb_stun)
user.Stun(climb_stun)
user.visible_message("<span class='warning'>[user] flips over [src]!</span>", \
"<span class='notice'>You flip over [climbed_thing]!</span>")
user.visible_message(span_warning("[user] flips over [climbed_thing]!"), \
span_notice("You flip over [climbed_thing]!"))

else if(do_climb(climbed_thing, user, params))
user.visible_message(span_warning("[user] climbs onto [climbed_thing]."), \
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 @@ -801,7 +801,7 @@

/datum/greyscale_config/buckets
name = "Buckets"
icon_file = 'icons/obj/janitor.dmi'
icon_file = 'icons/obj/service/janitor.dmi'
json_config = 'code/datums/greyscale/json_configs/buckets.json'

/datum/greyscale_config/buckets_worn
Expand Down
5 changes: 5 additions & 0 deletions code/datums/mood_events/drink_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@
description = "Amazing taste!"
mood_change = 50
timeout = 10 MINUTES

/datum/mood_event/wellcheers
description = "What a tasty can of Wellcheers! The salty grape taste is a great pick-me-up."
mood_change = 3
timeout = 7 MINUTES
11 changes: 10 additions & 1 deletion code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
var/list/firealarms = list()
///Alarm type to count of sources. Not usable for ^ because we handle fires differently
var/list/active_alarms = list()
/// The current alarm fault status
var/fault_status = AREA_FAULT_NONE
/// The source machinery for the area's fault status
var/fault_location
///List of all lights in our area
var/list/lights = list()
///We use this just for fire alarms, because they're area based right now so one alarm going poof shouldn't prevent you from clearing your alarms listing. Fire alarms and fire locks will set and clear alarms.
Expand Down Expand Up @@ -316,10 +320,15 @@ GLOBAL_LIST_EMPTY(teleportlocs)
*
* Allows interested parties (lights and fire alarms) to react
*/
/area/proc/set_fire_effect(new_fire)
/area/proc/set_fire_effect(new_fire, fault_type, fault_source)
if(new_fire == fire)
return
fire = new_fire
fault_status = fault_type
if(fire)
fault_location = fault_source
else
fault_location = null
SEND_SIGNAL(src, COMSIG_AREA_FIRE_CHANGED, fire)

/**
Expand Down
Loading

0 comments on commit 3cf9d1a

Please sign in to comment.