AddOocFlavor

This commit is contained in:
Zekins
2025-01-03 16:36:44 +03:00
parent 947a1c5def
commit 09146c2a8e
17 changed files with 4311 additions and 16 deletions

View File

@@ -1,5 +1,37 @@
<Control Name="CFlavorText" xmlns="https://spacestation14.io">
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<TextEdit Name="CFlavorTextInput" Access="Public" MinSize="220 100" Margin="10" HorizontalExpand="True" VerticalExpand="True" />
<!-- Corvax-Wega-OOCFlavor-Edit-->
<Control Name="CFlavorText" xmlns="https://spacestation14.io" xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True">
<PanelContainer MinSize="5 0" HorizontalExpand="False" VerticalExpand="True">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#30D5C855" />
</PanelContainer.PanelOverride>
</PanelContainer>
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-flavor-label'}" Margin="5,0,0,0" HorizontalAlignment="Left" />
<PanelContainer StyleClasses="Inset" Margin="5" HorizontalExpand="True" VerticalExpand="True">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#80808008" />
</PanelContainer.PanelOverride>
<TextEdit Name="CFlavorTextInput" Access="Public" MinSize="110 100" Margin="10" HorizontalExpand="True" VerticalExpand="True" />
</PanelContainer>
</BoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True">
<PanelContainer MinSize="5 0" HorizontalExpand="False" VerticalExpand="True">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#80008055" />
</PanelContainer.PanelOverride>
</PanelContainer>
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-flavor-ooc-label'}" Margin="5,0,0,0" HorizontalAlignment="Left" />
<PanelContainer StyleClasses="Inset" Margin="5" HorizontalExpand="True" VerticalExpand="True">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#80808008" />
</PanelContainer.PanelOverride>
<TextEdit Name="CFlavorOOCTextInput" Access="Public" MinSize="110 100" Margin="10" HorizontalExpand="True" VerticalExpand="True" />
</PanelContainer>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</Control>

View File

@@ -9,6 +9,7 @@ namespace Content.Client.FlavorText
public sealed partial class FlavorText : Control
{
public Action<string>? OnFlavorTextChanged;
public Action<string>? OnFlavorOOCTextChanged; // Corvax-Wega-OOCFlavor
public FlavorText()
{
@@ -17,12 +18,21 @@ namespace Content.Client.FlavorText
var loc = IoCManager.Resolve<ILocalizationManager>();
CFlavorTextInput.Placeholder = new Rope.Leaf(loc.GetString("flavor-text-placeholder"));
CFlavorTextInput.OnTextChanged += _ => FlavorTextChanged();
CFlavorTextInput.OnTextChanged += _ => FlavorTextChanged();
CFlavorOOCTextInput.Placeholder = new Rope.Leaf(loc.GetString("ooc-flavor-text-placeholder")); // Corvax-Wega-OOCFlavor
CFlavorOOCTextInput.OnTextChanged += _ => FlavorOOCTextChanged(); // Corvax-Wega-OOCFlavor
}
public void FlavorTextChanged()
{
OnFlavorTextChanged?.Invoke(Rope.Collapse(CFlavorTextInput.TextRope).Trim());
}
// Corvax-Wega-OOCFlavor-start
public void FlavorOOCTextChanged()
{
OnFlavorOOCTextChanged?.Invoke(Rope.Collapse(CFlavorOOCTextInput.TextRope).Trim());
}
// Corvax-Wega-OOCFlavor-end
}
}

View File

