mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 16:47:13 +01:00
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.
This commit is contained in:
@@ -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) {"<span class="pda16x16 [#what]"></span>"}
|
||||
|
||||
/// Prepares a text to be used for maptext. Use this so it doesn't look hideous.
|
||||
#define MAPTEXT(text) {"<span class='maptext'>[##text]</span>"}
|
||||
|
||||
//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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -988,7 +988,7 @@ world
|
||||
letter = lowertext(letter)
|
||||
|
||||
var/image/text_image = new(loc = A)
|
||||
text_image.maptext = "<font size = 4>[letter]</font>"
|
||||
text_image.maptext = MAPTEXT("<font size = 4>[letter]</font>")
|
||||
text_image.pixel_x = 7
|
||||
text_image.pixel_y = 5
|
||||
qdel(atom_icon)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -640,7 +640,7 @@
|
||||
|
||||
/datum/action/cooldown/proc/StartCooldown()
|
||||
next_use_time = world.time + cooldown_time
|
||||
button.maptext = "<b>[round(cooldown_time/10, 0.1)]</b>"
|
||||
button.maptext = MAPTEXT("<b>[round(cooldown_time/10, 0.1)]</b>")
|
||||
UpdateButtonIcon()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
@@ -654,7 +654,7 @@
|
||||
UpdateButtonIcon()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
else
|
||||
button.maptext = "<b>[round(timeleft/10, 0.1)]</b>"
|
||||
button.maptext = MAPTEXT("<b>[round(timeleft/10, 0.1)]</b>")
|
||||
|
||||
/datum/action/cooldown/Grant(mob/M)
|
||||
..()
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
var/tgt_color = extra_classes.Find("italics") ? target.chat_color_darkened : target.chat_color
|
||||
|
||||
// Approximate text height
|
||||
var/complete_text = "<span class='center maptext [extra_classes.Join(" ")]' style='color: [tgt_color]'>[text]</span>"
|
||||
var/complete_text = "<span class='center [extra_classes.Join(" ")]' style='color: [tgt_color]'>[text]</span>"
|
||||
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)
|
||||
|
||||
@@ -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 = "<font color='white'>[(ND.number > 1)? "[ND.number]" : ""]</font>"
|
||||
ND.sample_object.maptext = MAPTEXT("<font color='white'>[(ND.number > 1)? "[ND.number]" : ""]</font>")
|
||||
ND.sample_object.layer = ABOVE_HUD_LAYER
|
||||
ND.sample_object.plane = ABOVE_HUD_PLANE
|
||||
cx++
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
displayed_text = new_val
|
||||
|
||||
if(displayed_text)
|
||||
maptext = "<span class='maptext'><font size = [text_size]>[displayed_text]</font></span>"
|
||||
maptext = MAPTEXT("<font size = [text_size]>[displayed_text]</font>")
|
||||
else
|
||||
maptext = null
|
||||
|
||||
|
||||
@@ -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("<span class='notice'>User breaks down [target] with [src].</span>", \
|
||||
"<span class='notice'>You recycle [target] into [src]. It now has material for <b>[circuits]</b> circuits.</span>")
|
||||
playsound(user, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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, "<span class='notice'>Label set to [maptext].</span>", confidential = TRUE)
|
||||
if(href_list["edit_sound_file"])
|
||||
var/new_file = input(user, "Choose a sound file.", "Sound Emitter") as null|sound
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/blob/blobbernaut/update_health_hud()
|
||||
if(hud_used)
|
||||
hud_used.healths.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#e36600'>[round((health / maxHealth) * 100, 0.5)]%</font></div>"
|
||||
hud_used.healths.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#e36600'>[round((health / maxHealth) * 100, 0.5)]%</font></div>")
|
||||
|
||||
/mob/living/simple_animal/hostile/blob/blobbernaut/AttackingTarget()
|
||||
. = ..()
|
||||
|
||||
@@ -205,14 +205,14 @@ GLOBAL_LIST_EMPTY(blob_nodes)
|
||||
|
||||
/mob/camera/blob/update_health_hud()
|
||||
if(blob_core)
|
||||
hud_used.healths.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#e36600'>[round(blob_core.obj_integrity)]</font></div>"
|
||||
hud_used.healths.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#e36600'>[round(blob_core.obj_integrity)]</font></div>")
|
||||
for(var/mob/living/simple_animal/hostile/blob/blobbernaut/B in blob_mobs)
|
||||
if(B.hud_used && B.hud_used.blobpwrdisplay)
|
||||
B.hud_used.blobpwrdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#82ed00'>[round(blob_core.obj_integrity)]</font></div>"
|
||||
B.hud_used.blobpwrdisplay.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#82ed00'>[round(blob_core.obj_integrity)]</font></div>")
|
||||
|
||||
/mob/camera/blob/proc/add_points(points)
|
||||
blob_points = clamp(blob_points + points, 0, max_blob_points)
|
||||
hud_used.blobpwrdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#82ed00'>[round(blob_points)]</font></div>"
|
||||
hud_used.blobpwrdisplay.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#82ed00'>[round(blob_points)]</font></div>")
|
||||
|
||||
/mob/camera/blob/say(message, bubble_type, list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
|
||||
if (!message)
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
essencecolor = "#9A5ACB" //oh boy you've got a lot of essence
|
||||
else if(!essence)
|
||||
essencecolor = "#1D2953" //oh jeez you're dying
|
||||
hud_used.healths.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='[essencecolor]'>[essence]E</font></div>"
|
||||
hud_used.healths.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='[essencecolor]'>[essence]E</font></div>")
|
||||
|
||||
/mob/living/simple_animal/revenant/med_hud_set_health()
|
||||
return //we use no hud
|
||||
|
||||
@@ -839,7 +839,7 @@
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
return
|
||||
|
||||
button.maptext = "<b>[COOLDOWN_TIMELEFT(src, usable_cooldown) * 0.1]</b>"
|
||||
button.maptext = MAPTEXT("<b>[COOLDOWN_TIMELEFT(src, usable_cooldown) * 0.1]</b>")
|
||||
|
||||
/**
|
||||
* Clears the currently mimic'd skillchip, if any exists.
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
var/strength = round(rad_places[i] / 1000, 0.1)
|
||||
var/image/pic = image(loc = place)
|
||||
var/mutable_appearance/MA = new()
|
||||
MA.maptext = "<span class='maptext'>[strength]k</span>"
|
||||
MA.maptext = MAPTEXT("[strength]k")
|
||||
MA.color = "#04e604"
|
||||
MA.layer = RAD_TEXT_LAYER
|
||||
MA.plane = GAME_PLANE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/mob/living/carbon/alien/proc/updatePlasmaDisplay()
|
||||
if(hud_used) //clientless aliens
|
||||
hud_used.alien_plasma_display.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='magenta'>[round(getPlasma())]</font></div>"
|
||||
hud_used.alien_plasma_display.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='magenta'>[round(getPlasma())]</font></div>")
|
||||
|
||||
/mob/living/carbon/alien/larva/updatePlasmaDisplay()
|
||||
return
|
||||
|
||||
@@ -375,7 +375,7 @@
|
||||
if(changeling)
|
||||
changeling.regenerate()
|
||||
hud_used.lingchemdisplay.invisibility = 0
|
||||
hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#dd66dd'>[round(changeling.chem_charges)]</font></div>"
|
||||
hud_used.lingchemdisplay.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#dd66dd'>[round(changeling.chem_charges)]</font></div>")
|
||||
else
|
||||
hud_used.lingchemdisplay.invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
|
||||
resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - summoner.health) / abs(HEALTH_THRESHOLD_DEAD - summoner.maxHealth)) * 100)
|
||||
else
|
||||
resulthealth = round((summoner.health / summoner.maxHealth) * 100, 0.5)
|
||||
hud_used.healths.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#efeeef'>[resulthealth]%</font></div>"
|
||||
hud_used.healths.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#efeeef'>[resulthealth]%</font></div>")
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/adjustHealth(amount, updating_health = TRUE, forced = FALSE) //The spirit is invincible, but passes on damage to the summoner
|
||||
. = amount
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
///Updates the display that shows the mobs nutrition
|
||||
/mob/living/simple_animal/hostile/ooze/proc/updateNutritionDisplay()
|
||||
if(hud_used) //clientless oozes
|
||||
hud_used.alien_plasma_display.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='green'>[round(ooze_nutrition)]</font></div>"
|
||||
hud_used.alien_plasma_display.maptext = MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='green'>[round(ooze_nutrition)]</font></div>")
|
||||
|
||||
|
||||
///* Gelatinious Ooze code below *\\\\
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
maptext_x = 10
|
||||
if(100)
|
||||
maptext_x = 8
|
||||
maptext = "[current_number]" //Finally, apply the maptext
|
||||
maptext = MAPTEXT(current_number) //Finally, apply the maptext
|
||||
|
||||
/obj/machinery/ticket_machine/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
@@ -176,8 +176,8 @@
|
||||
to_chat(user, "<span class='notice'>You take a ticket from [src], looks like you're ticket number #[ticket_number]...</span>")
|
||||
var/obj/item/ticket_machine_ticket/theirticket = new /obj/item/ticket_machine_ticket(get_turf(src))
|
||||
theirticket.name = "Ticket #[ticket_number]"
|
||||
theirticket.maptext = "<font color='#000000'>[ticket_number]</font>"
|
||||
theirticket.saved_maptext = "<font color='#000000'>[ticket_number]</font>"
|
||||
theirticket.maptext = MAPTEXT(ticket_number)
|
||||
theirticket.saved_maptext = MAPTEXT(ticket_number)
|
||||
theirticket.ticket_number = ticket_number
|
||||
theirticket.source = src
|
||||
theirticket.owner = user
|
||||
|
||||
@@ -454,7 +454,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
|
||||
return
|
||||
|
||||
var/image/restraints_icon = image(icon = 'icons/obj/items_and_weapons.dmi', icon_state = "cuff")
|
||||
restraints_icon.maptext = "<span class='maptext' [amount >= CABLE_RESTRAINTS_COST ? "" : "style='color: red'"]>[CABLE_RESTRAINTS_COST]</span>"
|
||||
restraints_icon.maptext = MAPTEXT("<span [amount >= CABLE_RESTRAINTS_COST ? "" : "style='color: red'"]>[CABLE_RESTRAINTS_COST]</span>")
|
||||
|
||||
var/list/radial_menu = list(
|
||||
"Layer 1" = image(icon = 'icons/hud/radial.dmi', icon_state = "coil-red"),
|
||||
|
||||
Reference in New Issue
Block a user