Improves friendly commendation code (#56453)

This commit is contained in:
Ryll Ryll
2021-02-05 04:42:34 -05:00
committed by GitHub
parent a78dce538e
commit e6cae4fac5
8 changed files with 58 additions and 47 deletions
+6 -7
View File
@@ -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
+3 -3
View File
@@ -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)