Merge remote-tracking branch 'WD-core/master' into upstream-core
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
|
||||
xmlns:at="clr-namespace:Content.Client.Administration.UI.Tabs.AdminTab"
|
||||
xmlns:wd="clr-namespace:Content.Client._White.Administration"
|
||||
Margin="4"
|
||||
MinSize="50 50">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
@@ -18,6 +19,7 @@
|
||||
<cc:CommandButton Command="adminlogs" Text="{Loc admin-player-actions-window-admin-logs}"/>
|
||||
<cc:CommandButton Command="faxui" Text="{Loc admin-player-actions-window-admin-fax}"/>
|
||||
<cc:UICommandButton Command="enableShuttleCall" Text="{Loc admin-player-actions-window-shuttle-call}" WindowType="{x:Type at:AdminShuttleCallEnableWindow}"/>
|
||||
<cc:UICommandButton Text="Накрутка времени" WindowType="{x:Type wd:HoursPanel }"/>
|
||||
</GridContainer>
|
||||
</BoxContainer>
|
||||
</Control>
|
||||
|
||||
29
Content.Client/_White/Administration/HoursPanel.xaml
Normal file
29
Content.Client/_White/Administration/HoursPanel.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<DefaultWindow
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
|
||||
Title="Накрутка времени" MinSize="300 500">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label Text="Игрок" MinWidth="100" />
|
||||
<Control MinWidth="50" />
|
||||
<LineEdit Name="PlayerNameLine" MinWidth="100" HorizontalExpand="True" />
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label Text="Время" MinWidth="100" />
|
||||
<Control MinWidth="50" />
|
||||
<LineEdit Name="MinutesLine" MinWidth="100" HorizontalExpand="True" PlaceHolder="минуты" />
|
||||
<Button Name="HourButton" Text="+1h (0)"/>
|
||||
</BoxContainer>
|
||||
<OptionButton Name="RoleOption" />
|
||||
<cc:PlayerListControl Name="PlayerList" VerticalExpand="True" MinWidth="200"/>
|
||||
<Button Name="SubmitButton" Text="Добавить время" />
|
||||
<Button Name="SaveButton" Text="Сохранить изменения в БД" Disabled="true" Margin="0 6 0 3"/>
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<PanelContainer StyleClasses="LowDivider" Margin="0 4 0 2" />
|
||||
<BoxContainer Orientation="Horizontal" Margin="10 2 4 0" VerticalAlignment="Bottom">
|
||||
<Label Text="Проверяйте консоль на результат работы" StyleClasses="WindowFooterText"
|
||||
HorizontalAlignment="Left" HorizontalExpand="True" Margin="0 0 5 0" />
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</DefaultWindow>
|
||||
104
Content.Client/_White/Administration/HoursPanel.xaml.cs
Normal file
104
Content.Client/_White/Administration/HoursPanel.xaml.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Roles;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
using static Robust.Client.UserInterface.Controls.LineEdit;
|
||||
|
||||
namespace Content.Client._White.Administration;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
[UsedImplicitly]
|
||||
public sealed partial class HoursPanel : DefaultWindow
|
||||
{
|
||||
public HoursPanel()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
var roles = new Dictionary<int, string>();
|
||||
PlayerNameLine.OnTextChanged += _ => OnNamesChanged();
|
||||
PlayerList.OnSelectionChanged += OnPlayerSelectionChanged;
|
||||
HourButton.OnPressed += _ => AddMinutes(60);
|
||||
MinutesLine.OnTextChanged += UpdateButtonsText;
|
||||
RoleOption.OnItemSelected += args => RoleOption.SelectId(args.Id);
|
||||
SubmitButton.OnPressed += _ => OnSubmitButtonOnPressed(roles);
|
||||
SaveButton.OnPressed += _ => OnSaveButtonOnPressed();
|
||||
OnNamesChanged();
|
||||
InitRoleList(roles);
|
||||
|
||||
}
|
||||
private void InitRoleList(Dictionary<int, string> roles)
|
||||
{
|
||||
var roleInd = 0;
|
||||
RoleOption.AddItem("общее", roleInd);
|
||||
roles.Add(roleInd, "Overall");
|
||||
roleInd++;
|
||||
foreach (var dep in IoCManager.Resolve<IPrototypeManager>().EnumeratePrototypes<DepartmentPrototype>())
|
||||
{
|
||||
foreach (var role in dep.Roles)
|
||||
{
|
||||
RoleOption.AddItem(Loc.GetString($"Job{role.Id}"), roleInd);
|
||||
roles.Add(roleInd, $"Job{role.Id}");
|
||||
roleInd++;
|
||||
}
|
||||
}
|
||||
RoleOption.SelectId(0);
|
||||
}
|
||||
|
||||
private bool TryGetMinutes(string str, out uint minutes)
|
||||
{
|
||||
minutes = 0;
|
||||
return !string.IsNullOrWhiteSpace(str) && uint.TryParse(str, out minutes);
|
||||
}
|
||||
|
||||
private void AddMinutes(uint add)
|
||||
{
|
||||
if (!TryGetMinutes(MinutesLine.Text, out var minutes))
|
||||
minutes = 0;
|
||||
|
||||
MinutesLine.Text = $"{minutes + add}";
|
||||
UpdateButtons(minutes + add);
|
||||
OnNamesChanged();
|
||||
}
|
||||
|
||||
private void UpdateButtonsText(LineEditEventArgs obj)
|
||||
{
|
||||
if (!TryGetMinutes(obj.Text, out var minutes))
|
||||
return;
|
||||
|
||||
UpdateButtons(minutes);
|
||||
OnNamesChanged();
|
||||
}
|
||||
|
||||
private void UpdateButtons(uint minutes)
|
||||
{
|
||||
HourButton.Text = $"+1h ({minutes / 60})";
|
||||
}
|
||||
|
||||
private void OnNamesChanged()
|
||||
{
|
||||
SubmitButton.Disabled = string.IsNullOrEmpty(PlayerNameLine.Text) || !TryGetMinutes(MinutesLine.Text, out _);
|
||||
}
|
||||
|
||||
private void OnPlayerSelectionChanged(PlayerInfo? player)
|
||||
{
|
||||
PlayerNameLine.Text = player?.Username ?? string.Empty;
|
||||
OnNamesChanged();
|
||||
}
|
||||
|
||||
private void OnSubmitButtonOnPressed(Dictionary<int, string> roles)
|
||||
{
|
||||
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
|
||||
$"playtime_addrole {PlayerNameLine.Text} {roles[RoleOption.SelectedId]} {MinutesLine.Text}");
|
||||
SaveButton.Disabled = false;
|
||||
}
|
||||
|
||||
private void OnSaveButtonOnPressed()
|
||||
{
|
||||
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
|
||||
$"playtime_save {PlayerNameLine.Text}");
|
||||
SaveButton.Disabled = true;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public sealed class PlayTimeAddRoleCommand : IConsoleCommand
|
||||
}
|
||||
|
||||
_playTimeTracking.AddTimeToTracker(player, role, TimeSpan.FromMinutes(minutes));
|
||||
var time = _playTimeTracking.GetOverallPlaytime(player);
|
||||
var time = _playTimeTracking.GetPlayTimeForTracker(player, role);
|
||||
shell.WriteLine(Loc.GetString("cmd-playtime_addrole-succeed",
|
||||
("username", userName),
|
||||
("role", role),
|
||||
|
||||
@@ -2,7 +2,9 @@ using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Localizations;
|
||||
using Content.Shared.Tag;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Prototypes;
|
||||
using System.Linq;
|
||||
@@ -35,6 +37,14 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
[JsonPropertyName("ignoreResistances")]
|
||||
public bool IgnoreResistances = true;
|
||||
|
||||
/// <summary>
|
||||
/// WD.
|
||||
/// Whether this will work through hardsuits or not.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
[JsonPropertyName("pierceHardsuit")]
|
||||
public bool PierceHardsuit = true;
|
||||
|
||||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
var damages = new List<string>();
|
||||
@@ -112,6 +122,11 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
|
||||
public override void Effect(ReagentEffectArgs args)
|
||||
{
|
||||
if (!PierceHardsuit &&
|
||||
args.EntityManager.System<InventorySystem>().TryGetSlotEntity(args.SolutionEntity, "outerClothing", out var suit) &&
|
||||
args.EntityManager.System<TagSystem>().HasTag(suit.Value, "Hardsuit"))
|
||||
return; // WD
|
||||
|
||||
var scale = ScaleByQuantity ? args.Quantity : FixedPoint2.New(1);
|
||||
scale *= args.Scale;
|
||||
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
Entries:
|
||||
- author: RavMorgan
|
||||
changes:
|
||||
- message: "\u041A\u0430\u0441\u0442\u043E\u043C\u043D\u044B\u0435 \u043F\u0440\u0438\
|
||||
\u0437\u0440\u0430\u043A\u0438 \u0442\u0435\u043F\u0435\u0440\u044C \u0432\u0441\
|
||||
\u0435\u0433\u0434\u0430 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442!"
|
||||
type: Add
|
||||
id: 148
|
||||
time: '2023-04-28T11:59:36.0000000+00:00'
|
||||
- author: RavMorgan
|
||||
changes:
|
||||
- message: "\u0420\u0430\u0437\u043C\u0435\u0440 \u0447\u0430\u0442\u0430 \u0442\
|
||||
@@ -8919,3 +8911,17 @@
|
||||
id: 647
|
||||
time: '2025-01-01T13:55:57.0000000+00:00'
|
||||
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/855
|
||||
- author: BIG_Zi_348
|
||||
changes:
|
||||
- message: "\u0422\u0435\u043F\u0435\u0440\u044C \u0441\u0438\u043D\u0442\u0435\u043F\
|
||||
\u043B\u043E\u0442\u044C, \u0441\u0443\u043B\u044C\u0444\u0430\u0434\u0438\u0430\
|
||||
\u0437\u0438\u043D \u0441\u0435\u0440\u0435\u0431\u0440\u0430 \u0438 \u043A\u0440\
|
||||
\u043E\u0432\u043E\u043E\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\
|
||||
\u0430\u044E\u0449\u0430\u044F \u043F\u0443\u0434\u0440\u0430 \u043D\u0435 \u0440\
|
||||
\u0430\u0431\u043E\u0442\u0430\u044E\u0442 \u043D\u0430 \u043F\u0435\u0440\u0441\
|
||||
\u043E\u043D\u0430\u0436\u0430\u0445 \u0432 \u0441\u043A\u0430\u0444\u0430\u043D\
|
||||
\u0434\u0440\u0430\u0445."
|
||||
type: Tweak
|
||||
id: 648
|
||||
time: '2025-01-01T19:37:15.0000000+00:00'
|
||||
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/867
|
||||
|
||||
@@ -56,6 +56,7 @@ job-name-bomzh = бомж
|
||||
# Role timers - Make these alphabetical or I cut you
|
||||
JobAtmosphericTechnician = атмосферный техник
|
||||
JobBartender = бармен
|
||||
JobBomzh = бомж
|
||||
JobBorg = борг
|
||||
JobBotanist = ботаник
|
||||
JobBoxer = боксер
|
||||
@@ -69,7 +70,7 @@ JobChiefEngineer = старший инженер
|
||||
JobChiefMedicalOfficer = главный врач
|
||||
JobClown = клоун
|
||||
JobDetective = детектив
|
||||
JobBrigmedic = Бригмедик
|
||||
JobBrigmedic = бригмедик
|
||||
JobERTEngineer = инженер ОБР
|
||||
JobERTJanitor = уборщик ОБР
|
||||
JobERTLeader = лидер ОБР
|
||||
@@ -77,9 +78,11 @@ JobERTMedical = медик ОБР
|
||||
JobERTSecurity = офицер безопасности ОБР
|
||||
JobHeadOfPersonnel = глава персонала
|
||||
JobHeadOfSecurity = глава службы безопасности
|
||||
JobInspector = инспектор
|
||||
JobJanitor = уборщик
|
||||
JobLawyer = юрист
|
||||
JobLibrarian = библиотекарь
|
||||
JobMaid = прислуга
|
||||
JobMedicalDoctor = врач
|
||||
JobMedicalIntern = интерн
|
||||
JobMime = мим
|
||||
@@ -105,3 +108,4 @@ JobStationEngineer = инженер
|
||||
JobTechnicalAssistant = технический ассистент
|
||||
JobWarden = смотритель
|
||||
JobZookeeper = зоотехник
|
||||
JobVisitor = посетитель
|
||||
|
||||
@@ -6,14 +6,14 @@ parse-session-fail = Не найдена сессия для '{ $username }'
|
||||
# - playtime_addoverall
|
||||
cmd-playtime_addoverall-desc = Добавляет указанное число минут к общему игровому времени игрока
|
||||
cmd-playtime_addoverall-help = Использование: { $command } <user name> <minutes>
|
||||
cmd-playtime_addoverall-succeed = Общее игровое время { $username } увеличено на { TOSTRING($time, "dddd\\:hh\\:mm") }.
|
||||
cmd-playtime_addoverall-succeed = Общее игровое время { $username } увеличено до { TOSTRING($time, "dddd\\:hh\\:mm") }.
|
||||
cmd-playtime_addoverall-arg-user = <user name>
|
||||
cmd-playtime_addoverall-arg-minutes = <minutes>
|
||||
cmd-playtime_addoverall-error-args = Ожидается ровно два аргумента
|
||||
# - playtime_addrole
|
||||
cmd-playtime_addrole-desc = Добавляет указанное число минут к времени игрока на определённой роли
|
||||
cmd-playtime_addrole-help = Использование: { $command } <user name> <role> <minutes>
|
||||
cmd-playtime_addrole-succeed = Игровое время для { $username } / \'{ $role }\' увеличено на { TOSTRING($time, "dddd\\:hh\\:mm") }.
|
||||
cmd-playtime_addrole-succeed = Игровое время для { $username } / \'{ $role }\' увеличено до { TOSTRING($time, "dddd\\:hh\\:mm") }.
|
||||
cmd-playtime_addrole-arg-user = <user name>
|
||||
cmd-playtime_addrole-arg-role = <role>
|
||||
cmd-playtime_addrole-arg-minutes = <minutes>
|
||||
|
||||
@@ -151,5 +151,5 @@ reagent-desc-psicodine = Подавляет тревогу и прочие фо
|
||||
reagent-name-potassium-iodide = йодистый калий
|
||||
reagent-desc-potassium-iodide = Снижает поражающее действие от радиации на 90%. Только профилактическое применение.
|
||||
|
||||
reagent-name-haloperidol = галоперидол
|
||||
reagent-desc-haloperidol = Выводит из организма большую часть стимулирующих или галлюцигенных химикатов. Вызывает сонливость.
|
||||
reagent-name-haloperidol = галоперидол
|
||||
reagent-desc-haloperidol = Выводит из организма большую часть стимулирующих или галлюцигенных химикатов. Вызывает сонливость.
|
||||
|
||||
1
Resources/Locale/ru-RU/ui/misc.ftl
Normal file
1
Resources/Locale/ru-RU/ui/misc.ftl
Normal file
@@ -0,0 +1 @@
|
||||
Filter = Фильтр
|
||||
@@ -1162,7 +1162,7 @@
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
min: 12
|
||||
|
||||
|
||||
- type: reagent
|
||||
id: Opporozidone #Name based of an altered version of the startreck chem "Opporozine"
|
||||
name: reagent-name-opporozidone
|
||||
@@ -1249,6 +1249,7 @@
|
||||
effects:
|
||||
- !type:HealthChange
|
||||
scaleByQuantity: true
|
||||
pierceHardsuit: false
|
||||
damage:
|
||||
groups:
|
||||
Brute: -1.25
|
||||
@@ -1280,6 +1281,7 @@
|
||||
effects:
|
||||
- !type:HealthChange
|
||||
scaleByQuantity: true
|
||||
pierceHardsuit: false
|
||||
damage:
|
||||
types:
|
||||
Heat: -2
|
||||
@@ -1307,6 +1309,7 @@
|
||||
effects:
|
||||
- !type:HealthChange
|
||||
scaleByQuantity: true
|
||||
pierceHardsuit: false
|
||||
damage:
|
||||
groups:
|
||||
Brute: -2
|
||||
|
||||
Reference in New Issue
Block a user