mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
Improves friendly commendation code (#56453)
This commit is contained in:
@@ -1018,15 +1018,14 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
/client/proc/get_award_status(achievement_type, mob/user, value = 1)
|
||||
return player_details.achievements.get_achievement_status(achievement_type)
|
||||
|
||||
///Redirect proc that makes it easier to get the status of an achievement. Achievement type is the typepath to the award.
|
||||
/client/proc/award_heart(heart_reason)
|
||||
to_chat(src, "<span class='nicegreen'>Someone awarded you a heart![heart_reason ? " They said: [heart_reason]!" : ""]</span>")
|
||||
if(!src)
|
||||
///Gives someone hearted status for OOC, from behavior commendations
|
||||
/client/proc/adjust_heart(duration = 24 HOURS)
|
||||
var/new_duration = world.realtime + duration
|
||||
if(prefs.hearted_until > new_duration)
|
||||
return
|
||||
prefs.hearted_until = world.realtime + (24 HOURS)
|
||||
to_chat(src, "<span class='nicegreen'>Someone awarded you a heart!</span>")
|
||||
prefs.hearted_until = new_duration
|
||||
prefs.hearted = TRUE
|
||||
if(!src)
|
||||
return
|
||||
prefs.save_preferences()
|
||||
|
||||
/// compiles a full list of verbs and sends it to the browser
|
||||
|
||||
@@ -56,12 +56,12 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
|
||||
mob.log_talk(raw_msg, LOG_OOC)
|
||||
|
||||
var/keyname = key
|
||||
if(prefs.hearted)
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat)
|
||||
keyname = "[sheet.icon_tag("emoji-heart")][keyname]"
|
||||
if(prefs.unlock_content)
|
||||
if(prefs.toggles & MEMBER_PUBLIC)
|
||||
keyname = "<font color='[prefs.ooccolor ? prefs.ooccolor : GLOB.normal_ooc_colour]'>[icon2html('icons/member_content.dmi', world, "blag")][keyname]</font>"
|
||||
if(prefs.hearted)
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat)
|
||||
keyname = "[sheet.icon_tag("emoji-heart")][keyname]"
|
||||
//The linkify span classes and linkify=TRUE below make ooc text get clickable chat href links if you pass in something resembling a url
|
||||
for(var/client/C in GLOB.clients)
|
||||
if(C.prefs.chat_toggles & CHAT_OOC)
|
||||
|
||||
Reference in New Issue
Block a user