Merge remote-tracking branch 'WD-core/master' into upstream-7

This commit is contained in:
BIGZi0348
2024-12-03 00:04:31 +03:00
15 changed files with 212 additions and 110 deletions

View File

@@ -0,0 +1,9 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical"
Margin="8 0 8 0">
<BoxContainer Name="Buttons"
Orientation="Vertical"
SeparationOverride="5">
<!-- Buttons are added here by code -->
</BoxContainer>
</BoxContainer>

View File

@@ -10,20 +10,17 @@ using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
public sealed partial class GhostRolesEntry : BoxContainer
public sealed partial class GhostRoleButtonsBox : BoxContainer // WD Edit ahead of wizden upstream
{
private SpriteSystem _spriteSystem;
public event Action<GhostRoleInfo>? OnRoleSelected;
public event Action<GhostRoleInfo>? OnRoleFollow;
public GhostRolesEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem)
public GhostRoleButtonsBox(bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem) // WD Edit ahead of wizden upstream
{
RobustXamlLoader.Load(this);
_spriteSystem = spriteSystem;
Title.Text = name;
Description.SetMessage(description);
foreach (var role in roles)
{
var button = new GhostRoleEntryButtons(role);
@@ -45,7 +42,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
TextureScale = new Vector2(0.4f, 0.4f),
Stretch = TextureRect.StretchMode.KeepCentered,
Texture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ("/Textures/Interface/Nano/lock.svg.192dpi.png"))),
Texture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new("/Textures/Interface/Nano/lock.svg.192dpi.png"))),
HorizontalExpand = true,
HorizontalAlignment = HAlignment.Right,
});

View File

@@ -1,15 +1,15 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Horizontal">
Orientation="Horizontal"
HorizontalAlignment="Stretch">
<Button Name="RequestButton"
Access="Public"
Text="{Loc 'ghost-roles-window-request-role-button'}"
StyleClasses="OpenRight"
HorizontalAlignment="Left"
SetWidth="300"/>
HorizontalExpand="True"
SizeFlagsStretchRatio="3"/>
<Button Name="FollowButton"
Access="Public"
Text="{Loc 'ghost-roles-window-follow-role-button'}"
StyleClasses="OpenLeft"
HorizontalAlignment="Right"
SetWidth="150"/>
HorizontalExpand="True"/>
</BoxContainer>

View File

@@ -0,0 +1,8 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical">
<Label Name="Title"
StyleClasses="LabelKeyText"/>
<PanelContainer StyleClasses="HighDivider" />
<RichTextLabel Name="Description"
Margin="0 4"/>
</BoxContainer>

View File

@@ -0,0 +1,18 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
public sealed partial class GhostRoleInfoBox : BoxContainer
{
public GhostRoleInfoBox(string name, string description)
{
RobustXamlLoader.Load(this);
Title.Text = name;
Description.SetMessage(description);
}
}
}

View File

@@ -1,16 +0,0 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical"
HorizontalExpand="True"
Margin="0 0 8 8">
<Label Name="Title"
StyleClasses="LabelKeyText"/>
<PanelContainer StyleClasses="HighDivider" />
<RichTextLabel Name="Description"
Margin="0 4"/>
<BoxContainer Name="Buttons"
HorizontalAlignment="Left"
Orientation="Vertical"
SeparationOverride="5">
<!-- Buttons are added here by code -->
</BoxContainer>
</BoxContainer>

View File

