mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
[MIRROR] Hovering your mouse over things now shows their name on the top of the screen (#3446)
* Hovering your mouse over things now shows their name on the top of the screen (#56729) Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Hovering your mouse over things now shows their name on the top of the screen * a * Update preferences_savefile.dm Co-authored-by: Qustinnus <Floydje123@hotmail.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
@@ -35,6 +35,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
#define OVERLAY_QUEUED_1 (1<<8)
|
||||
/// item has priority to check when entering or leaving
|
||||
#define ON_BORDER_1 (1<<9)
|
||||
///Whether or not this atom shows screentips when hovered over
|
||||
#define NO_SCREENTIPS_1 (1 << 10)
|
||||
/// Prevent clicking things below it on the same turf eg. doors/ fulltile windows
|
||||
#define PREVENT_CLICK_UNDER_1 (1<<11)
|
||||
#define HOLOGRAM_1 (1<<12)
|
||||
|
||||
@@ -86,6 +86,12 @@
|
||||
#define EXP_TYPE_GHOST "Ghost"
|
||||
#define EXP_TYPE_ADMIN "Admin"
|
||||
|
||||
///Screentip settings
|
||||
#define SCREENTIP_OFF 0
|
||||
#define SCREENTIP_SMALL 1
|
||||
#define SCREENTIP_MEDIUM 1
|
||||
#define SCREENTIP_BIG 1
|
||||
|
||||
//Flags in the players table in the db
|
||||
#define DB_FLAG_EXEMPT 1
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
|
||||
var/list/atom/movable/plane_master_controller/plane_master_controllers = list()
|
||||
|
||||
|
||||
///UI for screentips that appear when you mouse over things
|
||||
var/atom/movable/screen/screentip/screentip_text
|
||||
|
||||
var/atom/movable/screen/movable/action_button/hide_toggle/hide_actions_toggle
|
||||
var/action_buttons_hidden = FALSE
|
||||
|
||||
@@ -85,6 +88,9 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
|
||||
plane_masters["[instance.plane]"] = instance
|
||||
instance.backdrop(mymob)
|
||||
|
||||
screentip_text = new(null, src)
|
||||
static_inventory += screentip_text
|
||||
|
||||
for(var/mytype in subtypesof(/atom/movable/plane_master_controller))
|
||||
var/atom/movable/plane_master_controller/controller_instance = new mytype(src)
|
||||
plane_master_controllers[controller_instance.name] = controller_instance
|
||||
@@ -126,6 +132,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
|
||||
QDEL_LIST(screenoverlays)
|
||||
mymob = null
|
||||
|
||||
QDEL_NULL(screentip_text)
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/proc/create_mob_hud()
|
||||
|
||||
21
code/_onclick/hud/screentip.dm
Normal file
21
code/_onclick/hud/screentip.dm
Normal file
@@ -0,0 +1,21 @@
|
||||
/atom/movable/screen/screentip
|
||||
icon = null
|
||||
icon_state = null
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
screen_loc = "TOP,LEFT"
|
||||
maptext_height = 480
|
||||
maptext_width = 480
|
||||
maptext = ""
|
||||
|
||||
/atom/movable/screen/screentip/Initialize(mapload, _hud)
|
||||
. = ..()
|
||||
hud = _hud
|
||||
update_view()
|
||||
|
||||
/atom/movable/screen/screentip/proc/update_view(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
if(!hud || !hud.mymob.client.view_size) //Might not have been initialized by now
|
||||
return
|
||||
maptext_width = getviewsize(hud.mymob.client.view_size.getView())[1] * world.icon_size
|
||||
|
||||
|
||||
@@ -1890,3 +1890,11 @@
|
||||
animate(visual, pixel_x = (tile.x - our_tile.x) * world.icon_size + A.pixel_x, pixel_y = (tile.y - our_tile.y) * world.icon_size + A.pixel_y, time = 1.7, easing = EASE_OUT)
|
||||
|
||||
return TRUE
|
||||
|
||||
//Update the screentip to reflect what we're hoverin over
|
||||
/atom/MouseEntered(location, control, params)
|
||||
. = ..()
|
||||
if(flags_1 & NO_SCREENTIPS_1 || !usr?.client?.prefs.screentip_pref)
|
||||
usr.hud_used.screentip_text.maptext = ""
|
||||
return
|
||||
usr.hud_used.screentip_text.maptext = MAPTEXT("<span style='text-align: center'><span style='font-size: 32px'><span style='color:[usr.client.prefs.screentip_color]: 32px'>[name]</span>")
|
||||
|
||||
@@ -824,6 +824,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
|
||||
openToolTip(user,src,params,title = name,content = "[desc]<br><b>Force:</b> [force_string]",theme = "")
|
||||
|
||||
/obj/item/MouseEntered(location, control, params)
|
||||
. = ..()
|
||||
if((item_flags & IN_INVENTORY || item_flags & IN_STORAGE) && usr.client.prefs.enable_tips && !QDELETED(src))
|
||||
var/timedelay = usr.client.prefs.tip_delay/100
|
||||
var/user = usr
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
barefootstep = FOOTSTEP_HARD_BAREFOOT
|
||||
clawfootstep = FOOTSTEP_HARD_CLAW
|
||||
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
|
||||
flags_1 = CAN_BE_DIRTY_1 | NO_SCREENTIPS_1
|
||||
|
||||
smoothing_groups = list(SMOOTH_GROUP_TURF_OPEN, SMOOTH_GROUP_OPEN_FLOOR)
|
||||
canSmoothWith = list(SMOOTH_GROUP_OPEN_FLOOR, SMOOTH_GROUP_TURF_OPEN)
|
||||
|
||||
@@ -21,7 +21,7 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr
|
||||
CanAtmosPassVertical = ATMOS_PASS_YES
|
||||
baseturfs = /turf/open/openspace
|
||||
intact = FALSE //this means wires go on top
|
||||
//mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
var/can_cover_up = TRUE
|
||||
var/can_build_on = TRUE
|
||||
|
||||
|
||||
@@ -1002,6 +1002,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
CRASH("change_view called without argument.")
|
||||
|
||||
view = new_size
|
||||
mob.hud_used.screentip_text.update_view()
|
||||
apply_clickcatcher()
|
||||
mob.reload_fullscreen()
|
||||
if (isliving(mob))
|
||||
|
||||
@@ -110,6 +110,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
var/parallax
|
||||
|
||||
///Do we show screentips, if so, how big?
|
||||
var/screentip_pref = TRUE
|
||||
///Color of screentips at top of screen
|
||||
var/screentip_color = "#ffd391"
|
||||
|
||||
var/ambientocclusion = TRUE
|
||||
///Should we automatically fit the viewport?
|
||||
var/auto_fit_viewport = FALSE
|
||||
@@ -637,6 +642,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "High"
|
||||
dat += "</a><br>"
|
||||
|
||||
dat += "<b>Set screentip mode:</b> <a href='?_src_=prefs;preference=screentipmode'>[screentip_pref ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>Screentip color:</b><span style='border: 1px solid #161616; background-color: [screentip_color];'> </span> <a href='?_src_=prefs;preference=screentipcolor'>Change</a><BR>"
|
||||
|
||||
|
||||
dat += "<b>Ambient Occlusion:</b> <a href='?_src_=prefs;preference=ambientocclusion'>[ambientocclusion ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>Fit Viewport:</b> <a href='?_src_=prefs;preference=auto_fit_viewport'>[auto_fit_viewport ? "Auto" : "Manual"]</a><br>"
|
||||
if (CONFIG_GET(string/default_view) != CONFIG_GET(string/default_view_square))
|
||||
@@ -1828,6 +1837,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if (parent && parent.mob && parent.mob.hud_used)
|
||||
parent.mob.hud_used.update_parallax_pref(parent.mob)
|
||||
|
||||
if("screentipmode")
|
||||
screentip_pref = !screentip_pref
|
||||
|
||||
if("screentipcolor")
|
||||
var/new_screentipcolor = input(user, "Choose your screentip color:", "Character Preference", screentip_color) as color|null
|
||||
if(new_screentipcolor)
|
||||
screentip_color = sanitize_ooccolor(new_screentipcolor)
|
||||
|
||||
if("ambientocclusion")
|
||||
ambientocclusion = !ambientocclusion
|
||||
if(parent?.screen && parent.screen.len)
|
||||
|
||||
@@ -163,6 +163,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
READ_FILE(S["asaycolor"], asaycolor)
|
||||
READ_FILE(S["brief_outfit"], brief_outfit)
|
||||
READ_FILE(S["ooccolor"], ooccolor)
|
||||
READ_FILE(S["screentip_color"], screentip_color)
|
||||
READ_FILE(S["lastchangelog"], lastchangelog)
|
||||
READ_FILE(S["UI_style"], UI_style)
|
||||
READ_FILE(S["hotkeys"], hotkeys)
|
||||
@@ -194,6 +195,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
READ_FILE(S["clientfps"], clientfps)
|
||||
READ_FILE(S["parallax"], parallax)
|
||||
READ_FILE(S["ambientocclusion"], ambientocclusion)
|
||||
READ_FILE(S["screentip_pref"], screentip_pref)
|
||||
READ_FILE(S["auto_fit_viewport"], auto_fit_viewport)
|
||||
READ_FILE(S["widescreenpref"], widescreenpref)
|
||||
READ_FILE(S["pixel_size"], pixel_size)
|
||||
@@ -225,6 +227,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
//Sanitize
|
||||
asaycolor = sanitize_ooccolor(sanitize_hexcolor(asaycolor, 6, 1, initial(asaycolor)))
|
||||
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
|
||||
screentip_color = sanitize_ooccolor(sanitize_hexcolor(screentip_color, 6, 1, initial(screentip_color)))
|
||||
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
|
||||
UI_style = sanitize_inlist(UI_style, GLOB.available_ui_styles, GLOB.available_ui_styles[1])
|
||||
hotkeys = sanitize_integer(hotkeys, FALSE, TRUE, initial(hotkeys))
|
||||
@@ -241,8 +244,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
toggles = sanitize_integer(toggles, 0, (2**24)-1, initial(toggles))
|
||||
clientfps = sanitize_integer(clientfps, -1, 1000, 0)
|
||||
parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null)
|
||||
ambientocclusion = sanitize_integer(ambientocclusion, FALSE, TRUE, initial(ambientocclusion))
|
||||
auto_fit_viewport = sanitize_integer(auto_fit_viewport, FALSE, TRUE, initial(auto_fit_viewport))
|
||||
ambientocclusion = sanitize_integer(ambientocclusion, FALSE, TRUE, initial(ambientocclusion))
|
||||
screentip_pref = sanitize_integer(screentip_pref, FALSE, TRUE, initial(screentip_pref))
|
||||
auto_fit_viewport = sanitize_integer(auto_fit_viewport, FALSE, TRUE, initial(auto_fit_viewport))
|
||||
widescreenpref = sanitize_integer(widescreenpref, FALSE, TRUE, initial(widescreenpref))
|
||||
pixel_size = sanitize_float(pixel_size, PIXEL_SCALING_AUTO, PIXEL_SCALING_3X, 0.5, initial(pixel_size))
|
||||
scaling_method = sanitize_text(scaling_method, initial(scaling_method))
|
||||
@@ -291,6 +295,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["asaycolor"], asaycolor)
|
||||
WRITE_FILE(S["brief_outfit"], brief_outfit)
|
||||
WRITE_FILE(S["ooccolor"], ooccolor)
|
||||
WRITE_FILE(S["screentip_color"], screentip_color)
|
||||
WRITE_FILE(S["lastchangelog"], lastchangelog)
|
||||
WRITE_FILE(S["UI_style"], UI_style)
|
||||
WRITE_FILE(S["hotkeys"], hotkeys)
|
||||
@@ -319,6 +324,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["clientfps"], clientfps)
|
||||
WRITE_FILE(S["parallax"], parallax)
|
||||
WRITE_FILE(S["ambientocclusion"], ambientocclusion)
|
||||
WRITE_FILE(S["screentip_pref"], screentip_pref)
|
||||
WRITE_FILE(S["auto_fit_viewport"], auto_fit_viewport)
|
||||
WRITE_FILE(S["widescreenpref"], widescreenpref)
|
||||
WRITE_FILE(S["pixel_size"], pixel_size)
|
||||
|
||||
@@ -136,6 +136,11 @@ GLOBAL_LIST_INIT(food, list(
|
||||
|
||||
var/parallax
|
||||
|
||||
///Do we show screentips, if so, how big?
|
||||
var/screentip_pref = TRUE
|
||||
///Color of screentips at top of screen
|
||||
var/screentip_color = "#ffd391"
|
||||
|
||||
var/ambientocclusion = TRUE
|
||||
///Should we automatically fit the viewport?
|
||||
var/auto_fit_viewport = FALSE
|
||||
@@ -1006,6 +1011,9 @@ GLOBAL_LIST_INIT(food, list(
|
||||
dat += "High"
|
||||
dat += "</a><br>"
|
||||
|
||||
dat += "<b>Set screentip mode:</b> <a href='?_src_=prefs;preference=screentipmode'>[screentip_pref ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>Screentip color:</b><span style='border: 1px solid #161616; background-color: [screentip_color];'> </span> <a href='?_src_=prefs;preference=screentipcolor'>Change</a><BR>"
|
||||
|
||||
dat += "<b>Ambient Occlusion:</b> <a href='?_src_=prefs;preference=ambientocclusion'>[ambientocclusion ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>Fit Viewport:</b> <a href='?_src_=prefs;preference=auto_fit_viewport'>[auto_fit_viewport ? "Auto" : "Manual"]</a><br>"
|
||||
if (CONFIG_GET(string/default_view) != CONFIG_GET(string/default_view_square))
|
||||
@@ -2672,6 +2680,14 @@ GLOBAL_LIST_INIT(food, list(
|
||||
if (parent && parent.mob && parent.mob.hud_used)
|
||||
parent.mob.hud_used.update_parallax_pref(parent.mob)
|
||||
|
||||
if("screentipmode")
|
||||
screentip_pref = !screentip_pref
|
||||
|
||||
if("screentipcolor")
|
||||
var/new_screentipcolor = input(user, "Choose your screentip color:", "Character Preference", screentip_color) as color|null
|
||||
if(new_screentipcolor)
|
||||
screentip_color = sanitize_ooccolor(new_screentipcolor)
|
||||
|
||||
if("ambientocclusion")
|
||||
ambientocclusion = !ambientocclusion
|
||||
if(parent && parent.screen && parent.screen.len)
|
||||
|
||||
@@ -147,6 +147,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
//general preferences
|
||||
READ_FILE(S["asaycolor"], asaycolor)
|
||||
READ_FILE(S["ooccolor"], ooccolor)
|
||||
READ_FILE(S["screentip_color"], screentip_color)
|
||||
READ_FILE(S["lastchangelog"], lastchangelog)
|
||||
READ_FILE(S["UI_style"], UI_style)
|
||||
READ_FILE(S["hotkeys"], hotkeys)
|
||||
@@ -179,6 +180,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
READ_FILE(S["clientfps"], clientfps)
|
||||
READ_FILE(S["parallax"], parallax)
|
||||
READ_FILE(S["ambientocclusion"], ambientocclusion)
|
||||
READ_FILE(S["screentip_pref"], screentip_pref)
|
||||
READ_FILE(S["auto_fit_viewport"], auto_fit_viewport)
|
||||
READ_FILE(S["widescreenpref"], widescreenpref)
|
||||
READ_FILE(S["pixel_size"], pixel_size)
|
||||
@@ -204,6 +206,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
//Sanitize
|
||||
asaycolor = sanitize_ooccolor(sanitize_hexcolor(asaycolor, 6, 1, initial(asaycolor)))
|
||||
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
|
||||
screentip_color = sanitize_ooccolor(sanitize_hexcolor(screentip_color, 6, 1, initial(screentip_color)))
|
||||
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
|
||||
UI_style = sanitize_inlist(UI_style, GLOB.available_ui_styles, GLOB.available_ui_styles[1])
|
||||
hotkeys = sanitize_integer(hotkeys, FALSE, TRUE, initial(hotkeys))
|
||||
@@ -221,6 +224,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
skyrat_toggles = sanitize_integer(skyrat_toggles, 0, (2**24)-1, initial(skyrat_toggles)) //SKYRAT EDIT
|
||||
clientfps = sanitize_integer(clientfps, 0, 1000, 40)
|
||||
parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null)
|
||||
screentip_pref = sanitize_integer(screentip_pref, FALSE, TRUE, initial(screentip_pref))
|
||||
ambientocclusion = sanitize_integer(ambientocclusion, FALSE, TRUE, initial(ambientocclusion))
|
||||
auto_fit_viewport = sanitize_integer(auto_fit_viewport, FALSE, TRUE, initial(auto_fit_viewport))
|
||||
widescreenpref = sanitize_integer(widescreenpref, FALSE, TRUE, initial(widescreenpref))
|
||||
@@ -252,6 +256,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
//general preferences
|
||||
WRITE_FILE(S["asaycolor"], asaycolor)
|
||||
WRITE_FILE(S["ooccolor"], ooccolor)
|
||||
WRITE_FILE(S["screentip_color"], screentip_color)
|
||||
WRITE_FILE(S["lastchangelog"], lastchangelog)
|
||||
WRITE_FILE(S["UI_style"], UI_style)
|
||||
WRITE_FILE(S["hotkeys"], hotkeys)
|
||||
@@ -281,6 +286,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["clientfps"], clientfps)
|
||||
WRITE_FILE(S["parallax"], parallax)
|
||||
WRITE_FILE(S["ambientocclusion"], ambientocclusion)
|
||||
WRITE_FILE(S["screentip_pref"], screentip_pref)
|
||||
WRITE_FILE(S["auto_fit_viewport"], auto_fit_viewport)
|
||||
WRITE_FILE(S["widescreenpref"], widescreenpref)
|
||||
WRITE_FILE(S["pixel_size"], pixel_size)
|
||||
|
||||
@@ -285,6 +285,7 @@
|
||||
#include "code\_onclick\hud\revenanthud.dm"
|
||||
#include "code\_onclick\hud\robot.dm"
|
||||
#include "code\_onclick\hud\screen_objects.dm"
|
||||
#include "code\_onclick\hud\screentip.dm"
|
||||
#include "code\_onclick\hud\swarmer.dm"
|
||||
#include "code\controllers\admin.dm"
|
||||
#include "code\controllers\controller.dm"
|
||||
|
||||
Reference in New Issue
Block a user