@@ -53,6 +53,7 @@ namespace Content.Client.Lobby.UI
private FlavorText.FlavorText? _flavorText;
private TextEdit? _flavorTextEdit;
private TextEdit? _flavorTextOOCEdit; // Corvax-Wega-OOCFlavor
// One at a time.
private LoadoutWindow? _loadoutWindow;
@@ -497,8 +498,10 @@ namespace Content.Client.Lobby.UI
TabContainer.AddChild(_flavorText);
TabContainer.SetTabTitle(TabContainer.ChildCount - 1, Loc.GetString("humanoid-profile-editor-flavortext-tab"));
_flavorTextEdit = _flavorText.CFlavorTextInput;
_flavorTextOOCEdit = _flavorText.CFlavorOOCTextInput; // Corvax-Wega-OOCFlavor
_flavorText.OnFlavorTextChanged += OnFlavorTextChange;
_flavorText.OnFlavorOOCTextChanged += OnFlavorOOCTextChange; // Corvax-Wega-OOCFlavor
}
else
{
@@ -507,9 +510,12 @@ namespace Content.Client.Lobby.UI
TabContainer.RemoveChild(_flavorText);
_flavorText.OnFlavorTextChanged -= OnFlavorTextChange;
_flavorText.OnFlavorOOCTextChanged -= OnFlavorOOCTextChange; // Corvax-Wega-OOCFlavor
_flavorText.Dispose();
_flavorTextEdit?.Dispose();
_flavorTextOOCEdit?.Dispose(); // Corvax-Wega-OOCFlavor
_flavorTextEdit = null;
_flavorTextOOCEdit = null; // Corvax-Wega-OOCFlavor
_flavorText = null;
}
}
@@ -1098,6 +1104,17 @@ namespace Content.Client.Lobby.UI
SetDirty();
}
// Corvax-Wega-OOCFlavor-start
private void OnFlavorOOCTextChange(string content)
{
if (Profile is null)
return;
Profile = Profile.WithOOCFlavorText(content);
SetDirty();
}
// Corvax-Wega-OOCFlavor-end
private void OnMarkingChange(MarkingSet markings)
{
if (Profile is null)
@@ -1321,6 +1338,13 @@ namespace Content.Client.Lobby.UI
{
_flavorTextEdit.TextRope = new Rope.Leaf(Profile?.FlavorText ?? "");
}
// Corvax-Wega-OOCFlavor-start
if (_flavorTextOOCEdit != null)
{
_flavorTextOOCEdit.TextRope = new Rope.Leaf(Profile?.OOCFlavorText ?? "");
}
// Corvax-Wega-OOCFlavor-end
}
private void UpdateAgeEdit()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
public partial class OOCFlavorText : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "oocflavor_text",
table: "profile",
type: "text",
nullable: false,
defaultValue: "");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "oocflavor_text",
table: "profile");
}
}
}

View File

@@ -791,6 +791,13 @@ namespace Content.Server.Database.Migrations.Postgres
.HasColumnType("integer")
.HasColumnName("age");
// Corvax-Wega-Barks-start
b.Property<string>("BarkVoice")
.IsRequired()
.HasColumnType("text")
.HasColumnName("bark_voice");
// Corvax-Wega-Barks-end
b.Property<string>("CharacterName")
.IsRequired()
.HasColumnType("text")
@@ -835,6 +842,13 @@ namespace Content.Server.Database.Migrations.Postgres
.HasColumnType("jsonb")
.HasColumnName("markings");
// Corvax-Wega-OOCFlavor-start
b.Property<string>("OOCFlavorText")
.IsRequired()
.HasColumnType("text")
.HasColumnName("oocflavor_text");
// Corvax-Wega-OOCFlavor-end
b.Property<int>("PreferenceId")
.HasColumnType("integer")
.HasColumnName("preference_id");
@@ -871,11 +885,6 @@ namespace Content.Server.Database.Migrations.Postgres
.IsRequired()
.HasColumnType("text")
.HasColumnName("status");
b.Property<string>("BarkVoice")
.IsRequired()
.HasColumnType("text")
.HasColumnName("bark_voice");
// Corvax-Wega-end
// Corvax-TTS-Start

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Sqlite
{
public partial class OOCFlavorText : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "oocflavor_text",
table: "profile",
type: "TEXT",
nullable: false,
defaultValue: "");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "oocflavor_text",
table: "profile");
}
}
}

View File

@@ -742,6 +742,13 @@ namespace Content.Server.Database.Migrations.Sqlite
.HasColumnType("INTEGER")
.HasColumnName("age");
// Corvax-Wega-Barks-start
b.Property<string>("BarkVoice")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("bark_voice");
// Corvax-Wega-Barks-end
b.Property<string>("CharacterName")
.IsRequired()
.HasColumnType("TEXT")
@@ -786,6 +793,13 @@ namespace Content.Server.Database.Migrations.Sqlite
.HasColumnType("jsonb")
.HasColumnName("markings");
// Corvax-Wega-OOCFlavor-start
b.Property<string>("OOCFlavorText")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("oocflavor_text");
// Corvax-Wega-OOCFlavor-end
b.Property<int>("PreferenceId")
.HasColumnType("INTEGER")
.HasColumnName("preference_id");
@@ -822,11 +836,6 @@ namespace Content.Server.Database.Migrations.Sqlite
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("status");
b.Property<string>("BarkVoice")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("bark_voice");
// Corvax-Wega-end
// Corvax-TTS-Start

View File

@@ -400,6 +400,7 @@ namespace Content.Server.Database
public int Slot { get; set; }
[Column("char_name")] public string CharacterName { get; set; } = null!;
public string FlavorText { get; set; } = null!;
public string OOCFlavorText { get; set; } = null!; // Corvax-Wega-OOCFlavor
public int Age { get; set; }
public string Sex { get; set; } = null!;
public string Gender { get; set; } = null!;

