Skip to content
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

Локализация #1

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using Content.Shared.Roles;
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;

namespace Content.Server.Corvax.HiddenDescription;

/// <summary>
/// A component that shows players with specific roles or jobs additional information about entities
/// </summary>

[RegisterComponent, Access(typeof(HiddenDescriptionSystem))]
public sealed partial class HiddenDescriptionComponent : Component
{
[DataField(required: true)]
public List<HiddenDescriptionEntry> Entries = new();

/// <summary>
/// Prioritizing the location of classified information in an inspection
/// </summary>
[DataField]
public int PushPriority = 1;
}

[DataDefinition, Serializable]
public readonly partial record struct HiddenDescriptionEntry()
{
/// <summary>
/// Locale string with hidden description
/// </summary>
[DataField(required: true)]
public LocId Label { get; init; } = default!;

/// <summary>
/// A player's mind must pass a whitelist check to receive hidden information
/// </summary>
[DataField]
public EntityWhitelist WhitelistMind { get; init; } = new();

/// <summary>
/// A player's body must pass a whitelist check to receive hidden information
/// </summary>
[DataField]
public EntityWhitelist WhitelistBody { get; init; } = new();

/// <summary>
/// The player's mind has to have some job role to access the hidden information
/// </summary>
[DataField]
public List<ProtoId<JobPrototype>> JobRequired { get; init; } = new();

/// <summary>
/// If true, the player needs to go through and whitelist, and have some job. By default, at least one successful checks is sufficient.
/// </summary>
[DataField]
public bool NeedAllCheck { get; init; } = false;
}
38 changes: 38 additions & 0 deletions Content.Server/Corvax/HiddenDescription/HiddenDescriptionSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Content.Server.Mind;
using Content.Shared.Examine;
using Content.Shared.Roles.Jobs;
using Content.Shared.Whitelist;

namespace Content.Server.Corvax.HiddenDescription;

public sealed partial class HiddenDescriptionSystem : EntitySystem
{
[Dependency] private readonly MindSystem _mind = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<HiddenDescriptionComponent, ExaminedEvent>(OnExamine);
}

private void OnExamine(Entity<HiddenDescriptionComponent> hiddenDesc, ref ExaminedEvent args)
{
_mind.TryGetMind(args.Examiner, out var mindId, out var mindComponent);
TryComp<JobComponent>(mindId, out var job);

foreach (var item in hiddenDesc.Comp.Entries)
{
var isJobAllow = job?.Prototype != null && item.JobRequired.Contains(job.Prototype.Value);
var isMindWhitelistPassed = _whitelistSystem.IsValid(item.WhitelistMind, mindId);
var isBodyWhitelistPassed = _whitelistSystem.IsValid(item.WhitelistMind, args.Examiner);
var passed = item.NeedAllCheck
? isMindWhitelistPassed && isBodyWhitelistPassed && isJobAllow
: isMindWhitelistPassed || isBodyWhitelistPassed || isJobAllow;

if (passed)
args.PushMarkup(Loc.GetString(item.Label), hiddenDesc.Comp.PushPriority);
}
}
}
3 changes: 3 additions & 0 deletions Content.Shared/Content.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<Private>false</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Power\Components\" />
</ItemGroup>
<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
<Import Project="..\RobustToolbox\MSBuild\Robust.CompNetworkGenerator.targets" />
</Project>
13 changes: 9 additions & 4 deletions Content.Shared/Localizations/ContentLocalizationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public sealed class ContentLocalizationManager
[Dependency] private readonly ILocalizationManager _loc = default!;

// If you want to change your codebase's language, do it here.
private const string Culture = "en-US";
private const string Culture = "ru-RU"; // Corvax-Localization
private const string FallbackCulture = "en-US"; // Corvax-Localization

