Skip to content

Commit fcb62e8

Browse files
authored
Лаваленд Релиз (#322)
* lava1 * change * year * aaaaaaaaaaaaaaaaaa * ye * testver * . * . * firstfixes * fixes2 * last * testingback * dovkid * disabledevlava * mapsupdate * fix
1 parent 6290f47 commit fcb62e8

File tree

1,200 files changed

+196576
-29330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,200 files changed

+196576
-29330
lines changed

Content.Client/Clothing/ClientClothingSystem.cs

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Content.Shared.Clothing;
66
using Content.Shared.Clothing.Components;
77
using Content.Shared.Clothing.EntitySystems;
8+
using Content.Shared.Clothing.Upgrades.Components; // Corvax-Wega-UpgradableClothing
89
using Content.Shared.DirtVisuals; // Corvax-Wega-Dirtable
910
using Content.Shared.Humanoid;
1011
using Content.Shared.Inventory;
@@ -13,6 +14,7 @@
1314
using Robust.Client.GameObjects;
1415
using Robust.Client.Graphics;
1516
using Robust.Client.ResourceManagement;
17+
using Robust.Shared.Containers; // Corvax-Wega-UpgradableClothing
1618
using Robust.Shared.GameStates; // Corvax-Wega-ToggleClothing
1719
using Robust.Shared.Serialization.TypeSerializers.Implementations;
1820
using Robust.Shared.Utility;
@@ -58,6 +60,7 @@ public sealed class ClientClothingSystem : ClothingSystem
5860
[Dependency] private readonly InventorySystem _inventorySystem = default!;
5961
[Dependency] private readonly DisplacementMapSystem _displacement = default!;
6062
[Dependency] private readonly SpriteSystem _sprite = default!;
63+
[Dependency] private readonly SharedContainerSystem _container = default!; // Corvax-Wega-UpgradableClothing
6164

6265
public override void Initialize()
6366
{
@@ -113,8 +116,7 @@ private void OnGetVisuals(EntityUid uid, ClothingComponent item, GetEquipmentVis
113116
List<PrototypeLayerData>? layers = null;
114117
// Corvax-Wega-ToggleClothing-start
115118
var suffix = TryComp<ToggleableSpriteClothingComponent>(uid, out var toggleable)
116-
? toggleable.ActiveSuffix
117-
: string.Empty;
119+
? toggleable.ActiveSuffix : string.Empty;
118120
// Corvax-Wega-ToggleClothing-end
119121

120122
// first attempt to get species specific data.
@@ -161,6 +163,26 @@ private void OnGetVisuals(EntityUid uid, ClothingComponent item, GetEquipmentVis
161163
}));
162164
// Corvax-Wega-ToggleClothing-Edit-end
163165
}
166+
167+
// Corvax-Wega-UpgradableClothing-start
168+
if (TryComp<UpgradeableClothingComponent>(uid, out var upgradeable))
169+
{
170+
foreach (var upgrade in GetCurrentUpgrades(uid, upgradeable))
171+
{
172+
if (upgrade.Comp.EquippedState is not SpriteSpecifier.Rsi rsi)
173+
continue;
174+
175+
var layerData = new PrototypeLayerData
176+
{
177+
RsiPath = rsi.RsiPath.ToString(),
178+
State = rsi.RsiState,
179+
};
180+
181+
var key = $"upgrade-{upgrade.Owner}-{args.Slot}";
182+
args.Layers.Add((key, layerData));
183+
}
184+
}
185+
// Corvax-Wega-UpgradableClothing-end
164186
}
165187

166188
/// <summary>
@@ -450,6 +472,7 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot
450472
RaiseLocalEvent(equipment, new EquipmentVisualsUpdatedEvent(equipee, slot, revealedLayers), true);
451473
}
452474

475+
// Corvax-Wega-Add-start
453476
// Corvax-Wega-ToggleClothing-start
454477
private bool StateExists(EntityUid uid, string state, string? speciesId)
455478
{
@@ -489,4 +512,19 @@ private void UpdateClothingVisuals(EntityUid uid)
489512
RenderEquipment(parent, uid, clothing.InSlot, inventory, clothingComponent: clothing);
490513
}
491514
// Corvax-Wega-ToggleClothing-end
515+
516+
// Corvax-Wega-UpgradableClothing-start
517+
private IEnumerable<Entity<ClothingUpgradeComponent>> GetCurrentUpgrades(EntityUid clothing, UpgradeableClothingComponent component)
518+
{
519+
if (!_container.TryGetContainer(clothing, component.UpgradesContainerId, out var container))
520+
yield break;
521+
522+
foreach (var contained in container.ContainedEntities)
523+
{
524+
if (TryComp<ClothingUpgradeComponent>(contained, out var upgradeComp))
525+
yield return (contained, upgradeComp);
526+
}
527+
}
528+
// Corvax-Wega-UpgradableClothing-end
529+
// Corvax-Wega-Add-end
492530
}

