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 = "