From 7d3fd4355f1e96150aaf4a96a092de60186bda26 Mon Sep 17 00:00:00 2001 From: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com> Date: Thu, 10 Dec 2020 15:25:46 -0800 Subject: [PATCH] Everything that uses maptext now uses the class that makes it actually readable (#55420) Adds a MAPTEXT macro that wraps the given text in the maptext class, the thing we use for Runechat to make it so you can actually read it. Everything that sets maptext now uses this. --- code/__DEFINES/misc.dm | 3 +++ code/__HELPERS/game.dm | 2 +- code/__HELPERS/icons.dm | 2 +- code/_onclick/hud/credits.dm | 2 +- code/_onclick/hud/movable_screen_objects.dm | 4 ++-- code/controllers/subsystem/explosions.dm | 6 +++--- code/datums/action.dm | 4 ++-- code/datums/chatmessage.dm | 4 ++-- code/datums/components/storage/storage.dm | 2 +- code/game/objects/effects/countdown.dm | 2 +- .../objects/items/devices/electroadaptive_pseudocircuit.dm | 6 +++--- code/game/objects/items/devices/gps.dm | 2 +- code/modules/admin/sound_emitter.dm | 2 +- code/modules/admin/verbs/mapping.dm | 2 +- code/modules/antagonists/blob/blob_mobs.dm | 2 +- code/modules/antagonists/blob/overmind.dm | 6 +++--- code/modules/antagonists/revenant/revenant.dm | 2 +- code/modules/clothing/chameleon.dm | 2 +- code/modules/clothing/glasses/engine_goggles.dm | 2 +- code/modules/mob/living/carbon/alien/screen.dm | 2 +- code/modules/mob/living/carbon/life.dm | 2 +- code/modules/mob/living/simple_animal/guardian/guardian.dm | 2 +- code/modules/mob/living/simple_animal/hostile/ooze.dm | 2 +- code/modules/paperwork/ticketmachine.dm | 6 +++--- code/modules/power/cable.dm | 2 +- 25 files changed, 38 insertions(+), 35 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 69f363249fd..e95446094a3 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -456,6 +456,9 @@ GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE))) // Used by PDA and cartridge code to reduce repetitiveness of spritesheets #define PDAIMG(what) {""} +/// Prepares a text to be used for maptext. Use this so it doesn't look hideous. +#define MAPTEXT(text) {"[##text]"} + //Filters #define AMBIENT_OCCLUSION filter(type="drop_shadow", x=0, y=-2, size=4, color="#04080FAA") #define GAUSSIAN_BLUR(filter_size) filter(type="blur", size=filter_size) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 593ceebc0ba..ba18fb6d5e5 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -341,7 +341,7 @@ /proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480) if(!isobj(O)) O = new /atom/movable/screen/text() - O.maptext = maptext + O.maptext = MAPTEXT(maptext) O.maptext_height = maptext_height O.maptext_width = maptext_width O.screen_loc = screen_loc diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 842ff641782..e2ae09e89e8 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -988,7 +988,7 @@ world letter = lowertext(letter) var/image/text_image = new(loc = A) - text_image.maptext = "[letter]" + text_image.maptext = MAPTEXT("[letter]") text_image.pixel_x = 7 text_image.pixel_y = 5 qdel(atom_icon) diff --git a/code/_onclick/hud/credits.dm b/code/_onclick/hud/credits.dm index 974f1583236..aaf423ecbcd 100644 --- a/code/_onclick/hud/credits.dm +++ b/code/_onclick/hud/credits.dm @@ -44,7 +44,7 @@ icon = I parent = P icon_state = credited - maptext = credited + maptext = MAPTEXT(credited) maptext_x = world.icon_size + 8 maptext_y = (world.icon_size / 2) - 4 maptext_width = world.icon_size * 3 diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index 261d898777a..ddc67d4ca0a 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -59,7 +59,7 @@ var/atom/movable/screen/movable/M = new() M.name = "Movable UI Object" M.icon_state = "block" - M.maptext = "Movable" + M.maptext = MAPTEXT("Movable") M.maptext_width = 64 var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") as text|null @@ -78,7 +78,7 @@ var/atom/movable/screen/movable/snap/S = new() S.name = "Snap UI Object" S.icon_state = "block" - S.maptext = "Snap" + S.maptext = MAPTEXT("Snap") S.maptext_width = 64 var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") as text|null diff --git a/code/controllers/subsystem/explosions.dm b/code/controllers/subsystem/explosions.dm index 5435c0a75eb..23505f19673 100644 --- a/code/controllers/subsystem/explosions.dm +++ b/code/controllers/subsystem/explosions.dm @@ -135,13 +135,13 @@ SUBSYSTEM_DEF(explosions) if(dist < dev) T.color = "red" - T.maptext = "Dev" + T.maptext = MAPTEXT("Dev") else if (dist < heavy) T.color = "yellow" - T.maptext = "Heavy" + T.maptext = MAPTEXT("Heavy") else if (dist < light) T.color = "blue" - T.maptext = "Light" + T.maptext = MAPTEXT("Light") else continue diff --git a/code/datums/action.dm b/code/datums/action.dm index 62ed37605db..c4e2b1aa898 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -640,7 +640,7 @@ /datum/action/cooldown/proc/StartCooldown() next_use_time = world.time + cooldown_time - button.maptext = "[round(cooldown_time/10, 0.1)]" + button.maptext = MAPTEXT("[round(cooldown_time/10, 0.1)]") UpdateButtonIcon() START_PROCESSING(SSfastprocess, src) @@ -654,7 +654,7 @@ UpdateButtonIcon() STOP_PROCESSING(SSfastprocess, src) else - button.maptext = "[round(timeleft/10, 0.1)]" + button.maptext = MAPTEXT("[round(timeleft/10, 0.1)]") /datum/action/cooldown/Grant(mob/M) ..() diff --git a/code/datums/chatmessage.dm b/code/datums/chatmessage.dm index 1eb03ab1cca..b711e3d2ec8 100644 --- a/code/datums/chatmessage.dm +++ b/code/datums/chatmessage.dm @@ -162,7 +162,7 @@ var/tgt_color = extra_classes.Find("italics") ? target.chat_color_darkened : target.chat_color // Approximate text height - var/complete_text = "[text]" + var/complete_text = "[text]" var/mheight = WXH_TO_HEIGHT(owned_by.MeasureText(complete_text, null, CHAT_MESSAGE_WIDTH)) approx_lines = max(1, mheight / CHAT_MESSAGE_APPROX_LHEIGHT) @@ -196,7 +196,7 @@ message.maptext_width = CHAT_MESSAGE_WIDTH message.maptext_height = mheight message.maptext_x = (CHAT_MESSAGE_WIDTH - owner.bound_width) * -0.5 - message.maptext = complete_text + message.maptext = MAPTEXT(complete_text) // View the message LAZYADDASSOC(owned_by.seen_messages, message_loc, src) diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 0dba8770c6b..125dd563885 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -352,7 +352,7 @@ var/datum/numbered_display/ND = numerical_display_contents[type] ND.sample_object.mouse_opacity = MOUSE_OPACITY_OPAQUE ND.sample_object.screen_loc = "[cx]:[screen_pixel_x],[cy]:[screen_pixel_y]" - ND.sample_object.maptext = "[(ND.number > 1)? "[ND.number]" : ""]" + ND.sample_object.maptext = MAPTEXT("[(ND.number > 1)? "[ND.number]" : ""]") ND.sample_object.layer = ABOVE_HUD_LAYER ND.sample_object.plane = ABOVE_HUD_PLANE cx++ diff --git a/code/game/objects/effects/countdown.dm b/code/game/objects/effects/countdown.dm index 0cbac95e5a2..02017632119 100644 --- a/code/game/objects/effects/countdown.dm +++ b/code/game/objects/effects/countdown.dm @@ -51,7 +51,7 @@ displayed_text = new_val if(displayed_text) - maptext = "[displayed_text]" + maptext = MAPTEXT("[displayed_text]") else maptext = null diff --git a/code/game/objects/items/devices/electroadaptive_pseudocircuit.dm b/code/game/objects/items/devices/electroadaptive_pseudocircuit.dm index 5d8a79d35ae..e32e0ee78f2 100644 --- a/code/game/objects/items/devices/electroadaptive_pseudocircuit.dm +++ b/code/game/objects/items/devices/electroadaptive_pseudocircuit.dm @@ -13,7 +13,7 @@ /obj/item/electroadaptive_pseudocircuit/Initialize() . = ..() - maptext = "[circuits]" + maptext = MAPTEXT(circuits) /obj/item/electroadaptive_pseudocircuit/examine(mob/user) . = ..() @@ -40,7 +40,7 @@ playsound(R, 'sound/items/rped.ogg', 50, TRUE) recharging = TRUE circuits-- - maptext = "[circuits]" + maptext = MAPTEXT(circuits) icon_state = "[initial(icon_state)]_recharging" var/recharge_time = min(600, circuit_cost * 5) //40W of cost for one fabrication = 20 seconds of recharge time; this is to prevent spamming addtimer(CALLBACK(src, .proc/recharge), recharge_time) @@ -53,7 +53,7 @@ if(!is_type_in_typecache(target, recycleable_circuits)) return circuits++ - maptext = "[circuits]" + maptext = MAPTEXT(circuits) user.visible_message("User breaks down [target] with [src].", \ "You recycle [target] into [src]. It now has material for [circuits] circuits.") playsound(user, 'sound/items/deconstruct.ogg', 50, TRUE) diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index 5635d790b38..3f34cda50ec 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -64,7 +64,7 @@ // I assume it's faster to color,tag and OR the turf in, rather // then checking if its there T.color = RANDOM_COLOUR - T.maptext = "[T.x],[T.y],[T.z]" + T.maptext = MAPTEXT("[T.x],[T.y],[T.z]") tagged |= T /obj/item/gps/visible_debug/proc/clear() diff --git a/code/modules/admin/sound_emitter.dm b/code/modules/admin/sound_emitter.dm index 4f6fe3552db..6b248a2e8e9 100644 --- a/code/modules/admin/sound_emitter.dm +++ b/code/modules/admin/sound_emitter.dm @@ -81,7 +81,7 @@ var/new_label = stripped_input(user, "Choose a new label.", "Sound Emitter") if(!new_label) return - maptext = new_label + maptext = MAPTEXT(new_label) to_chat(user, "Label set to [maptext].", confidential = TRUE) if(href_list["edit_sound_file"]) var/new_file = input(user, "Choose a sound file.", "Sound Emitter") as null|sound diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index c53ce57149e..169159b55e2 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -83,7 +83,7 @@ GLOBAL_PROTECT(admin_verbs_debug_mapping) for(var/turf/T in C.can_see()) seen[T]++ for(var/turf/T in seen) - T.maptext = "[seen[T]]" + T.maptext = MAPTEXT(seen[T]) SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Range") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Range") diff --git a/code/modules/antagonists/blob/blob_mobs.dm b/code/modules/antagonists/blob/blob_mobs.dm index 4f95aa348ee..28aa034eba1 100644 --- a/code/modules/antagonists/blob/blob_mobs.dm +++ b/code/modules/antagonists/blob/blob_mobs.dm @@ -319,7 +319,7 @@ /mob/living/simple_animal/hostile/blob/blobbernaut/update_health_hud() if(hud_used) - hud_used.healths.maptext = "