Character-based rebindable custom emotes (#18506)

* 1

* 2

* 3

* make it (mostly) work

* character-based emotes

* bump SQL version

* where did you go little s

* no more raw json

* partial AA review

* makes it not coded as stupidly

* donor exclusive emotes 4-7

* ship it

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* Update code/datums/keybindings/emote.dm

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* spacings

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
S34N
2022-07-30 12:14:02 +01:00
committed by GitHub
co-authored by AffectedArc07
parent c3c29f2f0d
commit fe1d30fd2f
11 changed files with 131 additions and 8 deletions
@@ -518,6 +518,24 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
dat += "<td style='width: 25%'>[KB.name]</td>"
dat += "<td style='width: 45%'>[keys_buttons][(length(keys) < 5) ? "<a href='?_src_=prefs;preference=keybindings;set=[KB.UID()];'><span class='good'>+</span></a></td>" : "</td>"]"
dat += "<td style='width: 20%'><a href='?_src_=prefs;preference=keybindings;reset=[KB.UID()]'>Reset to Default</a> <a href='?_src_=prefs;preference=keybindings;clear=[KB.UID()]'>Clear</a></td>"
if(KB.category == KB_CATEGORY_EMOTE_CUSTOM)
var/datum/keybinding/custom/custom_emote_keybind = kb
if(custom_emote_keybind.donor_exclusive && !(user.client.donator_level || user.client.holder || unlock_content))
dat += "</tr>"
dat += "<tr>"
dat += "<td><b>The use of this emote is restricted to patrons and byond members.</b></td>"
dat += "</tr>"
continue
dat += "</tr>"
dat += "<tr>"
var/emote_text = active_character.custom_emotes[custom_emote_keybind.name] //check if this emote keybind has an associated value on the character save
if(!emote_text)
dat += "<td style='width: 25%'>[custom_emote_keybind.default_emote_text]</td>"
else
dat += "<td style='width: 25%'><i>\"[active_character.real_name] [emote_text]\"</i></td>"
dat += "<td style='width: 45%'><a href='?_src_=prefs;preference=keybindings;custom_emote_set=[custom_emote_keybind.UID()];'>Change Text</a></td>"
dat += "<td style='width: 20%'><a href='?_src_=prefs;preference=keybindings;custom_emote_reset=[custom_emote_keybind.UID()];'>Reset to Default</a></td>"
dat += "<tr><td colspan=4><br></td></tr>"
dat += "</tr>"
dat += "<tr><td colspan=4><br></td></tr>"