View File

@@ -258,6 +258,7 @@ namespace Content.Server.Database
return new HumanoidCharacterProfile(
profile.CharacterName,
profile.FlavorText,
profile.OOCFlavorText, // Corvax-Wega-OOCFlavor
profile.Species,
barkvoice, // Corvax-Wega-Barks
voice, // Corvax-TTS
@@ -297,6 +298,7 @@ namespace Content.Server.Database
profile.CharacterName = humanoid.Name;
profile.FlavorText = humanoid.FlavorText;
profile.OOCFlavorText = humanoid.OOCFlavorText; // Corvax-Wega-OOCFlavor
profile.Species = humanoid.Species;
profile.Voice = humanoid.Voice; // Corvax-TTS
profile.BarkVoice = humanoid.BarkVoice; // Corvax-Wega-Barks

View File

@@ -187,9 +187,14 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
_humanoidSystem.LoadProfile(entity.Value, profile);
_metaSystem.SetEntityName(entity.Value, profile.Name);
if (_configurationManager.GetCVar(CCVars.FlavorText)) // Corvax-Wega
if (_configurationManager.GetCVar(CCVars.FlavorText)) // Corvax-Wega-Edit
{
AddComp<DetailExaminableComponent>(entity.Value).Content = profile.FlavorText;
// Corvax-Wega-OOCFlavor-Edit-start
var content = $"{Loc.GetString("humanoid-profile-editor-flavor-label")}\n{profile.FlavorText}";
if (!string.IsNullOrEmpty(profile.OOCFlavorText))
content += $"\n\n{Loc.GetString("humanoid-profile-editor-flavor-ooc-label")}\n{profile.OOCFlavorText}";
AddComp<DetailExaminableComponent>(entity.Value).Content = content;
// Corvax-Wega-OOCFlavor-Edit-end
}
}

View File