/// <summary>
/// Custom format strings used for parsing and displaying minutes:seconds timespans.
Expand All @@ -26,8 +27,11 @@ public sealed class ContentLocalizationManager
public void Initialize()
{
var culture = new CultureInfo(Culture);
var fallbackCulture = new CultureInfo(FallbackCulture); // Corvax-Localization

_loc.LoadCulture(culture);
_loc.LoadCulture(fallbackCulture); // Corvax-Localization
_loc.SetFallbackCluture(fallbackCulture); // Corvax-Localization
_loc.AddFunction(culture, "PRESSURE", FormatPressure);
_loc.AddFunction(culture, "POWERWATTS", FormatPowerWatts);
_loc.AddFunction(culture, "POWERJOULES", FormatPowerJoules);
Expand All @@ -36,6 +40,7 @@ public void Initialize()
_loc.AddFunction(culture, "LOC", FormatLoc);
_loc.AddFunction(culture, "NATURALFIXED", FormatNaturalFixed);
_loc.AddFunction(culture, "NATURALPERCENT", FormatNaturalPercent);
_loc.AddFunction(culture, "MANY", FormatMany); // TODO: Temporary fix for MANY() fluent errors. Remove after resolve errors.


/*
Expand Down Expand Up @@ -114,8 +119,8 @@ public static string FormatList(List<string> list)
{
<= 0 => string.Empty,
1 => list[0],
2 => $"{list[0]} and {list[1]}",
_ => $"{string.Join(", ", list.GetRange(0, list.Count - 1))}, and {list[^1]}"
2 => $"{list[0]} и {list[1]}",
_ => $"{string.Join(", ", list.GetRange(0, list.Count - 1))}, и {list[^1]}"
};
}

Expand Down Expand Up @@ -230,4 +235,4 @@ private static ILocValue FormatUnits(LocArgs args)
return new LocValueString(res);
}
}
}
}
12 changes: 12 additions & 0 deletions Content.Shared/Preferences/BackpackPreference.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Content.Shared.Preferences
{
/// <summary>
/// The backpack preference for a profile. Stored in database!
/// </summary>
public enum BackpackPreference
{
Backpack,
Satchel,
Duffelbag
}
}
11 changes: 11 additions & 0 deletions Content.Shared/Preferences/ClothingPreference.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Shared.Preferences
{
/// <summary>
/// The clothing preference for a profile. Stored in database!
/// </summary>
public enum ClothingPreference
{
Jumpsuit,
Jumpskirt
}
}
Binary file added Resources/Audio/Corvax/Adminbuse/ai_malf_1.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/ai_malf_2.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/ai_malf_3.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/ai_malf_4.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/aimalf.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/artillery.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/i-storm1.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/irod.ogg
Binary file not shown.
1 change: 1 addition & 0 deletions Resources/Audio/Corvax/Adminbuse/licenses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
All sounds in directory are taken from TauCeti github (licensed under CC-BY-SA by 3.0) at commit https://github.com/TauCetiStation/TauCetiClassic/commit/92d2767dbb39f28540f78d5055e7be1eb7acee98
Binary file added Resources/Audio/Corvax/Adminbuse/noert.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/outbreak5.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/portal.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/vox_arrival.ogg
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/vox_returns.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Resources/Audio/Corvax/Adminbuse/yesert.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Resources/Audio/Corvax/Announcements/centcomm.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Resources/Audio/Corvax/Announcements/flux.ogg
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions Resources/Audio/Corvax/Announcements/licenses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
All sounds in directory are taken from TauCeti github (licensed under CC-BY-SA by 3.0) at commit https://github.com/TauCetiStation/TauCetiClassic/commit/92d2767dbb39f28540f78d5055e7be1eb7acee98
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions Resources/Audio/Corvax/Lobby/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["title2.ogg"]
license: "CC-BY-NC-SA-3.0"
copyright: "https://github.com/tgstation/tgstation/blob/44db038c2cf7c6dade4300bea54cff06e98caf6a/sound/ambience/title2.ogg"
source: "https://www.youtube.com/watch?v=vHo7npmGcHU"
Binary file added Resources/Audio/Corvax/Lobby/title2.ogg
Binary file not shown.
4 changes: 4 additions & 0 deletions Resources/Audio/Corvax/StationEvents/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["level.ogg"]
license: "CC-BY-3.0"
copyright: "Created by Dapper Husky"
source: "https://www.youtube.com/watch?v=Lyj-MZSAA9o"
Binary file added Resources/Audio/Corvax/StationEvents/level.ogg
Binary file not shown.
4 changes: 4 additions & 0 deletions Resources/Audio/Corvax/Weapons/Guns/Cock/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["shotgun_cock.ogg"]
license: "CC-BY-SA-3.0"
copyright: "tgstation"
source: "https://github.com/tgstation/tgstation/blob/c735e90ce54a0250573d2446eb2723057e104faf/sound/weapons/gun/shotgun/rack.ogg"
Binary file not shown.
14 changes: 14 additions & 0 deletions Resources/Audio/Corvax/Weapons/Guns/Gunshots/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- files: ["shotgun_alt.ogg"]
license: "CC-BY-SA-3.0"
copyright: "tgstation"
source: "https://github.com/tgstation/tgstation/blob/5736656139713c802033b9457a2a9d058211bd85/sound/weapons/gun/shotgun/shot_alt.ogg"

- files: ["shotgun_metal.ogg"]
license: "CC-BY-SA-3.0"
copyright: "Skyrat-tg"
source: "https://github.com/Skyrat-SS13/Skyrat-tg/blob/771eeab6379a74c1f850b59237f25dc8da87afa6/modular_skyrat/modules/aesthetics/guns/sound/shotgun_light.ogg"

- files: ["shotgun_auto.ogg", "shotgun_pipe.ogg", "shotgun_sawed.ogg"]
license: "CC-BY-SA-3.0"
copyright: "ss220/Paradise, shotgun_auto.ogg is 1shotgun_auto.ogg, shotgun_pipe.ogg is 1shotgunpipe.ogg and shotgun_sawed.ogg is 1shotgun.ogg"
source: "https://github.com/ss220-space/Paradise/commit/d5183fa98cbef14c4b28e076707a69429f12c30a"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/borgs.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ActionViewLaws = View Laws
.desc = View the laws that you must follow.
6 changes: 6 additions & 0 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/crit.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ent-ActionCritSuccumb = Succumb
.desc = Accept your fate.
ent-ActionCritFakeDeath = Fake Death
.desc = Pretend to take your final breath while staying alive.
ent-ActionCritLastWords = Say Last Words
.desc = Whisper your last words to anyone nearby, and then succumb to your fate. You only have 30 characters to work with.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ActionToggleInternals = Toggle Internals
.desc = Breathe from the equipped gas tank. Also requires equipped breath mask.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-ItemActionExample = item action example
.desc = for testing item actions
.suffix = DEBUG
6 changes: 6 additions & 0 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/mech.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ent-ActionMechCycleEquipment = Cycle
.desc = Cycles currently selected equipment
ent-ActionMechOpenUI = Control Panel
.desc = Opens the control panel for the mech
ent-ActionMechEject = Eject
.desc = Ejects the pilot from the mech
12 changes: 12 additions & 0 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/ninja.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ent-ActionToggleNinjaGloves = Toggle ninja gloves
.desc = Toggles all glove actions on left click. Includes your doorjack, draining power, stunning enemies, downloading research and calling in a threat.
ent-ActionCreateThrowingStar = Create throwing star
.desc = Channels suit power into creating a throwing star that deals extra stamina damage.
ent-ActionRecallKatana = Recall katana
.desc = Teleports the Energy Katana linked to this suit to its wearer, cost based on distance.
ent-ActionNinjaEmp = EM Burst
.desc = Disable any nearby technology with an electro-magnetic pulse.
ent-ActionTogglePhaseCloak = Phase cloak
.desc = Toggles your suit's phase cloak. Beware that if you are hit, all abilities are disabled for 5 seconds, including your cloak!
ent-ActionEnergyKatanaDash = Katana dash
.desc = Teleport to anywhere you can see, if your Energy Katana is in your hand.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ent-ActionRevertPolymorph = Revert
.desc = Revert back into your original form.
ent-ActionPolymorph = { "" }
.desc = { "" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ent-ActionRevenantShop = Shop
.desc = Opens the ability shop.
ent-ActionRevenantDefile = Defile
.desc = Costs 30 Essence.
ent-ActionRevenantOverloadLights = Overload Lights
.desc = Costs 40 Essence.
ent-ActionRevenantMalfunction = Malfunction
.desc = Costs 60 Essence.
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/speech.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ActionConfigureMeleeSpeech = Set Battlecry
.desc = Set a custom battlecry for when you attack!
4 changes: 4 additions & 0 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/spider.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ent-ActionSpiderWeb = Spider Web
.desc = Spawns a web that slows your prey down.
ent-ActionSericulture = Weave silk
.desc = Weave a bit of silk for use in arts and crafts.
42 changes: 42 additions & 0 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/types.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ent-ActionScream = Scream
.desc = AAAAAAAAAAAAAAAAAAAAAAAAA
ent-ActionTurnUndead = Turn Undead
.desc = Succumb to your infection and become a zombie.
ent-ActionToggleLight = Toggle Light
.desc = Turn the light on and off.
ent-ActionOpenStorageImplant = Open Storage Implant
.desc = Opens the storage implant embedded under your skin
ent-ActionActivateMicroBomb = Activate Microbomb
.desc = Activates your internal microbomb, completely destroying you and your equipment
ent-ActionActivateFreedomImplant = Break Free
.desc = Activating your freedom implant will free you from any hand restraints
ent-ActionOpenUplinkImplant = Open Uplink
.desc = Opens the syndicate uplink embedded under your skin
ent-ActionActivateEmpImplant = Activate EMP
.desc = Triggers a small EMP pulse around you
ent-ActionActivateDnaScramblerImplant = Scramble DNA
.desc = Randomly changes your name and appearance.
ent-ActionToggleSuitPiece = Toggle Suit Piece
.desc = Remember to equip the important pieces of your suit before going into action.
ent-ActionCombatModeToggle = [color=red]Combat Mode[/color]
.desc = Enter combat mode
ent-ActionCombatModeToggleOff = [color=red]Combat Mode[/color]
.desc = Enter combat mode
ent-ActionChangeVoiceMask = Set name
.desc = Change the name others hear to something else.
ent-ActionVendingThrow = Dispense Item
.desc = Randomly dispense an item from your stock.
ent-ActionArtifactActivate = Activate Artifact
.desc = Immediately activates your current artifact node.
ent-ActionToggleBlock = Block
.desc = Raise or lower your shield.
ent-ActionClearNetworkLinkOverlays = Clear network link overlays
.desc = Clear network link overlays.
ent-ActionAnimalLayEgg = Lay egg
.desc = Uses hunger to lay an egg.
ent-ActionSleep = Sleep
.desc = Go to sleep.
ent-ActionWake = Wake up
.desc = Stop sleeping.
ent-ActionActivateHonkImplant = Honk
.desc = Activates your honking implant, which will produce the signature sound of the clown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ent-BaseHumanOrgan = { ent-BaseItem }
.desc = { ent-BaseItem.desc }
.suffix = { "" }
ent-OrganHumanBrain = brain
.desc = The source of incredible, unending intelligence. Honk.
.suffix = { "" }
ent-OrganHumanEyes = eyes
.desc = I see you!
.suffix = { "" }
ent-OrganHumanTongue = tongue
.desc = A fleshy muscle mostly used for lying.
.suffix = { "" }
ent-OrganHumanAppendix = appendix
.desc = { ent-BaseHumanOrgan.desc }
.suffix = { "" }
ent-OrganHumanEars = ears
.desc = There are three parts to the ear. Inner, middle and outer. Only one of these parts should normally be visible.
.suffix = { "" }
ent-OrganHumanLungs = lungs
.desc = Filters oxygen from an atmosphere, which is then sent into the bloodstream to be used as an electron carrier.
.suffix = { "" }
ent-OrganHumanHeart = heart
.desc = I feel bad for the heartless bastard who lost this.
.suffix = { "" }
ent-OrganHumanStomach = stomach
.desc = Gross. This is hard to stomach.
.suffix = { "" }
ent-OrganHumanLiver = liver
.desc = Pairing suggestion: chianti and fava beans.
.suffix = { "" }
ent-OrganHumanKidneys = kidneys
.desc = Filters toxins from the bloodstream.
.suffix = { "" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ent-OrganRatLungs = { ent-OrganHumanLungs }
.suffix = rat
.desc = { ent-OrganHumanLungs.desc }
ent-OrganRatStomach = { ent-OrganAnimalStomach }
.suffix = rat
.desc = { ent-OrganAnimalStomach.desc }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-OrganReptilianStomach = { ent-OrganAnimalStomach }
.desc = { ent-OrganAnimalStomach.desc }
.suffix = { "" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ent-SentientSlimeCore = sentient slime core
.desc = The source of incredible, unending gooeyness.
.suffix = { "" }
ent-OrganSlimeLungs = slime gas sacs
.desc = Collects nitrogen, which slime cells use for maintenance.
.suffix = { "" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ent-MechanismEMPStriker = EMP striker
.desc = When activated, this arm implant will apply a small EMP on the target of a physical strike for 10 watts per use.
.suffix = { "" }
ent-MechanismHonkModule = HONK module 3000
.desc = Mandatory implant for all clowns after the Genevo Convention of 2459.
.suffix = { "" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-OrganVoxLungs = { ent-OrganHumanLungs }
.suffix = vox
.desc = { ent-OrganHumanLungs.desc }
12 changes: 12 additions & 0 deletions Resources/Locale/en-US/ss14-ru/prototypes/body/organs/animal.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ent-BaseAnimalOrgan = { ent-BaseItem }
.desc = { ent-BaseItem.desc }
ent-OrganAnimalLungs = lungs
.desc = { ent-BaseAnimalOrgan.desc }
ent-OrganAnimalStomach = stomach
.desc = { ent-BaseAnimalOrgan.desc }
ent-OrganAnimalLiver = liver
.desc = { ent-BaseAnimalOrgan.desc }
ent-OrganAnimalHeart = heart
.desc = { ent-BaseAnimalOrgan.desc }
ent-OrganAnimalKidneys = kidneys
.desc = { ent-BaseAnimalOrgan.desc }
Loading