Content.Client/Lobby/UI/LobbyGui.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
<controls:HSpacer Spacing="10" />
8181
<!-- Voting & misc button bar -->
8282
<BoxContainer Orientation="Horizontal" MinSize="0 40" HorizontalAlignment="Right">
83+
<!-- Corvax-Wega-Achievements-start -->
84+
<Button Name="AchievementsButton" Access="Public" Text="{Loc 'ui-lobby-achievements-button'}"
85+
StyleClasses="ButtonBig" />
86+
<!-- Corvax-Wega-Achievements-end -->
8387
<Button Name="AHelpButton" Access="Public" Text="{Loc 'ui-lobby-ahelp-button'}"
8488
StyleClasses="ButtonBig" />
8589
<vote:VoteCallMenuButton Name="CallVoteButton" StyleClasses="ButtonBig" />

Content.Client/Lobby/UI/LobbyGui.xaml.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Content.Client._Wega.Achievements; // Corvax-Wega-Achievements
12
using Content.Client.Message;
23
using Content.Client.UserInterface.Systems.EscapeMenu;
34
using Robust.Client.AutoGenerated;
@@ -12,6 +13,8 @@ public sealed partial class LobbyGui : UIScreen
1213
{
1314
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
1415

16+
private AchievementsWindow? _achievementsWindow; // Corvax-Wega-Achievements
17+
1518
public LobbyGui()
1619
{
1720
RobustXamlLoader.Load(this);
@@ -21,13 +24,29 @@ public LobbyGui()
2124

2225
LobbySong.SetMarkup(Loc.GetString("lobby-state-song-no-song-text"));
2326

27+
AchievementsButton.OnPressed += _ => OpenAchievementsWindow(); // Corvax-Wega-Achievements
28+
2429
LeaveButton.OnPressed += _ => _consoleHost.ExecuteCommand("disconnect");
2530
OptionsButton.OnPressed += _ => UserInterfaceManager.GetUIController<OptionsUIController>().ToggleWindow();
2631

2732
CollapseButton.OnPressed += _ => TogglePanel(false);
2833
ExpandButton.OnPressed += _ => TogglePanel(true);
2934
}
3035

36+
// Corvax-Wega-Achievements-start
37+
private async void OpenAchievementsWindow()
38+
{
39+
if (_achievementsWindow != null && _achievementsWindow.IsOpen)
40+
{
41+
_achievementsWindow.Close();
42+
return;
43+
}
44+
45+
_achievementsWindow = new AchievementsWindow();
46+
_achievementsWindow.OpenCentered();
47+
}
48+
// Corvax-Wega-Achievements-end
49+
3150
public void SwitchState(LobbyGuiState state)
3251
{
3352
DefaultState.Visible = false;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Button Name="Container" xmlns="https://spacestation14.io"
2+
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
3+
ToggleMode="True"
4+
HorizontalExpand="True"
5+
MouseFilter="Pass">
6+
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" Margin="5">
7+
<PanelContainer SetSize="76 76" Margin="0 0 10 0">
8+
<PanelContainer.PanelOverride>
9+
<graphics:StyleBoxFlat BackgroundColor="#1B1B1E" BorderColor="#1E3D2A" BorderThickness="2" />
10+
</PanelContainer.PanelOverride>
11+
<TextureRect Name="AchievementIcon"
12+
Stretch="KeepCentered" />
13+
</PanelContainer>
14+
15+
<BoxContainer Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True">
16+
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
17+
<Label Name="AchievementName" StyleClasses="LabelHeading" />
18+
<Control HorizontalExpand="True" />
19+
<Label Name="AchievementStatus" StyleClasses="LabelSubText" />
20+
</BoxContainer>
21+
<RichTextLabel Name="AchievementDescription" VerticalExpand="True" />
22+
</BoxContainer>
23+
</BoxContainer>
24+
</Button>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using Content.Shared.Achievements;
2+
using Robust.Client.AutoGenerated;
3+
using Robust.Client.GameObjects;
4+
using Robust.Client.UserInterface.Controls;
5+
using Robust.Client.UserInterface.XAML;
6+
7+
namespace Content.Client._Wega.Achievements;
8+
9+
[GenerateTypedNameReferences]
10+
public sealed partial class AchievementEntry : Button
11+
{
12+
public AchievementEntry(AchievementPrototype prototype, bool isUnlocked, SpriteSystem sprite)
13+
{
14+
RobustXamlLoader.Load(this);
15+
16+
var spriteSpecifier = prototype.AchievementIcon;
17+
AchievementIcon.Texture = sprite.Frame0(spriteSpecifier);
18+
19+
AchievementName.Text = Loc.GetString(prototype.Name);
20+
21+
AchievementStatus.Text = isUnlocked
22+
? Loc.GetString("ui-achievements-unlocked")
23+
: Loc.GetString("ui-achievements-locked");
24+
AchievementStatus.FontColorOverride = isUnlocked ? Color.Gold : Color.Gray;
25+
26+
if (prototype.Description != null)
27+
{
28+
var description = Loc.GetString(prototype.Description);
29+
AchievementDescription.SetMessage(description);
30+
}
31+
32+
Container.OnPressed += args => SetSelected(true);
33+
}
34+
35+
public void SetSelected(bool selected)
36+
{
37+
Container.Pressed = selected;
38+
39+
if (selected)
40+
{
41+
Container.StyleClasses.Add("ButtonOpenBoth");
42+
}
43+
else
44+
{
45+
Container.StyleClasses.Remove("ButtonOpenBoth");
46+
}
47+
}
48+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<PanelContainer
2+
Name="NotificationRoot"
3+
xmlns="https://spacestation14.io"
4+
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
5+
HorizontalAlignment="Right"
6+
VerticalAlignment="Bottom"
7+
Margin="0 0 20 20" SetSize="500 120"
8+
Access="Public" Visible="False">
9+
10+
<PanelContainer.PanelOverride>
11+
<graphics:StyleBoxFlat
12+
BackgroundColor="#1B1B1E"
13+
BorderColor="#2F6F3B"
14+
BorderThickness="3" />
15+
</PanelContainer.PanelOverride>
16+
17+
<BoxContainer Orientation="Horizontal" Margin="10">
18+
19+
<PanelContainer SetSize="46 46" Margin="10 0 20 10">
20+
<PanelContainer.PanelOverride>
21+
<graphics:StyleBoxFlat
22+
BackgroundColor="#141417"
23+
BorderColor="#4A8B5F"
24+
BorderThickness="2" />
25+
</PanelContainer.PanelOverride>
26+
<TextureRect Name="NotificationIcon"
27+
Stretch="KeepCentered"
28+
SetSize="38 38"
29+
Margin="5" />
30+
</PanelContainer>
31+
32+
<BoxContainer Orientation="Vertical" VerticalExpand="True" MinWidth="250">
33+
34+
<BoxContainer Orientation="Horizontal" Margin="0 0 0 5">
35+
<Label Text="{Loc 'ui-achievements-new'}"
36+
StyleClasses="LabelHeading"
37+
FontColorOverride="#4A8B5F" />
38+
<Control HorizontalExpand="True" />
39+
</BoxContainer>
40+
41+
<Label Name="NotificationName"
42+
StyleClasses="LabelHeading"
43+
Margin="0 0 0 5"
44+
FontColorOverride="White" />
45+
46+
<RichTextLabel Name="NotificationDescription"
47+
VerticalExpand="True"
48+
HorizontalExpand="True"
49+
StyleClasses="LabelSubText"
50+
Margin="0 0 0 5" />
51+
52+
</BoxContainer>
53+
54+
</BoxContainer>
55+
56+
</PanelContainer>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Robust.Client.AutoGenerated;
2+
using Robust.Client.Graphics;
3+
using Robust.Client.UserInterface;
4+
using Robust.Client.UserInterface.Controls;
5+
using Robust.Client.UserInterface.XAML;
6+
7+
namespace Content.Client._Wega.Achievements;
8+
9+
[GenerateTypedNameReferences]
10+
public sealed partial class AchievementNotification : PanelContainer
11+
{
12+
public AchievementNotification()
13+
{
14+
RobustXamlLoader.Load(this);
15+
}
16+
17+
public void Show(string name, string description, Texture? icon)
18+
{
19+
NotificationName.Text = name;
20+
NotificationDescription.SetMessage(description);
21+
NotificationIcon.Texture = icon;
22+
23+
NotificationRoot.Visible = true;
24+
}
25+
}

0 commit comments

Comments
 (0)