Upstream fixes (#663)

* fix weird name saving

* fix item status

* Fix single-user BUIs erroneously closing (#28375)

(cherry picked from commit 08952b467d9b2b2db85cb9ebb4e8b628c0145716)

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
ThereDrD
2024-08-24 12:36:43 +03:00
committed by GitHub
parent 63b816b83b
commit dba9565865
6 changed files with 35 additions and 17 deletions

View File

@@ -526,6 +526,7 @@ namespace Content.Client.Preferences.UI
_controller.UpdateProfile(Profile);
_controller.ReloadCharacterUI();
IsDirty = true;
}
@@ -1308,7 +1309,7 @@ namespace Content.Client.Preferences.UI
private void SetBodyType(string newBodyType)
{
Profile = Profile?.WithBodyType(newBodyType);
IsDirty = true;
SetDirty();
_needUpdatePreview = true;
}

View File

@@ -28,7 +28,9 @@ namespace Content.Shared.Preferences
[Serializable, NetSerializable]
public sealed partial class HumanoidCharacterProfile : ICharacterProfile
{
private static readonly Regex RestrictedNameRegex = new("[^A-Z,a-z,0-9, -]");
// WD edit PLEASE DO NOT CHANGE RUSSIAN TO ENGLISH LETTERS, иначе уебу
private static readonly Regex RestrictedNameRegex = new("[^А-Я,а-я,0-9, -]");
private static readonly Regex RestrictedNameBorgsRegex = new("[^А-Я,а-я,0-9, -\\.]");
private static readonly Regex ICNameCaseRegex = new(@"^(?<word>\w)|\b(?<word>\w)(?=\w*$)");
public const int MaxNameLength = 32;
@@ -461,9 +463,9 @@ namespace Content.Shared.Preferences
{
if (maybeOther is not HumanoidCharacterProfile other) return false;
if (Name != other.Name) return false;
if (ClownName != other.ClownName) return false;
if (MimeName != other.MimeName) return false;
if (BorgName != other.BorgName) return false;
if (ClownName != other.ClownName) return false; // WD
if (MimeName != other.MimeName) return false; // WD
if (BorgName != other.BorgName) return false; // WD
if (Age != other.Age) return false;
if (Sex != other.Sex) return false;
if (Gender != other.Gender) return false;
@@ -532,9 +534,13 @@ namespace Content.Shared.Preferences
};
string name;
// WD edit start
string clownName;
string mimeName;
string borgName;
// WD edit end
if (string.IsNullOrEmpty(Name))
{
name = GetName(Species, gender);
@@ -548,6 +554,7 @@ namespace Content.Shared.Preferences
name = Name;
}
// WD edit start
if (string.IsNullOrEmpty(ClownName))
{
clownName = GetClownName();
@@ -586,36 +593,48 @@ namespace Content.Shared.Preferences
{
borgName = BorgName;
}
// WD edit end
name = name.Trim();
// WD edit start
clownName = clownName.Trim();
mimeName = mimeName.Trim();
borgName = borgName.Trim();
// WD edit end
if (configManager.GetCVar(CCVars.RestrictedNames))
{
name = RestrictedNameRegex.Replace(name, string.Empty);
// WD edit start
clownName = RestrictedNameRegex.Replace(clownName, string.Empty);
mimeName = RestrictedNameRegex.Replace(mimeName, string.Empty);
borgName = RestrictedNameRegex.Replace(borgName, string.Empty);
borgName = RestrictedNameBorgsRegex.Replace(borgName, string.Empty);
// WD edit end
}
if (configManager.GetCVar(CCVars.ICNameCase))
{
// This regex replaces the first character of the first and last words of the name with their uppercase version
name = name = ICNameCaseRegex.Replace(name, m => m.Groups["word"].Value.ToUpper());
name = ICNameCaseRegex.Replace(name, m => m.Groups["word"].Value.ToUpper());
clownName = clownName = ICNameCaseRegex.Replace(name, m => m.Groups["word"].Value.ToUpper());
mimeName = mimeName = ICNameCaseRegex.Replace(name, m => m.Groups["word"].Value.ToUpper());
borgName = borgName = ICNameCaseRegex.Replace(name, m => m.Groups["word"].Value.ToUpper());
// Clowns, mimes and cyborgs may not have surnames
//clownName = ICNameCaseRegex.Replace(clownName, m => m.Groups["word"].Value.ToUpper());
//mimeName = ICNameCaseRegex.Replace(mimeName, m => m.Groups["word"].Value.ToUpper());
//borgName = ICNameCaseRegex.Replace(borgName, m => m.Groups["word"].Value.ToUpper());
}
if (string.IsNullOrEmpty(name))
{
name = GetName(Species, gender);
// WD edit start
clownName = GetClownName();
mimeName = GetMimeName();
borgName = GetBorgName();
// WD edit end
}
var flavortext = FlavorText.Length > MaxDescLength

View File

@@ -13,8 +13,8 @@
torso:
part: TorsoHuman
connections:
- left arm
- right arm
- left arm
- left leg
- right leg
right arm:
@@ -55,8 +55,8 @@
torso:
part: TorsoTerminator
connections:
- left arm
- right arm
- left arm
- left leg
- right leg
right arm:

View File

@@ -13,8 +13,8 @@
torso:
part: TorsoHuman
connections:
- left arm
- right arm
- left arm
- left leg
- right leg
organs:

View File

@@ -13,8 +13,8 @@
torso:
part: TorsoHuman
connections:
- left arm
- right arm
- left arm
- left leg
- right leg
organs:

View File

@@ -6,7 +6,6 @@
abstract: true
components:
- type: HarpySinger
- type: Instrument
allowPercussion: false
program: 52
@@ -87,13 +86,12 @@
sprite: "Effects/creampie.rsi"
state: "creampie_human"
visible: false
# Yes, RArm has to be down here
# Yes, RArm has to be down here. WHY
- map: [ "enum.HumanoidVisualLayers.RArm" ]
- map: [ "enum.HumanoidVisualLayers.Hair" ]
- map: [ "enum.HumanoidVisualLayers.HeadTop" ]
- map: [ "mask" ]
- map: [ "head" ]
- type: HumanoidAppearance
species: Harpy
- type: Fixtures