-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flavor Text returns #575
Flavor Text returns #575
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,22 @@ | |
savefile_identifier = PREFERENCE_CHARACTER | ||
savefile_key = "flavor_text" | ||
|
||
explanation = "Flavor Text" | ||
|
||
/datum/preference/text/flavor_text/get_button(datum/preferences/prefs) | ||
return button_element(prefs, "Set Examine Text", "pref_act=[type]") | ||
|
||
/datum/preference/text/flavor_text/user_edit(mob/user, datum/preferences/prefs) | ||
var/input = tgui_input_text(user, "Describe your character in greater detail.",, serialize(prefs.read_preference(type))) | ||
if(!input) | ||
return | ||
. = prefs.update_preference(src, input) | ||
|
||
if(istype(user, /mob/dead/new_player)) | ||
var/mob/dead/new_player/player = user | ||
player.new_player_panel() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is rather odd, what's it for? |
||
|
||
return . | ||
|
||
/datum/preference/text/flavor_text/apply_to_human(mob/living/carbon/human/target, value) | ||
target.dna.features["flavor_text"] = value |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,6 +343,19 @@ | |
else if(isobserver(user)) | ||
. += span_info("<b>Traits:</b> [get_quirk_string(FALSE, CAT_QUIRK_ALL)]") | ||
|
||
var/flavor_text_link | ||
/// The first 1-FLAVOR_PREVIEW_LIMIT characters in the mob's "flavor_text" DNA feature. FLAVOR_PREVIEW_LIMIT is defined in flavor_defines.dm. | ||
var/preview_text = copytext_char((dna.features["flavor_text"]), 1, FLAVOR_PREVIEW_LIMIT) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really not a fan of this being stored in DNA.features. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as storing it elsewhere does not replicate the problem I have seen in other servers where when the client disconnects, their flavor text doesnt go with the client which causes weird issues. @Kapu1178 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Actually that's a stupid idea due to that being transferred with the brain IIRC, just write it to a var on the mob. Maybe it could be reused for giving other mobs extra examine info too, though that might be out of scope. |
||
// What examine_tgui.dm uses to determine if flavor text appears as "Obscured". | ||
var/face_obscured = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE)) | ||
Cenrus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if(preview_text) | ||
if (!(face_obscured)) | ||
flavor_text_link = span_notice("[preview_text]... <a href='?src=[REF(src)];open_examine_panel=1'>Look closer?</a>") | ||
Cenrus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
else | ||
flavor_text_link = span_notice("...?") | ||
if (flavor_text_link) | ||
. += flavor_text_link | ||
|
||
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .) | ||
|
||
/** | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a sensible length limit. You also might want to make this a multi-line input and strip out the newline characters after.