From 19d75404df5d2fed9583cfe7334e04d0766ce863 Mon Sep 17 00:00:00 2001
From: larentoun <31931237+larentoun@users.noreply.github.com>
Date: Sun, 27 Oct 2024 01:18:31 +0300
Subject: [PATCH 1/4] update it
---
.../code/examine_panel_component.dm | 34 +++++++++---------
.../examine_panel/code/examine_panel_mob.dm | 35 ++++++++++++++-----
.../packages/tgui/interfaces/ExaminePanel.tsx | 6 ++--
.../character_preferences/examine_panel.tsx | 4 +--
4 files changed, 49 insertions(+), 30 deletions(-)
diff --git a/modular_bandastation/examine_panel/code/examine_panel_component.dm b/modular_bandastation/examine_panel/code/examine_panel_component.dm
index 543f2d514144d..608687ea8659b 100644
--- a/modular_bandastation/examine_panel/code/examine_panel_component.dm
+++ b/modular_bandastation/examine_panel/code/examine_panel_component.dm
@@ -1,23 +1,22 @@
/datum/component/examine_panel
- dupe_mode = COMPONENT_DUPE_UNIQUE
- /// 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
/// Flavor text
var/flavor_text
-/datum/component/examine_panel/Initialize(use_prefs = FALSE)
- . = ..()
- if(!isliving(parent))
+/datum/component/examine_panel/Initialize(flavor_override)
+ if(!iscarbon(parent) && !issilicon(parent))
return COMPONENT_INCOMPATIBLE
- holder = parent
- if(!use_prefs)
+ if(flavor_override)
+ flavor_text = flavor_override
return
if(iscarbon(parent))
- flavor_text = holder.client?.prefs.read_preference(/datum/preference/text/flavor_text)
+ var/mob/living/carbon/carbon = parent
+ flavor_text = carbon.dna.features["flavor_text"]
+ return
if(issilicon(parent))
- flavor_text = holder.client?.prefs.read_preference(/datum/preference/text/silicon_flavor_text)
+ var/mob/living/silicon/silicon = parent
+ flavor_text = silicon.flavor_text
/datum/component/examine_panel/RegisterWithParent()
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
@@ -30,6 +29,7 @@
if(iscarbon(source))
examine_list += get_carbon_flavor_text(source)
+ return
if(issilicon(source))
examine_list += get_silicon_flavor_text(source)
@@ -41,9 +41,9 @@
var/face_obscured = (source.wear_mask && (source.wear_mask.flags_inv & HIDEFACE)) || (source.head && (source.head.flags_inv & HIDEFACE))
if (!(face_obscured))
- flavor_text_link = span_notice("[preview_text]... Look closer?")
+ flavor_text_link = span_notice("[preview_text]... Раскрыть описание")
else
- flavor_text_link = span_notice("Examine closely...")
+ flavor_text_link = span_notice("Раскрыть описание")
if (flavor_text_link)
return flavor_text_link
@@ -52,7 +52,7 @@
/// The first 1-FLAVOR_PREVIEW_LIMIT characters in the mob's client's silicon_flavor_text preference datum. FLAVOR_PREVIEW_LIMIT is defined in flavor_defines.dm.
var/preview_text = copytext_char(flavor_text, 1, FLAVOR_PREVIEW_LIMIT)
- flavor_text_link = span_notice("[preview_text]... Look closer?")
+ flavor_text_link = span_notice("[preview_text]... Раскрыть описание")
if (flavor_text_link)
return flavor_text_link
@@ -78,11 +78,11 @@
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.assigned_map = "examine_panel_[REF(parent)]_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)
+ var/mutable_appearance/current_mob_appearance = new(parent)
current_mob_appearance.setDir(SOUTH)
current_mob_appearance.transform = matrix() // We reset their rotation, in case they're lying down.
@@ -110,9 +110,9 @@
if(ishuman(parent))
var/mob/living/carbon/human/holder_human = parent
obscured = (holder_human.wear_mask && (holder_human.wear_mask.flags_inv & HIDEFACE)) || (holder_human.head && (holder_human.head.flags_inv & HIDEFACE))
- tgui_flavor_text = obscured ? "Obscured" : flavor_text
+ tgui_flavor_text = obscured ? "Скрывает лицо" : flavor_text
- var/name = obscured ? "Unknown" : holder
+ var/name = obscured ? "Неизвестный" : parent
data["obscured"] = obscured ? TRUE : FALSE
data["character_name"] = name
diff --git a/modular_bandastation/examine_panel/code/examine_panel_mob.dm b/modular_bandastation/examine_panel/code/examine_panel_mob.dm
index b55a6eec0ded8..f98cab758567f 100644
--- a/modular_bandastation/examine_panel/code/examine_panel_mob.dm
+++ b/modular_bandastation/examine_panel/code/examine_panel_mob.dm
@@ -1,19 +1,38 @@
// TODO: Don't use prefs when spawned via admins
/mob/living/carbon/human/Login()
. = ..()
- AddComponent(/datum/component/examine_panel, use_prefs = TRUE)
+ AddComponent(/datum/component/examine_panel)
+
+/datum/dna/transfer_identity(mob/living/carbon/destination, transfer_SE, transfer_species)
+ if(!istype(destination))
+ return
+ . = ..()
+ destination.AddComponent(/datum/component/examine_panel)
+
+/mob/living/silicon
+ var/flavor_text
/mob/living/silicon/Login()
. = ..()
- AddComponent(/datum/component/examine_panel, use_prefs = TRUE)
+ if(!flavor_text)
+ flavor_text = client?.prefs.read_preference(/datum/preference/text/silicon_flavor_text)
+ AddComponent(/datum/component/examine_panel)
/mob/living/verb/change_flavor_text()
- set name = "Change flavor text"
+ set name = "Изменить описание"
set category = "IC"
- var/datum/component/examine_panel/examine_panel = GetComponent(/datum/component/examine_panel)
- if(!examine_panel)
- examine_panel = AddComponent(/datum/component/examine_panel)
- var/new_flavor_text = tgui_input_text(usr, "Enter new flavor text", "Changing Flavor Text", examine_panel.flavor_text)
+ var/new_flavor_text = tgui_input_text(usr, "Введите новое описание", "Изменение описания")
if(new_flavor_text)
- examine_panel.flavor_text = new_flavor_text
+ DEFAULT_QUEUE_OR_CALL_VERB(VERB_CALLBACK(src, PROC_REF(save_new_flavor_text), new_flavor_text))
+
+/mob/living/proc/save_new_flavor_text(new_flavor_text)
+ return
+
+/mob/living/carbon/save_new_flavor_text(new_flavor_text)
+ dna.features["flavor_text"] = new_flavor_text
+ AddComponent(/datum/component/examine_panel)
+
+/mob/living/silicon/save_new_flavor_text(new_flavor_text)
+ flavor_text = new_flavor_text
+ AddComponent(/datum/component/examine_panel)
diff --git a/tgui/packages/tgui/interfaces/ExaminePanel.tsx b/tgui/packages/tgui/interfaces/ExaminePanel.tsx
index 8dc853a13850a..1f363af62e943 100644
--- a/tgui/packages/tgui/interfaces/ExaminePanel.tsx
+++ b/tgui/packages/tgui/interfaces/ExaminePanel.tsx
@@ -15,11 +15,11 @@ export const ExaminePanel = (props) => {
const { act, data } = useBackend();
const { character_name, obscured, assigned_map, flavor_text } = data;
return (
-
+
-
+
{!obscured && (
)}
@@ -31,7 +31,7 @@ export const ExaminePanel = (props) => {
{flavor_text}
diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
index 0bd38dd3618d0..8c35e4f44999b 100644
--- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
+++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
@@ -2,13 +2,13 @@ import { Feature } from '../base';
import { FeatureTextInput } from '../base_bandastation';
export const flavor_text: Feature = {
- name: 'Flavor Text',
+ name: 'Описание',
description: 'Опишите вашего персонажа!',
component: FeatureTextInput,
};
export const silicon_flavor_text: Feature = {
- name: 'Flavor Text (Silicon)',
+ name: 'Описание (Silicon)',
description: 'Опишите вашего силикона!',
component: FeatureTextInput,
};
From f97c93ed5332d1ddf6e69d1b5cb5e165e02236da Mon Sep 17 00:00:00 2001
From: larentoun <31931237+larentoun@users.noreply.github.com>
Date: Sun, 27 Oct 2024 01:20:10 +0300
Subject: [PATCH 2/4] better name
---
tgui/packages/tgui/interfaces/ExaminePanel.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tgui/packages/tgui/interfaces/ExaminePanel.tsx b/tgui/packages/tgui/interfaces/ExaminePanel.tsx
index 1f363af62e943..38d8a10b3f128 100644
--- a/tgui/packages/tgui/interfaces/ExaminePanel.tsx
+++ b/tgui/packages/tgui/interfaces/ExaminePanel.tsx
@@ -15,7 +15,7 @@ export const ExaminePanel = (props) => {
const { act, data } = useBackend();
const { character_name, obscured, assigned_map, flavor_text } = data;
return (
-
+
From 0bf46099db4b7c5f7bfb04b5f56fd4c79d65b5e5 Mon Sep 17 00:00:00 2001
From: larentoun <31931237+larentoun@users.noreply.github.com>
Date: Sun, 27 Oct 2024 01:27:19 +0300
Subject: [PATCH 3/4] it is translate in translate???
---
.../features/character_preferences/examine_panel.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
index 8c35e4f44999b..0d5450daec7d6 100644
--- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
+++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
@@ -2,13 +2,13 @@ import { Feature } from '../base';
import { FeatureTextInput } from '../base_bandastation';
export const flavor_text: Feature = {
- name: 'Описание',
+ name: 'Flavor text',
description: 'Опишите вашего персонажа!',
component: FeatureTextInput,
};
export const silicon_flavor_text: Feature = {
- name: 'Описание (Silicon)',
+ name: 'Flavor text (Silicon)',
description: 'Опишите вашего силикона!',
component: FeatureTextInput,
};
From d6c21fc76a7b54129c11efad4091211e64280c01 Mon Sep 17 00:00:00 2001
From: larentoun <31931237+larentoun@users.noreply.github.com>
Date: Sun, 27 Oct 2024 01:27:32 +0300
Subject: [PATCH 4/4] typo
---
.../features/character_preferences/examine_panel.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
index 0d5450daec7d6..0bd38dd3618d0 100644
--- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
+++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/examine_panel.tsx
@@ -2,13 +2,13 @@ import { Feature } from '../base';
import { FeatureTextInput } from '../base_bandastation';
export const flavor_text: Feature = {
- name: 'Flavor text',
+ name: 'Flavor Text',
description: 'Опишите вашего персонажа!',
component: FeatureTextInput,
};
export const silicon_flavor_text: Feature = {
- name: 'Flavor text (Silicon)',
+ name: 'Flavor Text (Silicon)',
description: 'Опишите вашего силикона!',
component: FeatureTextInput,
};