[MIRROR] Improves friendly commendation code (#3110)

* Improves friendly commendation code (#56453)

* Improves friendly commendation code

Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-02-05 21:42:47 +00:00
committed by GitHub
co-authored by Ryll Ryll
parent de94d3e5aa
commit 18d9daadb1
8 changed files with 58 additions and 47 deletions
+6 -7
View File
@@ -1048,15 +1048,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)