@@ -5,12 +5,11 @@ using Content.Shared.Eui;
using Content.Shared.Ghost.Roles;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[UsedImplicitly]
public sealed class GhostRolesEui : BaseEui
public sealed class GhostRolesEui : BaseEui // WD Edit ahead of wizden upstream
{
private readonly GhostRolesWindow _window;
private GhostRoleRulesWindow? _windowRules = null;
@@ -77,6 +76,13 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
if (state is not GhostRolesEuiState ghostState)
return;
// We must save BodyVisible state, so all Collapsible boxes will not close
// on adding new ghost role.
// Save the current state of each Collapsible box being visible or not
_window.SaveCollapsibleBoxesStates();
// Clearing the container before adding new roles
_window.ClearEntries();
var entityManager = IoCManager.Resolve<IEntityManager>();
@@ -84,28 +90,32 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
var spriteSystem = sysManager.GetEntitySystem<SpriteSystem>();
var requirementsManager = IoCManager.Resolve<JobRequirementsManager>();
// TODO: role.Requirements value doesn't work at all as an equality key, this must be fixed
// Grouping roles
var groupedRoles = ghostState.GhostRoles.GroupBy(
role => (role.Name, role.Description, role.Requirements));
// Add a new entry for each role group
foreach (var group in groupedRoles)
{
var name = group.Key.Name;
var description = group.Key.Description;
bool hasAccess = true;
FormattedMessage? reason;
if (!requirementsManager.CheckRoleRequirements(group.Key.Requirements, null, out reason))
{
hasAccess = false;
}
var hasAccess = requirementsManager.CheckRoleRequirements(
group.Key.Requirements,
null,
out var reason);
// Adding a new role
_window.AddEntry(name, description, hasAccess, reason, group, spriteSystem);
}
// Restore the Collapsible box state if it is saved
_window.RestoreCollapsibleBoxesStates();
// Close the rules window if it is no longer needed
var closeRulesWindow = ghostState.GhostRoles.All(role => role.Identifier != _windowRulesId);
if (closeRulesWindow)
{
_windowRules?.Close();
}
}
}
}

View File

@@ -1,31 +1,100 @@
using System.Linq;
using Content.Shared.Ghost.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
public sealed partial class GhostRolesWindow : DefaultWindow
public sealed partial class GhostRolesWindow : DefaultWindow // WD Edit ahead of wizden upstream
{
public event Action<GhostRoleInfo>? OnRoleRequestButtonClicked;
public event Action<GhostRoleInfo>? OnRoleFollow;
private Dictionary<(string name, string description), Collapsible> _collapsibleBoxes = new();
private HashSet<(string name, string description)> _uncollapsedStates = new();
public GhostRolesWindow()
{
RobustXamlLoader.Load(this);
}
public void ClearEntries()
{
NoRolesMessage.Visible = true;
EntryContainer.DisposeAllChildren();
_collapsibleBoxes.Clear();
}
public void SaveCollapsibleBoxesStates()
{
_uncollapsedStates.Clear();
foreach (var (key, collapsible) in _collapsibleBoxes)
{
if (collapsible.BodyVisible)
{
_uncollapsedStates.Add(key);
}
}
}
public void RestoreCollapsibleBoxesStates()
{
foreach (var (key, collapsible) in _collapsibleBoxes)
{
collapsible.BodyVisible = _uncollapsedStates.Contains(key);
}
}
public void AddEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem)
{
NoRolesMessage.Visible = false;
var entry = new GhostRolesEntry(name, description, hasAccess, reason, roles, spriteSystem);
entry.OnRoleSelected += OnRoleRequestButtonClicked;
entry.OnRoleFollow += OnRoleFollow;
EntryContainer.AddChild(entry);
var ghostRoleInfos = roles.ToList();
var rolesCount = ghostRoleInfos.Count;
var info = new GhostRoleInfoBox(name, description);
var buttons = new GhostRoleButtonsBox(hasAccess, reason, ghostRoleInfos, spriteSystem);
buttons.OnRoleSelected += OnRoleRequestButtonClicked;
buttons.OnRoleFollow += OnRoleFollow;
EntryContainer.AddChild(info);
if (rolesCount > 1)
{
var buttonHeading = new CollapsibleHeading(Loc.GetString("ghost-roles-window-available-button", ("rolesCount", rolesCount)));
buttonHeading.AddStyleClass(ContainerButton.StyleClassButton);
buttonHeading.Label.HorizontalAlignment = HAlignment.Center;
buttonHeading.Label.HorizontalExpand = true;
var body = new CollapsibleBody
{
Margin = new Thickness(0, 5, 0, 0),
};
// TODO: Add Requirements to this key when it'll be fixed and work as an equality key in GhostRolesEui
var key = (name, description);
var collapsible = new Collapsible(buttonHeading, body)
{
Orientation = BoxContainer.LayoutOrientation.Vertical,
Margin = new Thickness(0, 0, 0, 8),
};
body.AddChild(buttons);
EntryContainer.AddChild(collapsible);
_collapsibleBoxes.Add(key, collapsible);
}
else
{
EntryContainer.AddChild(buttons);
}
}
}
}

View File

@@ -11,6 +11,7 @@ using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing;
using Content.Shared.Mobs.Systems;
namespace Content.Shared._White.Blocking;
@@ -21,16 +22,17 @@ public sealed class MeleeBlockSystem : EntitySystem
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffect = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<HandsComponent, MeleeBlockAttemptEvent>(OnBlockAttempt,
after: new[] {typeof(BlockingSystem)});
after: new[] { typeof(BlockingSystem) });
SubscribeLocalEvent<MeleeWeaponComponent, MeleeHitEvent>(OnHit,
before: new[] {typeof(StaminaSystem), typeof(MeleeThrowOnHitSystem)},
after: new[] {typeof(BackstabSystem)});
before: new[] { typeof(StaminaSystem), typeof(MeleeThrowOnHitSystem) },
after: new[] { typeof(BackstabSystem) });
SubscribeLocalEvent<MeleeBlockComponent, ExaminedEvent>(OnExamine);
}
@@ -76,6 +78,9 @@ public sealed class MeleeBlockSystem : EntitySystem
if (TryComp(uid.Value, out ItemToggleComponent? toggle) && !toggle.Activated)
return;
if (!_mobStateSystem.IsAlive(ent))
return;
_audio.PlayPredicted(block.BlockSound, ent, args.Attacker);
_popupSystem.PopupPredicted(Loc.GetString("melee-block-event-blocked"), ent, args.Attacker);
_damageable.TryChangeDamage(uid.Value, args.Damage);

View File

@@ -1,62 +1,4 @@
Entries:
- author: Valtos
changes:
- message: "\u041D\u043E\u0432\u044B\u0439 \u0441\u0442\u0438\u043B\u044C \u0438\
\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432 \u0437\u0435\u043B\
\u0451\u043D\u043E\u043C \u0438\u0441\u043F\u043E\u043B\u043D\u0435\u043D\u0438\
\u0438."
type: Tweak
- message: "\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u043D\u0435\u043A\u043E\u0442\
\u043E\u0440\u044B\u0445 \u043E\u043A\u043E\u043D \u0442\u0435\u043F\u0435\u0440\
\u044C \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0435. \u042D\u0442\
\u043E \u0438\u0437\u0431\u0430\u0432\u043B\u044F\u0435\u0442 \u043E\u0442 \u043D\
\u0430\u0434\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u043A\u0440\u0443\u0442\
\u0438\u0442\u044C \u0438 \u0432\u0435\u0440\u0442\u0435\u0442\u044C \u0438\u0445\
\ \u043A\u0430\u0436\u0434\u044B\u0439 \u0440\u0430\u0437 \u043F\u0440\u0438\
\ \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438."
type: Fix
- message: "\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u043D\
\u0430\u044F \u043F\u043E\u043B\u043E\u0441\u043A\u0430 \u043C\u0435\u0436\u0434\
\u0443 \u0447\u0430\u0442\u043E\u043C \u0438 \u0438\u0433\u0440\u043E\u0432\u044B\
\u043C \u043E\u043A\u043D\u043E\u043C \u0442\u0435\u043F\u0435\u0440\u044C \u0441\
\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442 \u0441\u0432\u043E\u0451 \u043F\
\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043A\u043E\u0440\u0440\u0435\
\u043A\u0442\u043D\u043E."
type: Fix
id: 118
time: '2023-04-06T06:09:28.0000000+00:00'
- author: BELNAKBU
changes:
- message: "\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C \u0440\
\u0430\u0437\u0434\u0435\u043B\u043A\u0438 \u043B\u044E\u0434\u0435\u0439 \u043E\
\u0431\u044B\u0447\u043D\u044B\u043C \u043E\u0441\u0442\u0440\u044B\u043C \u043F\
\u0440\u0435\u0434\u043C\u0435\u0442\u043E\u043C, \u0431\u0435\u0437 \u043D\u0443\
\u0436\u0434\u044B \u0432 \u043A\u0440\u044E\u043A\u0430\u0445. \u0422\u0430\
\u043A\u0430\u044F \u0440\u0430\u0437\u0434\u0435\u043B\u043A\u0430 \u0437\u0430\
\u0439\u043C\u0435\u0442 3 \u043C\u0438\u043D\u0443\u0442\u044B, \u0431\u0443\
\u0434\u0443\u0442 \u043F\u0440\u043E\u0438\u0433\u0440\u044B\u0432\u0430\u0442\
\u044C\u0441\u044F \u0433\u0440\u043E\u043C\u043A\u0438\u0435 \u0437\u0432\u0443\
\u043A\u0438 \u0438 \u0435\u0434\u0438\u043D\u043E\u0440\u0430\u0437\u043E\u0432\
\u043E \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F \u043F\u043E\u043F\u0430\
\u043F, \u043E \u0442\u043E\u043C \u0447\u0442\u043E \u0440\u0430\u0437\u0434\
\u0435\u043B\u044B\u0432\u0430\u044E\u0442 \u0447\u0435\u043B\u043E\u0432\u0435\
\u043A\u0430. \u0422\u0430\u043A\u0436\u0435 \u0432 \u043A\u0440\u0438\u043E\
\ \u043F\u043E\u0434\u044B \u043C\u043E\u0436\u043D\u043E \u0432\u0441\u0442\
\u0430\u0432\u043B\u044F\u0442\u044C \u0442\u0435\u043B\u0430 \u043F\u0440\u043E\
\u0441\u0442\u043E \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\
\u0430\u044F \u043C\u043E\u0434\u0435\u043B\u044C\u043A\u0438 \u043D\u0430 \u043A\
\u0430\u043F\u0441\u0443\u043B\u0443."
type: Add
id: 119
time: '2023-04-06T08:45:15.0000000+00:00'
- author: Valtos
changes:
- message: "\u0424\u0438\u043A\u0441 \u0431\u0430\u043D\u043E\u0432, \u043A\u043E\
\u0442\u043E\u0440\u044B\u0435 \u0440\u0430\u0431\u043E\u0442\u0430\u043B\u0438\
\ \u0432\u0435\u0437\u0434\u0435."
type: Fix
id: 120
time: '2023-04-06T10:06:06.0000000+00:00'
- author: HitPanda
changes:
- message: "\u041F\u0435\u0440\u0435\u0432\u043E\u0434 \u0442\u0435\u043A\u0441\u0442\
@@ -8906,3 +8848,37 @@
id: 617
time: '2024-12-01T21:08:39.0000000+00:00'
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/799
- author: keslik
changes:
- message: "\u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0451\u043D \u043E\u0431\u043D\
\u043E\u0432\u043B\u0451\u043D\u043D\u044B\u0439 \u0438\u043D\u0442\u0435\u0440\
\u0444\u0435\u0439\u0441 \u0432\u044B\u0431\u043E\u0440\u0430 \u043F\u0440\u0438\
\u0437\u0440\u0430\u0447\u043D\u044B\u0445 \u0440\u043E\u043B\u0435\u0439"
type: Add
id: 618
time: '2024-12-02T17:16:33.0000000+00:00'
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/800
- author: BIG_Zi_348
changes:
- message: "\u0422\u0435\u043F\u0435\u0440\u044C \u0434\u043B\u044F \u0431\u043B\
\u043E\u043A\u0430 \u0430\u0442\u0430\u043A \u0431\u043B\u0438\u0436\u043D\u0435\
\u0433\u043E \u0431\u043E\u044F \u043D\u0443\u0436\u043D\u043E \u0431\u044B\u0442\
\u044C \u0436\u0438\u0432\u044B\u043C."
type: Fix
id: 619
time: '2024-12-02T19:30:18.0000000+00:00'
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/801
- author: BIG_Zi_348
changes:
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u044B \u043A\u043E\u043C\
\u043F\u043E\u043D\u0435\u043D\u0442\u044B \u0414\u0410\u041C \u0434\u043B\u044F\
\ \u043F\u043E\u043A\u0443\u043F\u043A\u0438 \u0432 \u043A\u0430\u0440\u0433\
\u043E."
type: Add
- message: "\u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0435\u043D\u0430 \u0432\u043E\
\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C \u0433\u0438\u0431\u0430\
\ \u0443\u0434\u0430\u0440\u0430\u043C\u0438."
type: Add
id: 620
time: '2024-12-02T21:00:35.0000000+00:00'
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/802

View File

@@ -22,6 +22,7 @@ ghost-target-window-current-button = Warp: {$name}
ghost-target-window-warp-to-most-followed = Warp to Most Followed
ghost-roles-window-title = Ghost Roles
ghost-roles-window-available-button = Available ({$rolesCount})
ghost-roles-window-join-raffle-button = Join raffle
ghost-roles-window-raffle-in-progress-button =
Join raffle ({$time} left, { $players ->

View File

@@ -23,7 +23,7 @@ ghost-target-window-title = Телепорт призрака
ghost-target-window-current-button = Телепорт в: { $name }
ghost-roles-window-title = Роли призраков
ghost-roles-window-available-button = Доступно ({$rolesCount})
ghost-roles-window-join-raffle-button = Начать лотерею
ghost-roles-window-raffle-in-progress-button =
Участвовать ({$time} осталось, { $players ->

View File

@@ -54,6 +54,12 @@
damageContainer: Biological
- type: Destructible
thresholds:
- trigger:
!type:DamageTypeTrigger
damageType: Blunt
damage: 1500 # WD Edit from 400 to 1500
behaviors:
- !type:GibBehavior { }
- trigger:
!type:DamageTypeTrigger
damageType: Heat

View File

@@ -119,8 +119,8 @@
- type: Item
sprite: White/Objects/Weapons/Guns/SMG/c20r-inhands.rsi
- type: Gun
minAngle: 1 # Amour EDIT FROM 11 TO 1
maxAngle: 7 # Amour EDIT FROM 19 TO 7
minAngle: 1 # WD
maxAngle: 7 # WD
shotsPerBurst: 5
availableModes:
- SemiAuto
@@ -217,9 +217,9 @@
- type: Item
sprite: White/Objects/Weapons/Guns/SMG/drozd-inhands.rsi
- type: Gun
minAngle: 4 # Amour EDIT FROM 21 TO 4
maxAngle: 10 # Amour EDIT FROM 32 TO 10
fireRate: 5 # Amour EDIT FROM 6 TO 5
minAngle: 4 # WD
maxAngle: 10 # WD
fireRate: 5 # WD
selectedMode: FullAuto
soundGunshot:
path: /Audio/Weapons/Guns/Gunshots/atreides.ogg

View File

@@ -0,0 +1,19 @@
- type: cargoProduct
id: EngineAmeShielding
icon:
sprite: Objects/Devices/flatpack.rsi
state: ame-part
product: CrateEngineeringAMEShielding
cost: 28000
category: cargoproduct-category-name-engineering
group: market
- type: cargoProduct
id: EngineAmeControl
icon:
sprite: Structures/Power/Generation/ame.rsi
state: control
product: CrateEngineeringAMEControl
cost: 4000
category: cargoproduct-category-name-engineering
group: market