diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 603d01b011..4165b1cec3 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -536,9 +536,6 @@ GLOBAL_LIST_INIT(pda_reskins, list( #define FALL_NO_MESSAGE (1<<1) //Used to suppress the "[A] falls through [old_turf]" messages where it'd make little sense at all, like going downstairs. #define FALL_STOP_INTERCEPTING (1<<2) //Used in situations where halting the whole "intercept" loop would be better, like supermatter dusting (and thus deleting) the atom. -//Misc text define. Does 4 spaces. Used as a makeshift tabulator. -#define FOURSPACES "    " - #define CRYOMOBS 'icons/obj/cryo_mobs.dmi' #define CUSTOM_HOLOFORM_DELAY 10 SECONDS //prevents spamming to make lag. it's pretty expensive to do this. diff --git a/code/__DEFINES/text.dm b/code/__DEFINES/text.dm index 58c24747e0..bf60d6e725 100644 --- a/code/__DEFINES/text.dm +++ b/code/__DEFINES/text.dm @@ -1,5 +1,50 @@ +/// Does 4 spaces. Used as a makeshift tabulator. +#define FOURSPACES "    " + +/// Standard maptext /// Prepares a text to be used for maptext. Use this so it doesn't look hideous. #define MAPTEXT(text) {"[##text]"} -/// Macro from Lummox used to get height from a MeasureText proc -#define WXH_TO_HEIGHT(x) text2num(copytext(x, findtextEx(x, "x") + 1)) +/** + * 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("Some large maptext here") + */ +/// Large size (ie: context tooltips) - Size options: 12pt 24pt. +#define MAPTEXT_PIXELLARI(text) {"[##text]"} + +/// Standard size (ie: normal runechat) - Size options: 6pt 12pt 18pt. +#define MAPTEXT_GRAND9K(text) {"[##text]"} + +/// Small size. (ie: context subtooltips, spell delays) - Size options: 12pt 24pt. +#define MAPTEXT_TINY_UNICODE(text) {"[##text]"} + +/// Smallest size. (ie: whisper runechat) - Size options: 6pt 12pt 18pt. +#define MAPTEXT_SPESSFONT(text) {"[##text]"} + +/** + * 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("Some large maptext here") + */ +/// 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) {"[##text]"} + +/// Macro from Lummox used to get height from a MeasureText proc. +/// resolves the MeasureText() return value once, then resolves the height, then sets return_var to that. +#define WXH_TO_HEIGHT(measurement, return_var) \ + do { \ + var/_measurement = measurement; \ + return_var = text2num(copytext(_measurement, findtextEx(_measurement, "x") + 1)); \ + } while(FALSE); diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 579126257f..2ccd9deaf2 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -992,7 +992,7 @@ world letter = lowertext(letter) var/image/text_image = new(loc = A) - text_image.maptext = MAPTEXT("[letter]") + text_image.maptext = MAPTEXT("[letter]") text_image.pixel_x = 7 text_image.pixel_y = 5 qdel(atom_icon) diff --git a/code/__HELPERS/yelling.dm b/code/__HELPERS/yelling.dm index 4383a245d4..25ec9580a1 100644 --- a/code/__HELPERS/yelling.dm +++ b/code/__HELPERS/yelling.dm @@ -30,7 +30,7 @@ #define RUN_YELL(_T, _P, _D) \ returned = max(_P - max(_T.get_yelling_resistance(_P), 0) - 1, 0); \ processed[_T] = returned; - // _T.maptext = "[returned]"; + // _T.maptext = MAPTEXT(returned); var/list/turf/edges_next var/list/turf/powers_next diff --git a/code/_onclick/hud/credits.dm b/code/_onclick/hud/credits.dm index aaf423ecbc..3d6bbdc277 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 = 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 diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 9547ee6f86..96260f75a2 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -44,7 +44,7 @@ /atom/movable/screen/devil/soul_counter/proc/update_counter(souls = 0) invisibility = 0 - maptext = "
[souls]
" + maptext = MAPTEXT("
[souls]
") switch(souls) if(0,null) icon_state = "Devil-1" @@ -103,7 +103,7 @@ ..() var/valuecolor = "#ff2525" if(owner.stat == DEAD) - maptext = "
ERR-0F
" + maptext = MAPTEXT("
ERR-0F
") icon_state = "coolant-3-1" return var/coolant_efficiency @@ -123,7 +123,7 @@ valuecolor = "#dd8109" else if(coolant > BLOOD_VOLUME_SURVIVE * owner.blood_ratio) valuecolor = "#e7520d" - maptext = "
[round((coolant / (BLOOD_VOLUME_NORMAL * owner.blood_ratio)) * 100, 1)]
" + maptext = MAPTEXT("
[round((coolant / (BLOOD_VOLUME_NORMAL * owner.blood_ratio)) * 100, 1)]
") var/efficiency_suffix var/state_suffix diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index eeb56d67f5..a00687e263 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 @@ -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 diff --git a/code/datums/action.dm b/code/datums/action.dm index b34cafc03f..2d6af6c2de 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -727,7 +727,7 @@ /datum/action/cooldown/proc/StartCooldown() next_use_time = world.time + cooldown_time - button.maptext = "[round(cooldown_time/10, 0.1)]" + button.maptext = MAPTEXT_TINY_UNICODE("[round(cooldown_time/10, 0.1)]") UpdateButtonIcon() START_PROCESSING(SSfastprocess, src) @@ -741,7 +741,7 @@ UpdateButtonIcon() STOP_PROCESSING(SSfastprocess, src) else - button.maptext = "[round(timeleft/10, 0.1)]" + button.maptext = MAPTEXT_TINY_UNICODE("[round(cooldown_time/10, 0.1)]") /datum/action/cooldown/Grant(mob/M) ..() diff --git a/code/datums/chatmessage.dm b/code/datums/chatmessage.dm index 6aadd72a8a..de0e24a69f 100644 --- a/code/datums/chatmessage.dm +++ b/code/datums/chatmessage.dm @@ -130,7 +130,9 @@ var/tgt_color = extra_classes.Find("italics") ? target.chat_color_darkened : target.chat_color var/complete_text = "[owner.say_emphasis(text)]" - var/mheight = WXH_TO_HEIGHT(owned_by.MeasureText(complete_text, null, CHAT_MESSAGE_WIDTH)) + + var/mheight + WXH_TO_HEIGHT(owned_by.MeasureText(complete_text, null, CHAT_MESSAGE_WIDTH), mheight) approx_lines = max(1, mheight / CHAT_MESSAGE_APPROX_LHEIGHT) // Translate any existing messages upwards, apply exponential decay factors to timers diff --git a/code/datums/components/storage/ui.dm b/code/datums/components/storage/ui.dm index d41d82ae75..4d61d569c3 100644 --- a/code/datums/components/storage/ui.dm +++ b/code/datums/components/storage/ui.dm @@ -48,7 +48,7 @@ var/datum/numbered_display/ND = numbered_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 . += ND.sample_object diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index ec0d35b5a3..dabfcea52c 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -436,13 +436,13 @@ GLOBAL_LIST_EMPTY(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/game/objects/effects/countdown.dm b/code/game/objects/effects/countdown.dm index 0722f3bd18..2aaa99f7aa 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 9c06c92108..5ed2cbd481 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(mapload) . = ..() - 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 e2dc7b0f91..579f9e888d 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -86,7 +86,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/game/turfs/turf.dm b/code/game/turfs/turf.dm index 826132e860..85fbbc5c77 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -480,7 +480,7 @@ GLOBAL_LIST_EMPTY(station_turfs) A = i if(!QDELETED(A) && A.level >= affecting_level) . = A.wave_explode(., explosion, dir) - maptext = "[.]" + maptext = MAPTEXT("[.]") /turf/narsie_act(force, ignore_mobs, probability = 20) . = (prob(probability) || force) diff --git a/code/modules/admin/sound_emitter.dm b/code/modules/admin/sound_emitter.dm index ad9c995aa1..388a8e42af 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 0dfee4c38c..532a361ba0 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/blobs/blob_mobs.dm b/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm index 1c98060d9b..55a44b70de 100644 --- a/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm +++ b/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm @@ -275,7 +275,7 @@ /mob/living/simple_animal/hostile/blob/blobbernaut/update_health_hud() if(hud_used) - hud_used.healths.maptext = "
[round((health / maxHealth) * 100, 0.5)]%
" + hud_used.healths.maptext = MAPTEXT("
[round((health / maxHealth) * 100, 0.5)]%
") /mob/living/simple_animal/hostile/blob/blobbernaut/AttackingTarget() . = ..() diff --git a/code/modules/antagonists/blob/blob/overmind.dm b/code/modules/antagonists/blob/blob/overmind.dm index 5515c67e6b..ec95d32fd4 100644 --- a/code/modules/antagonists/blob/blob/overmind.dm +++ b/code/modules/antagonists/blob/blob/overmind.dm @@ -197,14 +197,14 @@ GLOBAL_LIST_EMPTY(blob_nodes) /mob/camera/blob/update_health_hud() if(blob_core) - hud_used.healths.maptext = "
[round(blob_core.obj_integrity)]
" + hud_used.healths.maptext = MAPTEXT("
[round(blob_core.obj_integrity)]
") 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 = "
[round(blob_core.obj_integrity)]
" + B.hud_used.blobpwrdisplay.maptext = MAPTEXT("
[round(blob_core.obj_integrity)]
") /mob/camera/blob/proc/add_points(points) blob_points = clamp(blob_points + points, 0, max_blob_points) - hud_used.blobpwrdisplay.maptext = "
[round(blob_points)]
" + hud_used.blobpwrdisplay.maptext = MAPTEXT("
[round(blob_points)]
") /mob/camera/blob/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null) if (!message) diff --git a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm index 07c92bfd97..73625c894d 100644 --- a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm +++ b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm @@ -725,7 +725,7 @@ /atom/movable/screen/bloodsucker/blood_counter/update_counter(value, valuecolor) ..() - maptext = "
[round(value,1)]
" + maptext = MAPTEXT("
[round(value,1)]
") /atom/movable/screen/bloodsucker/rank_counter name = "Bloodsucker Rank" @@ -735,7 +735,7 @@ /atom/movable/screen/bloodsucker/rank_counter/update_counter(value, valuecolor) ..() - maptext = "
[round(value,1)]
" + maptext = MAPTEXT("
[round(value,1)]
") /atom/movable/screen/bloodsucker/sunlight_counter icon = 'icons/mob/actions/bloodsucker.dmi' @@ -763,7 +763,7 @@ /atom/movable/screen/bloodsucker/sunlight_counter/update_counter(value, valuecolor) ..() - maptext = "
[value]
" + maptext = MAPTEXT("
[value]
") /datum/antagonist/bloodsucker/proc/count_vassals(datum/mind/master) var/datum/antagonist/bloodsucker/B = master.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) diff --git a/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm b/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm index c937b27f16..b3365e6e70 100644 --- a/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm +++ b/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm @@ -180,8 +180,8 @@ resulthealth = "[round((host.health / host.maxHealth) * 100, 0.5)]%" else resulthealth = "NONE" - G.hosthealth.maptext = "
HOST
[resulthealth]
" - hud_used.healths.maptext = "
[round((health / maxHealth) * 100, 0.5)]%" + G.hosthealth.maptext = MAPTEXT("
HOST
[resulthealth]
") + hud_used.healths.maptext = MAPTEXT("
[round((health / maxHealth) * 100, 0.5)]%") /mob/living/simple_animal/hostile/clockwork/guardian/proc/update_stats() if(GLOB.ratvar_awakens) diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index f05321487f..41fc16c922 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -150,7 +150,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 = "
[essence]E
" + hud_used.healths.maptext = MAPTEXT("
[essence]E
") /mob/living/simple_animal/revenant/med_hud_set_health() return //we use no hud diff --git a/code/modules/balloon_alert/balloon_alert.dm b/code/modules/balloon_alert/balloon_alert.dm index c273722607..f529768b1d 100644 --- a/code/modules/balloon_alert/balloon_alert.dm +++ b/code/modules/balloon_alert/balloon_alert.dm @@ -48,7 +48,7 @@ balloon_alert.appearance_flags = RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM balloon_alert.maptext = MAPTEXT("[text]") balloon_alert.maptext_x = (BALLOON_TEXT_WIDTH - bound_width) * -0.5 - balloon_alert.maptext_height = WXH_TO_HEIGHT(viewer_client?.MeasureText(text, null, BALLOON_TEXT_WIDTH)) + WXH_TO_HEIGHT(viewer_client?.MeasureText(text, null, BALLOON_TEXT_WIDTH), balloon_alert.maptext_height) balloon_alert.maptext_width = BALLOON_TEXT_WIDTH viewer_client?.images += balloon_alert diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm index 461648c270..013084e38f 100644 --- a/code/modules/clothing/glasses/engine_goggles.dm +++ b/code/modules/clothing/glasses/engine_goggles.dm @@ -99,7 +99,7 @@ var/strength = round(rad_places[i] / 1000, 0.1) var/image/pic = image(loc = place) var/mutable_appearance/MA = new() - MA.maptext = "[strength]k" + MA.maptext = MAPTEXT("[strength]k") MA.color = "#04e604" MA.layer = RAD_TEXT_LAYER MA.plane = GAME_PLANE diff --git a/code/modules/mob/living/carbon/alien/screen.dm b/code/modules/mob/living/carbon/alien/screen.dm index 4d90fd4b32..1f8902a584 100644 --- a/code/modules/mob/living/carbon/alien/screen.dm +++ b/code/modules/mob/living/carbon/alien/screen.dm @@ -1,7 +1,7 @@ /mob/living/carbon/alien/proc/updatePlasmaDisplay() if(hud_used) //clientless aliens - hud_used.alien_plasma_display.maptext = "
[round(getPlasma())]
" + hud_used.alien_plasma_display.maptext = MAPTEXT("
[round(getPlasma())]
") /mob/living/carbon/alien/larva/updatePlasmaDisplay() return diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index 6faf8f0db5..4c8872ffbf 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -257,7 +257,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 = "
[resulthealth]%
" + hud_used.healths.maptext = MAPTEXT("
[resulthealth]%
") /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 diff --git a/code/modules/paperwork/ticketmachine.dm b/code/modules/paperwork/ticketmachine.dm index 9683601670..6022853fad 100644 --- a/code/modules/paperwork/ticketmachine.dm +++ b/code/modules/paperwork/ticketmachine.dm @@ -142,7 +142,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) ..() @@ -182,11 +182,7 @@ playsound(src, 'sound/machines/terminal_insert_disc.ogg', 100, FALSE) ticket_number ++ to_chat(user, "You take a ticket from [src], looks like you're ticket number #[ticket_number]...") - var/obj/item/ticket_machine_ticket/theirticket = new /obj/item/ticket_machine_ticket(get_turf(src)) - theirticket.name = "Ticket #[ticket_number]" - theirticket.maptext = "[ticket_number]" - theirticket.saved_maptext = "[ticket_number]" - theirticket.ticket_number = ticket_number + var/obj/item/ticket_machine_ticket/theirticket = new /obj/item/ticket_machine_ticket(get_turf(src), ticket_number) theirticket.source = src theirticket.owner = user user.put_in_hands(theirticket) @@ -211,10 +207,25 @@ w_class = WEIGHT_CLASS_TINY resistance_flags = FLAMMABLE max_integrity = 50 + var/number var/saved_maptext = null var/mob/living/carbon/owner var/obj/machinery/ticket_machine/source - var/ticket_number + +/obj/item/ticket_machine_ticket/Initialize(mapload, num) + . = ..() + number = num + if(!isnull(num)) + name += " #[num]" + saved_maptext = MAPTEXT(num) + maptext = saved_maptext + +/obj/item/ticket_machine_ticket/examine(mob/user) + . = ..() + if(!isnull(number)) + . += span_notice("The ticket reads shimmering text that tells you that you are number [number] in queue.") + if(source) + . += span_notice("Below that, you can see that you are [number - source.current_number] spot\s away from being served.") /obj/item/ticket_machine_ticket/attack_hand(mob/user) . = ..() @@ -233,7 +244,7 @@ /obj/item/ticket_machine_ticket/Destroy() if(owner && source) source.ticket_holders -= owner - source.tickets[ticket_number] = null + source.tickets[number] = null owner = null source = null return ..()