diff --git a/baystation12.dme b/baystation12.dme index 93a4de538a2..1777892fd59 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -199,6 +199,7 @@ #include "code\_onclick\hud\gun_mode.dm" #include "code\_onclick\hud\hud.dm" #include "code\_onclick\hud\human.dm" +#include "code\_onclick\hud\maptext.dm" #include "code\_onclick\hud\metroid.dm" #include "code\_onclick\hud\movable_screen_objects.dm" #include "code\_onclick\hud\radial.dm" diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 0ed29e3a631..e934af1598d 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -45,6 +45,8 @@ /// List of all buttons that never exit the view var/list/obj/screen/always_visible_inventory + var/obj/screen/maptext/maptext + /datum/hud/New(mob/owner) mymob = owner instantiate() @@ -63,6 +65,10 @@ always_visible_inventory = null mymob = null + if(maptext) + qdel(maptext) + maptext = null + /datum/hud/proc/hidden_inventory_update() if(!mymob) return if(ishuman(mymob)) @@ -190,6 +196,9 @@ if(hud_version > HUD_STYLE_TOTAL) hud_version = HUD_STYLE_STANDART + maptext = new(src) + mymob.client.screen += maptext + switch(hud_version) if(HUD_STYLE_STANDART) hud_shown = TRUE diff --git a/code/_onclick/hud/maptext.dm b/code/_onclick/hud/maptext.dm new file mode 100644 index 00000000000..b759a07f4d6 --- /dev/null +++ b/code/_onclick/hud/maptext.dm @@ -0,0 +1,26 @@ +/obj/screen/maptext + screen_loc = "NORTH:14,WEST" + plane = HUD_PLANE + layer = HUD_BASE_LAYER + maptext_height = 32 + maptext_width = 480 + var/last_word = null + +/client/MouseEntered(object, location) + ..() + if(get_preference_value(/datum/client_preference/maptext) == GLOB.PREF_NO) + return + if(istype(object, /atom) && !istype(object, /obj/screen/splash)) + var/atom/A = object + if(mob.hud_used) + var/obj_name = A.name + if(mob.hud_used.maptext.last_word == obj_name) + return + obj_name = uppertext(obj_name) + if(mob.mind.special_role == "Changeling") + mob.hud_used.maptext.maptext = "[obj_name]" + else if(mob.mind.assigned_role == "Clown") + mob.hud_used.maptext.maptext = "[obj_name]" + else + mob.hud_used.maptext.maptext = "[obj_name]" + mob.hud_used.maptext.last_word = obj_name diff --git a/code/modules/client/preference_setup/global/preferences.dm b/code/modules/client/preference_setup/global/preferences.dm index 6cac90e7c22..4516af7dc0d 100644 --- a/code/modules/client/preference_setup/global/preferences.dm +++ b/code/modules/client/preference_setup/global/preferences.dm @@ -102,6 +102,12 @@ var/global/list/_client_preferences_by_type options = list(GLOB.PREF_YES, GLOB.PREF_NO, GLOB.PREF_AS_GHOST, GLOB.PREF_AS_LIVING) default_value = GLOB.PREF_YES +/datum/client_preference/maptext + description = "Show Maptext" + key = "SHOW_TMAPTEXT" + options = list(GLOB.PREF_YES, GLOB.PREF_NO) + default_value = GLOB.PREF_NO + /datum/client_preference/runechat description = "Show Runechat (Above-Head-Speech)" key = "CHAT_RUNECHAT"