@@ -32,6 +32,7 @@ namespace Content.Shared.Preferences
public const int MaxNameLength = 32;
public const int MaxDescLength = 1024; // Corvax-Wega
public const int MaxOOCDescLength = 512; // Corvax-Wega-OOCFlavor
/// <summary>
/// Job preferences for initial spawn.
@@ -73,6 +74,9 @@ namespace Content.Shared.Preferences
[DataField]
public string FlavorText { get; set; } = string.Empty;
[DataField] // Corvax-Wega-OOCFlavor
public string OOCFlavorText { get; set; } = string.Empty; // Corvax-Wega-OOCFlavor
/// <summary>
/// Associated <see cref="SpeciesPrototype"/> for this profile.
/// </summary>
@@ -141,6 +145,7 @@ namespace Content.Shared.Preferences
public HumanoidCharacterProfile(
string name,
string flavortext,
string oocflavortext, // Corvax-Wega-OOCFlavor
string species,
string barkvoice, // Corvax-Wega-Barks
string voice, // Corvax-TTS
@@ -158,6 +163,7 @@ namespace Content.Shared.Preferences
{
Name = name;
FlavorText = flavortext;
OOCFlavorText = oocflavortext; // Corvax-Wega-OOCFlavor
Species = species;
BarkVoice = barkvoice; // Corvax-Wega-Barks
Voice = voice; // Corvax-TTS
@@ -192,6 +198,7 @@ namespace Content.Shared.Preferences
public HumanoidCharacterProfile(HumanoidCharacterProfile other)
: this(other.Name,
other.FlavorText,
other.OOCFlavorText, // Corvax-Wega-OOCFlavor
other.Species,
other.BarkVoice, // Corvax-Wega-Barks
other.Voice,
@@ -313,6 +320,13 @@ namespace Content.Shared.Preferences
return new(this) { FlavorText = flavorText };
}
// Corvax-Wega-OOCFlavor-start
public HumanoidCharacterProfile WithOOCFlavorText(string oocFlavorText)
{
return new(this) { OOCFlavorText = oocFlavorText };
}
// Corvax-Wega-OOCFlavor-end
public HumanoidCharacterProfile WithAge(int age)
{
return new(this) { Age = age };
@@ -529,6 +543,7 @@ namespace Content.Shared.Preferences
if (!_traitPreferences.SequenceEqual(other._traitPreferences)) return false;
if (!Loadouts.SequenceEqual(other.Loadouts)) return false;
if (FlavorText != other.FlavorText) return false;
if (OOCFlavorText != other.OOCFlavorText) return false; // Corvax-Wega-OOCFlavor
return Appearance.MemberwiseEquals(other.Appearance);
}
@@ -627,6 +642,18 @@ namespace Content.Shared.Preferences
flavortext = FormattedMessage.RemoveMarkupOrThrow(FlavorText);
}
// Corvax-Wega-OOCFlavor-start
string oocflavortext;
if (OOCFlavorText.Length > MaxDescLength)
{
oocflavortext = FormattedMessage.RemoveMarkupOrThrow(OOCFlavorText)[..MaxOOCDescLength];
}
else
{
oocflavortext = FormattedMessage.RemoveMarkupOrThrow(OOCFlavorText);
}
// Corvax-Wega-OOCFlavor-end
var appearance = HumanoidCharacterAppearance.EnsureValid(Appearance, Species, Sex, sponsorPrototypes);
var prefsUnavailableMode = PreferenceUnavailable switch
@@ -675,6 +702,7 @@ namespace Content.Shared.Preferences
Name = name;
FlavorText = flavortext;
OOCFlavorText = oocflavortext; // Corvax-Wega-OOCFlavor
Age = age;
Sex = sex;
Gender = gender;
@@ -805,6 +833,7 @@ namespace Content.Shared.Preferences
hashCode.Add(_loadouts);
hashCode.Add(Name);
hashCode.Add(FlavorText);
hashCode.Add(OOCFlavorText); // Corvax-Wega-OOCFlavor
hashCode.Add(Species);
hashCode.Add(Age);
hashCode.Add((int)Sex);

View File

@@ -0,0 +1 @@
ooc-flavor-text-placeholder = OOC замечания, раскрывающие персонажа или вашу предпочтения...

View File

@@ -3,3 +3,6 @@ humanoid-profile-editor-status-no-text = Нет ЕРП
humanoid-profile-editor-status-semi-text = Неполное ЕРП
humanoid-profile-editor-status-full-text = Полное ЕРП
humanoid-profile-editor-status-absolute-text = Абсолютное ЕРП
humanoid-profile-editor-flavor-label = Внешний Вид:
humanoid-profile-editor-flavor-ooc-label = OOC Заметки:

View File

@@ -7,5 +7,6 @@
- Запрещены оскорбления других игроков в OOC-чатах строго запрещены, как в явной, так и в завуалированной форме. Также запрещено использовать OOC-чаты для обсуждения политических, экстремистских и других спорных тем.
- Что касается оскорблений в IC-чате, важно соблюдать меру. Чрезмерные оскорбления могут нарушить ролевую атмосферу, и, кроме того, иногда они явно направлены на игрока, а не на персонажа. Например, назвать кого-то "омерзительной ящерицей" — это оскорбление персонажа, а комментарии, касающиеся умственных способностей или компетентности, обычно направлены на игрока. Администрация может вмешаться и попросить вас прекратить, если ситуация выходит за рамки допустимого.
- Соблюдайте субординацию при общении с Администратором. Оскорбления в сторону Администратора могут привести к различным наказаниям: от блокировки определенных чатов, до игрового бана на увеличенные сроки. В случае, если администратор не прав своими действиями, вместо оскорблений и выяснения отношений, обратитесь к Старшим Администраторам/напишите жалобу в соответствующий канал.
- Касаемо вкладки "ООС заметки": Нелепые описания и/или описания, имеющие явную политическую принадлежность, являются нарушением этого правила.
</Document>

View File

@@ -12,6 +12,8 @@
- Вкладка с "Описанием" должна отображать только внешние черты вашего персонажа и ничего больше. Поэтому вы не можете описывать там вашу увлекательную историю или характер персонажа!
- Вы также должны помнить, что любая должность на Командовании требует огромного опыта, а Капитан 18-ти лет будет восприниматься очень несерьёзно.
- Ваш персонаж обязан достигнуть полного совершеннолетия.
- Вкладка с "OOC заметками" должна отображать разного рода примечания, которые не могут быть описаны во вкладке с описанием и являются OOC (Out Of Character) фактами. Эта вкладка может дополнительно раскрывать персонажа и демонстрировать Ваши предпочтения как игрока.
- Дополнительную информацию по данной теме Вы можете посмотреть в п.3.7.
## Отыгрыш и психические отклонения персонажа:
- Корпорация перед приемом на работу проводит тщательное медицинское обследование своих сотрудников, которое включает в себя и психиатрические тесты. Это значит, что ваш персонаж не может прибыть на станцию "психом", "сумасшедшим" и т.д. Психическое состояние вашего персонажа может измениться из-за событий раунда, но изменения должны отыгрываться адекватно.