-
-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows players to create "flavor text" for their characters that can …
…be seen on examine (#21925) * yeah ok * chubby uopdate * worry about ti later * yeah ahuh * sure * Revert "chubby uopdate" This reverts commit fc3647c. * q e * goodbye exodia * this al can go bye * god im so good yeah * push it * we're done what sup * goodbye low mem mode * uhgh * oops
- Loading branch information
Showing
12 changed files
with
237 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// How many characters will be displayed in the flavor text preview before we cut it off? | ||
#define FLAVOR_PREVIEW_LIMIT 110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/datum/preference/text/flavor_text | ||
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL | ||
savefile_identifier = PREFERENCE_CHARACTER | ||
savefile_key = "flavor_text" | ||
maximum_value_length = MAX_FLAVOR_LEN | ||
|
||
/datum/preference/text/flavor_text/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) | ||
target.dna.features["flavor_text"] = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/datum/examine_panel | ||
/// Mob that the examine panel belongs to. | ||
var/mob/living/holder | ||
/// The screen containing the appearance of the mob | ||
var/atom/movable/screen/map_view/examine_panel_screen/examine_panel_screen | ||
|
||
|
||
/datum/examine_panel/ui_state(mob/user) | ||
return GLOB.always_state | ||
|
||
|
||
/datum/examine_panel/ui_close(mob/user) | ||
user.client.clear_map(examine_panel_screen.assigned_map) | ||
|
||
|
||
/atom/movable/screen/map_view/examine_panel_screen | ||
name = "examine panel screen" | ||
|
||
|
||
/datum/examine_panel/ui_interact(mob/user, datum/tgui/ui) | ||
if(!examine_panel_screen) | ||
examine_panel_screen = new | ||
examine_panel_screen.name = "screen" | ||
examine_panel_screen.assigned_map = "examine_panel_[REF(holder)]_map" | ||
examine_panel_screen.del_on_map_removal = FALSE | ||
examine_panel_screen.screen_loc = "[examine_panel_screen.assigned_map]:1,1" | ||
|
||
var/mutable_appearance/current_mob_appearance = new(holder) | ||
current_mob_appearance.setDir(SOUTH) | ||
current_mob_appearance.transform = matrix() // We reset their rotation, in case they're lying down. | ||
|
||
// In case they're pixel-shifted, we bring 'em back! | ||
current_mob_appearance.pixel_x = 0 | ||
current_mob_appearance.pixel_y = 0 | ||
|
||
examine_panel_screen.cut_overlays() | ||
examine_panel_screen.add_overlay(current_mob_appearance) | ||
|
||
ui = SStgui.try_update_ui(user, src, ui) | ||
if(!ui) | ||
examine_panel_screen.display_to(user) | ||
user.client.register_map_obj(examine_panel_screen) | ||
ui = new(user, src, "ExaminePanel") | ||
ui.open() | ||
|
||
|
||
/datum/examine_panel/ui_data(mob/user) | ||
var/list/data = list() | ||
|
||
var/flavor_text | ||
var/obscured | ||
var/ideal_antag_optin_status | ||
var/current_antag_optin_status | ||
var/headshot = "" | ||
|
||
if(ishuman(holder)) | ||
var/mob/living/carbon/human/holder_human = holder | ||
obscured = (holder_human.wear_mask && (holder_human.wear_mask.flags_inv & HIDEFACE)) || (holder_human.head && (holder_human.head.flags_inv & HIDEFACE)) | ||
flavor_text = obscured ? "Obscured" : holder_human.dna.features["flavor_text"] | ||
if(!obscured) | ||
headshot += holder_human.dna.features["headshot"] | ||
|
||
var/name = obscured ? "Unknown" : holder.name | ||
|
||
data["obscured"] = obscured ? TRUE : FALSE | ||
data["character_name"] = name | ||
data["assigned_map"] = examine_panel_screen.assigned_map | ||
data["flavor_text"] = flavor_text | ||
data["headshot"] = headshot | ||
|
||
data["ideal_antag_optin_status"] = ideal_antag_optin_status | ||
data["current_antag_optin_status"] = current_antag_optin_status | ||
return data | ||
|
||
/datum/examine_panel/ui_static_data(mob/user) | ||
var/list/data = list() | ||
|
||
return data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { useBackend } from '../backend'; | ||
import { Stack, Section, ByondUi } from '../components'; | ||
import { Window } from '../layouts'; | ||
|
||
export const ExaminePanel = (props, context) => { | ||
const { act, data } = useBackend(context); | ||
const { | ||
character_name, | ||
assigned_map, | ||
flavor_text, | ||
} = data; | ||
return ( | ||
<Window | ||
title="Examine Panel" | ||
width={900} | ||
height={670} | ||
theme="admin"> | ||
<Window.Content> | ||
<Stack fill> | ||
<Stack.Item grow> | ||
<Section fill title="Character Preview"> | ||
<ByondUi | ||
height="100%" | ||
width="100%" | ||
className="ExaminePanel__map" | ||
params={{ | ||
id: assigned_map, | ||
type: 'map', | ||
}} /> | ||
</Section> | ||
</Stack.Item> | ||
<Stack.Item grow> | ||
<Stack fill vertical> | ||
<Stack.Item grow> | ||
<Section scrollable fill title={character_name + "'s Flavor Text:"}> | ||
{flavor_text} | ||
</Section> | ||
</Stack.Item> | ||
</Stack> | ||
</Stack.Item> | ||
</Stack> | ||
</Window.Content> | ||
</Window> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...nterfaces/PreferencesMenu/preferences/features/character_preferences/species_features.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// THIS IS A NOVA SECTOR UI FILE | ||
import { | ||
Feature, | ||
FeatureTextInput, | ||
} from "../base"; | ||
|
||
export const flavor_text: Feature<string> = { | ||
name: 'Flavor Text', | ||
description: | ||
"Appears when your character is examined (but only if they're identifiable - try a gas mask).", | ||
component: FeatureTextInput, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters