mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Adds friendly commendations (#51217)
* with message * remove message, neaten up
This commit is contained in:
@@ -967,3 +967,14 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
///Redirect proc that makes it easier to get the status of an achievement. Achievement type is the typepath to the award.
|
||||
/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)
|
||||
return
|
||||
prefs.hearted_until = world.realtime + (24 HOURS)
|
||||
prefs.hearted = TRUE
|
||||
if(!src)
|
||||
return
|
||||
prefs.save_preferences()
|
||||
|
||||
@@ -115,6 +115,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
///This var stores the amount of points the owner will get for making it out alive.
|
||||
var/hardcore_survival_score = 0
|
||||
|
||||
///Someone thought we were nice! We get a little heart in OOC until we join the server past the below time (we can keep it until the end of the round otherwise)
|
||||
var/hearted
|
||||
///
|
||||
var/hearted_until
|
||||
|
||||
/datum/preferences/New(client/C)
|
||||
parent = C
|
||||
|
||||
@@ -653,6 +658,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
if(unlock_content || check_rights_for(user.client, R_ADMIN))
|
||||
dat += "<b>OOC Color:</b> <span style='border: 1px solid #161616; background-color: [ooccolor ? ooccolor : GLOB.normal_ooc_colour];'> </span> <a href='?_src_=prefs;preference=ooccolor;task=input'>Change</a><br>"
|
||||
if(hearted_until)
|
||||
dat += "<a href='?_src_=prefs;preference=clear_heart'>Clear OOC Commend Heart</a><br>"
|
||||
|
||||
dat += "</td>"
|
||||
|
||||
@@ -1742,6 +1749,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if (href_list["tab"])
|
||||
current_tab = text2num(href_list["tab"])
|
||||
|
||||
if("clear_heart")
|
||||
hearted = FALSE
|
||||
hearted_until = null
|
||||
to_chat(user, "<span class='notice'>OOC Commendation Heart disabled</span>")
|
||||
save_preferences()
|
||||
|
||||
ShowChoices(user)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -203,6 +203,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
|
||||
// Custom hotkeys
|
||||
S["key_bindings"] >> key_bindings
|
||||
// hearted
|
||||
S["hearted_until"] >> hearted_until
|
||||
if(hearted_until > world.realtime)
|
||||
hearted = TRUE
|
||||
|
||||
//try to fix any outdated data if necessary
|
||||
if(needs_update >= 0)
|
||||
@@ -288,6 +292,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["pda_style"], pda_style)
|
||||
WRITE_FILE(S["pda_color"], pda_color)
|
||||
WRITE_FILE(S["key_bindings"], key_bindings)
|
||||
WRITE_FILE(S["hearted_until"], (hearted_until > world.realtime ? hearted_until : null))
|
||||
return TRUE
|
||||
|
||||
/datum/preferences/proc/load_character(slot)
|
||||
|
||||
@@ -56,6 +56,9 @@ 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/goonchat)
|
||||
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>"
|
||||
|
||||
Reference in New Issue
Block a user