Skip to content

Commit

Permalink
BugFixes (#1121)
Browse files Browse the repository at this point in the history
## Описание PR
Сделаны багофиксы прототипов и другого.

## Почему / Баланс
**Ссылки на публикации в Discord**
https://discord.com/channels/901772674865455115/1335154220357124137 -
_Шлюз церкви_
https://discord.com/channels/901772674865455115/1337870092452626645 -
_Языковой паучий имплант_
https://discord.com/channels/901772674865455115/1340025788371701822 -
_Вавилонская книга_
https://discord.com/channels/901772674865455115/1341855420050051072 -
_Ролики_
https://discord.com/channels/901772674865455115/1341839894925807626 -
_Роли Юр. департамента в картах Avrit, Kerberos_
https://discord.com/channels/901772674865455115/1342572743513866363 -
_Разделение времени на часы и минуты в подсказках лобби выбора
приоритета ролей_

## Техническая информация
Неочевидное с прототипами Шлюзов: 

> _Паренты шлюзов изменены условно, указание на инженерный департамент
никак не влияет на работы шлюзов - компоненты добавлены условно, чтобы
не появлялся баг у стеклянных шлюзов, (после открытия) превращающиеся в
обычные, через которые пропадает возможность видеть._

Время-подсказки в меню выбора приоритета ролей:

> Функция 'FormatPlaytime' была разделена на FormatPlaytime(время в
hours) и FormatPlaytimeMinutes(время в minutes), чтобы можно было
использовать эти переменные времени в ftl строках раздельно.

## Медиа

![книга](https://github.com/user-attachments/assets/5d167813-0133-4fde-b90a-a1d9a851c3ca)

![паучийИмплант](https://github.com/user-attachments/assets/1e357de1-f50d-46c7-ac84-2b21ac782e4d)

![ЦерквиШлюз](https://github.com/user-attachments/assets/726c1ad8-4e84-404a-837b-0d79adde3f2a)



## Требования
- [X] Я прочитал(а) и следую [Руководство по созданию пулл
реквестов](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html).
Я понимаю, что в противном случае мой ПР может быть закрыт по усмотрению
мейнтейнера.
- [X] Я добавил скриншоты/видео к этому пулл реквесту, демонстрирующие
его изменения в игре, **или** этот пулл реквест не требует демонстрации
в игре

**Чейнджлог**
:cl: Кейси
- fix: Вавилонскую книгу можно положить в книжный шкаф. Починен Паучий
имплантер. Закрытый стеклянный шлюз церкви теперь соответствует своему
названию. Исправлен баг ERROR роликов. Появились новые роли Юр.
департамента в Avrit, Kerberos. Разделено время в подсказках лобби
выбора приоритетов ролей

---------

Co-authored-by: Schrödinger <[email protected]>
  • Loading branch information
BitBoxxxer and Schrodinger71 authored Feb 24, 2025
1 parent 8ddf1ab commit 7beb8de
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 15 deletions.
23 changes: 20 additions & 3 deletions Content.Shared/Localizations/ContentLocalizationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public void Initialize()
_loc.AddFunction(culture, "NATURALFIXED", FormatNaturalFixed);
_loc.AddFunction(culture, "NATURALPERCENT", FormatNaturalPercent);
_loc.AddFunction(culture, "PLAYTIME", FormatPlaytime);
_loc.AddFunction(culture, "PLAYTIMEMINUTES", FormatPlaytimeMinutes); // ADT Change


/*
Expand Down Expand Up @@ -150,14 +151,20 @@ public static string FormatDirection(Direction dir)
/// <summary>
/// Formats playtime as hours and minutes.
/// </summary>
public static string FormatPlaytime(TimeSpan time)
public static string FormatPlaytime(TimeSpan time) // ADT changes start
{
time = TimeSpan.FromMinutes(Math.Ceiling(time.TotalMinutes));
var hours = (int)time.TotalHours;
var minutes = time.Minutes;
return Loc.GetString($"zzzz-fmt-playtime", ("hours", hours), ("minutes", minutes));
return Loc.GetString($"zzzz-fmt-playtime", ("hours", hours));
}

public static string FormatPlaytimeMinutes(TimeSpan time)
{
time = TimeSpan.FromMinutes(Math.Ceiling(time.TotalMinutes));
var minutes = (int)Math.Ceiling(time.TotalMinutes);
return Loc.GetString($"zzzz-fmt-playtime-minutes", ("minutes", minutes));
}// ADT changes end

private static ILocValue FormatLoc(LocArgs args)
{
var id = ((LocValueString) args.Args[0]).Value;
Expand Down Expand Up @@ -256,5 +263,15 @@ private static ILocValue FormatPlaytime(LocArgs args)
}
return new LocValueString(FormatPlaytime(time));
}

private static ILocValue FormatPlaytimeMinutes(LocArgs args) // ADT Changes start
{
var time = TimeSpan.Zero;
if (args.Args is { Count: > 0 } && args.Args[0].Value is TimeSpan timeArg)
{
time = timeArg;
}
return new LocValueString(FormatPlaytimeMinutes(time));
} // ADT Changes end
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public override bool Check(IEntityManager entManager,
var deptDiffSpan = Time - playtime;
var deptDiff = deptDiffSpan.TotalMinutes;
var formattedDeptDiff = ContentLocalizationManager.FormatPlaytime(deptDiffSpan);
var formattedDeptDiffMinutes = ContentLocalizationManager.FormatPlaytimeMinutes(deptDiffSpan); // ADT change
var nameDepartment = "role-timer-department-unknown";

if (protoManager.TryIndex(Department, out var departmentIndexed))
Expand All @@ -66,6 +67,7 @@ public override bool Check(IEntityManager entManager,
reason = FormattedMessage.FromMarkupPermissive(Loc.GetString(
"role-timer-department-insufficient",
("time", formattedDeptDiff),
("timeminutes", formattedDeptDiffMinutes), // ADT change
("department", Loc.GetString(nameDepartment)),
("departmentColor", department.Color.ToHex())));
return false;
Expand All @@ -76,6 +78,7 @@ public override bool Check(IEntityManager entManager,
reason = FormattedMessage.FromMarkupPermissive(Loc.GetString(
"role-timer-department-too-high",
("time", formattedDeptDiff),
("timeminutes", formattedDeptDiffMinutes), // ADT change
("department", Loc.GetString(nameDepartment)),
("departmentColor", department.Color.ToHex())));
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public override bool Check(IEntityManager entManager,
var overallDiffSpan = Time - overallTime;
var overallDiff = overallDiffSpan.TotalMinutes;
var formattedOverallDiff = ContentLocalizationManager.FormatPlaytime(overallDiffSpan);
var formattedOverallDiffMinutes = ContentLocalizationManager.FormatPlaytimeMinutes(overallDiffSpan); // ADT change

if (!Inverted)
{
Expand All @@ -37,14 +38,17 @@ public override bool Check(IEntityManager entManager,

reason = FormattedMessage.FromMarkupPermissive(Loc.GetString(
"role-timer-overall-insufficient",
("time", formattedOverallDiff)));
("time", formattedOverallDiff),
("timeminutes", formattedOverallDiffMinutes))); //ADT Changes
return false;
}

if (overallDiff <= 0 || overallTime >= Time)
{
reason = FormattedMessage.FromMarkupPermissive(Loc.GetString("role-timer-overall-too-high",
("time", formattedOverallDiff)));
reason = FormattedMessage.FromMarkupPermissive(Loc.GetString(
"role-timer-overall-too-high",
("time", formattedOverallDiff),
("timeminutes", formattedOverallDiffMinutes))); //ADT Changes
return false;
}

Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/Roles/JobRequirement/RoleTimeRequirement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public override bool Check(IEntityManager entManager,
var roleDiffSpan = Time - roleTime;
var roleDiff = roleDiffSpan.TotalMinutes;
var formattedRoleDiff = ContentLocalizationManager.FormatPlaytime(roleDiffSpan);
var formattedRoleDiffMinutes = ContentLocalizationManager.FormatPlaytimeMinutes(roleDiffSpan); // ADT change
var departmentColor = Color.Yellow;

if (!entManager.EntitySysManager.TryGetEntitySystem(out SharedJobSystem? jobSystem))
Expand All @@ -59,6 +60,7 @@ public override bool Check(IEntityManager entManager,
reason = FormattedMessage.FromMarkupPermissive(Loc.GetString(
"role-timer-role-insufficient",
("time", formattedRoleDiff),
("timeminutes", formattedRoleDiffMinutes), // ADT change
("job", indexedJob.LocalizedName),
("departmentColor", departmentColor.ToHex())));
return false;
Expand All @@ -69,6 +71,7 @@ public override bool Check(IEntityManager entManager,
reason = FormattedMessage.FromMarkupPermissive(Loc.GetString(
"role-timer-role-too-high",
("time", formattedRoleDiff),
("timeminutes", formattedRoleDiffMinutes), // ADT change
("job", indexedJob.LocalizedName),
("departmentColor", departmentColor.ToHex())));
return false;
Expand Down
4 changes: 3 additions & 1 deletion Resources/Locale/ru-RU/_lib.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ zzzz-fmt-power-joules =
*[5] ???
}
# Used internally by the PLAYTIME() function.
zzzz-fmt-playtime = { $hours }ч { $minutes }м
# ADT change
zzzz-fmt-playtime = { $hours }ч.
zzzz-fmt-playtime-minutes = { $minutes }м.
17 changes: 11 additions & 6 deletions Resources/Locale/ru-RU/job/role-requirements.ftl
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
role-timer-department-insufficient = Требуется ещё [color=yellow]{ $time }[/color] минут игры за [color={ $departmentColor }]{ $department }[/color].
role-timer-department-too-high = Требуется на [color=yellow]{ $time }[/color] меньше минут игры за [color={ $departmentColor }]{ $department }[/color]. (Вы пытаетесь играть за роль для новичков?)
role-timer-overall-insufficient = Требуется ещё [color=yellow]{ $time }[/color] минут общего игрового времени.
role-timer-overall-too-high = Требуется на [color=yellow]{ $time }[/color] меньше минут общего игрового времени. (Вы пытаетесь играть за роль для новичков?)
role-timer-role-insufficient = Требуется ещё [color=yellow]{ $time }[/color] минут игры в качестве [color={ $departmentColor }]{ $job }[/color] для этой роли.
role-timer-role-too-high = Требуется на [color=yellow]{ $time }[/color] меньше минут игры в качестве [color={ $departmentColor }]{ $job }[/color] для этой роли. (Вы пытаетесь играть за роль для новичков?)
# ADT changes start
role-timer-department-insufficient = Требуется ещё [color=yellow]{ $time }[/color] игры за [color={ $departmentColor }]{ $department }[/color]. {role-timer-role-minutes}
role-timer-department-too-high = Требуется на [color=yellow]{ $time }[/color] игры за [color={ $departmentColor }]{ $department }[/color]. {role-timer-role-minutes} (Вы пытаетесь играть за роль для новичков?)
role-timer-overall-insufficient = Требуется ещё [color=yellow]{ $time }[/color] общего игрового времени. {role-timer-role-minutes}
role-timer-overall-too-high = Требуется на [color=yellow]{ $time }[/color] меньше общего игрового времени. {role-timer-role-minutes} (Вы пытаетесь играть за роль для новичков?)
role-timer-role-too-high = Требуется на [color=yellow]{ $time }[/color] меньше игры в качестве [color={ $departmentColor }]{ $job }[/color] для этой роли. {role-timer-role-minutes} (Вы пытаетесь играть за роль для новичков?)
role-timer-role-insufficient = Требуется ещё [color=yellow]{ $time }[/color] игры в качестве [color={ $departmentColor }]{ $job }[/color] для этой роли. {role-timer-role-minutes}
# ADT changes end
role-timer-age-too-old = Возраст персонажа должен быть не более [color=yellow]{ $age }[/color] для этой роли.
role-timer-age-too-young = Возраст персонажа должен быть не менее [color=yellow]{ $age }[/color] для этой роли.
role-timer-whitelisted-species = Ваш персонаж должен быть одной из следующих рас для этой роли:
Expand All @@ -13,3 +15,6 @@ role-timer-blacklisted-traits = Ваш персонаж не должен име
role-timer-locked = Закрыто (наведите курсор для подробностей)
role-timer-department-unknown = Неизвестный отдел
role-ban = Эта должность для вас заблокирована.
# ADT Timer for minutes:
role-timer-role-minutes = Точное время в минутах: [color=yellow]{ $timeminutes }[/color]
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
components:
- type: TranslatorImplant
languages:
Nian: BadSpeak
Arachnid: BadSpeak #Moffic

- type: entity
parent: BaseTranslatorImplant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
- type: Item
size: Small
- type: GrantAllLanguagesOnUse
- type: Tag
tags:
- Book

- type: entity
id: ADTVampirismCrystal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
components:
- type: Sprite
sprite: ADT/Structures/Doors/Airlocks/Glass/chaplain.rsi
- type: PaintableAirlock
department: Engineering
- type: Wires
layoutId: AirlockEngineering

- type: entity
parent: AirlockGlass
Expand All @@ -168,6 +172,10 @@
components:
- type: Sprite
sprite: ADT/Structures/Doors/Airlocks/Glass/kitchen.rsi
- type: PaintableAirlock
department: Engineering
- type: Wires
layoutId: AirlockEngineering

- type: entity
parent: AirlockScienceGlass
Expand All @@ -176,6 +184,10 @@
components:
- type: Sprite
sprite: ADT/Structures/Doors/Airlocks/Glass/robotics.rsi
- type: PaintableAirlock
department: Engineering
- type: Wires
layoutId: AirlockEngineering

- type: entity
parent: AirlockCargoGlass
Expand All @@ -184,6 +196,10 @@
components:
- type: Sprite
sprite: ADT/Structures/Doors/Airlocks/Glass/salvage.rsi
- type: PaintableAirlock
department: Engineering
- type: Wires
layoutId: AirlockEngineering

- type: entity
parent: AirlockGlass
Expand All @@ -192,6 +208,10 @@
components:
- type: Sprite
sprite: ADT/Structures/Doors/Airlocks/Glass/theatre.rsi
- type: PaintableAirlock
department: Engineering
- type: Wires
layoutId: AirlockEngineering

- type: entity
parent: AirlockGlass
Expand All @@ -200,6 +220,10 @@
components:
- type: Sprite
sprite: ADT/Structures/Doors/Airlocks/Glass/bar.rsi
- type: PaintableAirlock
department: Engineering
- type: Wires
layoutId: AirlockEngineering

- type: entity
parent: AirlockCommandGlass
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/ADT/Maps/ADTMaps/adt_avrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
SalvageSpecialist: [ 4, 4 ]
CargoTechnician: [ 4, 5 ]
# juridical
Lawyer: [ 1, 1 ]
IAA: [ 1, 1 ]
Magistrat: [ 1, 1 ] #ADT-Roles
#silicon
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/ADT/Maps/ADTMaps/adt_kerberos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
Paramedic: [ 1, 1 ]
Pilot: [ 1, 1] # Corvax-Pilot
Magistrat: [ 1, 1 ] #ADT-Roles
Lawyer: [ 1, 1 ]
IAA: [ 1, 1 ]
ADTRoboticist: [ 1, 2 ] #ADT-Roles
ADTPathologist: [ 1, 1 ] #ADT-Roles
ADTBlueShieldOfficer: [ 1, 1 ] #ADT-Roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
board: [ DoorElectronicsHydroponics ]

- type: entity
parent: ADTChaplainAirlock # ADT-Doors
parent: ADTChaplainAirlockGlass # ADT-Doors
id: AirlockChapelGlassLocked
suffix: Chapel, Locked
components:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"name": "equipped-FEET",
"directions": 4
},
{
"name": "equipped-FEET-reptilian",
"directions": 4
},
{
"name": "inhand-left",
"directions": 4
Expand Down

0 comments on commit 7beb8de

Please sign in to comment.