Merge branch 'master' into pirate10k

This commit is contained in:
keronshb
2021-10-09 11:58:55 -04:00
5 changed files with 26 additions and 28 deletions
+1 -1
View File
@@ -15,6 +15,6 @@
var/indelay = stripped_input(usr, "Enter the tooltip delay in milliseconds (default: 500)", "Enter tooltip delay", "", 10)
indelay = text2num(indelay)
if(usr)//is this what you mean?
prefs.tip_delay = indelay
prefs.tip_delay = max(indelay, 0.01)
prefs.save_preferences()
to_chat(usr, "<span class='danger'>Tooltip delay set to [indelay] milliseconds.</span>")
@@ -246,15 +246,15 @@
mag_type = /obj/item/ammo_box/magazine/internal/shot/com
w_class = WEIGHT_CLASS_NORMAL
var/stock = FALSE
var/extend_sound = 'sound/weapons/batonextend.ogg'
recoil = 5
spread = 2
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)) || item_flags && IN_STORAGE)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)) || item_flags & IN_STORAGE)
return
toggle_stock(user)
return TRUE
. = ..()
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/examine(mob/user)
. = ..()
@@ -272,6 +272,7 @@
to_chat(user, "You fold the stock.")
recoil = 5
spread = 2
playsound(src.loc, extend_sound, 50, 1)
update_icon()
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/update_icon_state()
+14 -6
View File
@@ -119,15 +119,18 @@ Notes:
//Includes sanity checks.
/proc/closeToolTip(mob/user)
if(istype(user))
if(user.client && user.client.tooltips)
user.client.tooltips.hide()
if(user.client)
var/client/client = user.client
if(client.tooltips)
client.tooltips.hide()
deltimer(client.tip_timer) //delete any in-progress timer if the mouse is moved off the item before it finishes
client.tip_timer = null
/**
* # `get_tooltip_data()`
*
* If set, will return a list for the tooltip (that will also be put together in a `Join()`)
* However, if returning `null`, falls back to default behavior, which is `examine(src)`, and it will definitely include
* images since it is the default behavior
* However, if returning `null`, the tooltip will not be shown as #14942 changed it.
*
* Though no tooltips will be created for atoms that have `tooltips = FALSE`
*/
@@ -137,11 +140,12 @@ Notes:
/atom/movable/MouseEntered(location, control, params)
. = ..()
if(tooltips)
if(!QDELETED(src) && usr.client.prefs.enable_tips)
if(!QDELETED(src) && usr?.client.prefs.enable_tips)
var/list/tooltip_data = get_tooltip_data()
if(length(tooltip_data))
var/examine_data = tooltip_data.Join("<br />")
openToolTip(usr, src, params, title = name, content = examine_data)
var/timedelay = max(usr.client.prefs.tip_delay * 0.01, 0.01) // I heard multiplying is faster, also runtimes from very low/negative numbers
usr.client.tip_timer = addtimer(CALLBACK(GLOBAL_PROC, .proc/openToolTip, usr, src, params, name, examine_data), timedelay, TIMER_STOPPABLE)
/atom/movable/MouseExited(location, control, params)
. = ..()
@@ -150,3 +154,7 @@ Notes:
/client/MouseDown(object, location, control, params)
closeToolTip(usr)
. = ..()
/client
/// Timers are now handled by clients, not by doing a mess on the item and multiple people overwriting a single timer on the object, have fun.
var/tip_timer = null