Skip to content

Commit

Permalink
Merge pull request #15 from Mor-Dast/dev
Browse files Browse the repository at this point in the history
Upstream
  • Loading branch information
Mor-Dast authored Nov 30, 2024
2 parents 430c18a + 82fdd47 commit decde33
Show file tree
Hide file tree
Showing 1,588 changed files with 19,013 additions and 2,172 deletions.
14 changes: 7 additions & 7 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Last match in file takes precedence.

# Ping for all PRs
* @Morb0
# C#
*.cs @Tornado-Technology @AwareFoxy @FireNameFN

# Ping for all PRs that include translations/editing fluent strings
*.ftl @ficcialfaint
# Prototypes
*.yml @Vonsant

# Map files
/Resources/Prototypes/Maps/** @Ko4ergaPunk
/Resources/Maps/** @Ko4ergaPunk
# TTS

/Content.*/Corvax/TTS @Morb0
3 changes: 2 additions & 1 deletion Content.Client/Buckle/BuckleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref Ap
!buckled ||
args.Sprite == null)
{
_rotationVisualizerSystem.SetHorizontalAngle((uid, rotVisuals), rotVisuals.DefaultRotation);
// CorvaxNext: Laying System
//_rotationVisualizerSystem.SetHorizontalAngle((uid, rotVisuals), rotVisuals.DefaultRotation);
return;
}

Expand Down
13 changes: 9 additions & 4 deletions Content.Client/Corvax/TTS/TTSSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ public sealed class TTSSystem : EntitySystem
[Dependency] private readonly AudioSystem _audio = default!;

private ISawmill _sawmill = default!;
private MemoryContentRoot _contentRoot = default!;
private static MemoryContentRoot _contentRoot = new();
private static readonly ResPath Prefix = ResPath.Root / "TTS";

private static bool _contentRootAdded;

/// <summary>
/// Reducing the volume of the TTS when whispering. Will be converted to logarithm.
/// </summary>
Expand All @@ -40,9 +42,13 @@ public sealed class TTSSystem : EntitySystem

public override void Initialize()
{
_contentRoot = new();
if (!_contentRootAdded)
{
_contentRootAdded = true;
_res.AddRoot(Prefix, _contentRoot);
}

_sawmill = Logger.GetSawmill("tts");
_res.AddRoot(Prefix, _contentRoot);
_cfg.OnValueChanged(CCCVars.TTSVolume, OnTtsVolumeChanged, true);
SubscribeNetworkEvent<PlayTTSEvent>(OnPlayTTS);
}
Expand All @@ -51,7 +57,6 @@ public override void Shutdown()
{
base.Shutdown();
_cfg.UnsubValueChanged(CCCVars.TTSVolume, OnTtsVolumeChanged);
_contentRoot.Dispose();
}

public void RequestPreviewTTS(string voiceId)
Expand Down
5 changes: 3 additions & 2 deletions Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Client.Examine;
using Content.Client.Strip;
using Content.Client.Verbs.UI;
using Content.Shared._CorvaxNext.Surgery.Body.Events;
using Content.Shared.Body.Part;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
Expand Down Expand Up @@ -51,8 +52,8 @@ public override void Initialize()
SubscribeLocalEvent<HandsComponent, ComponentShutdown>(OnHandsShutdown);
SubscribeLocalEvent<HandsComponent, ComponentHandleState>(HandleComponentState);
SubscribeLocalEvent<HandsComponent, VisualsChangedEvent>(OnVisualsChanged);
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved); // _CorvaxNext: surgery
SubscribeLocalEvent<HandsComponent, BodyPartDisabledEvent>(HandleBodyPartDisabled); // _CorvaxNext: surgery
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved); // CorvaxNext: surgery
SubscribeLocalEvent<HandsComponent, BodyPartDisabledEvent>(HandleBodyPartDisabled); // CorvaxNext: surgery

OnHandSetActive += OnHandActivated;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Humanoid/HumanoidAppearanceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void UpdateLayers(HumanoidAppearanceComponent component, SpriteComponent
foreach (var (key, info) in component.CustomBaseLayers)
{
oldLayers.Remove(key);
// Shitmed modification: For whatever reason these weren't actually ignoring the skin color as advertised.
// CorvaxNext modification: For whatever reason these weren't actually ignoring the skin color as advertised.
SetLayerData(component, sprite, key, info.Id, sexMorph: false, color: info.Color, overrideSkin: true);
}

Expand Down
13 changes: 7 additions & 6 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.Arcade1);
human.AddFunction(ContentKeyFunctions.Arcade2);
human.AddFunction(ContentKeyFunctions.Arcade3);
human.AddFunction(ContentKeyFunctions.TargetHead); // _CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetTorso); // _CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetLeftArm); // _CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetRightArm); // _CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetLeftLeg); // _CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetRightLeg); // _CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetHead); // CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetTorso); // CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetLeftArm); // CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetRightArm); // CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetLeftLeg); // CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.TargetRightLeg); // CorvaxNext: surgery
human.AddFunction(ContentKeyFunctions.OfferItem); // Corvax-Next-Offer
human.AddFunction(ContentKeyFunctions.ToggleStanding); // CorvaxNext: laying system toggle standing

// actions should be common (for ghosts, mobs, etc)
common.AddFunction(ContentKeyFunctions.OpenActionsMenu);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Inventory/ClientInventorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override void Initialize()

SubscribeLocalEvent<InventorySlotsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<InventorySlotsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
SubscribeLocalEvent<InventorySlotsComponent, RefreshInventorySlotsEvent>(OnRefreshInventorySlots); // _CorvaxNext: surgery
SubscribeLocalEvent<InventorySlotsComponent, RefreshInventorySlotsEvent>(OnRefreshInventorySlots); // CorvaxNext: surgery
SubscribeLocalEvent<InventoryComponent, ComponentShutdown>(OnShutdown);

SubscribeLocalEvent<InventorySlotsComponent, DidEquipEvent>((_, comp, args) =>
Expand Down
14 changes: 14 additions & 0 deletions Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
KeybindsContainer.AddChild(newCheckBox);
}

// start-_CorvaxNext: Laying System
void HandleToggleAutoGetUp(BaseButton.ButtonToggledEventArgs args) // WD EDIT
{
_cfg.SetCVar(Shared._CorvaxNext.NextVars.NextVars.AutoGetUp, args.Pressed);
_cfg.SaveToFile();
}
// end-_CorvaxNext: Laying System

AddHeader("ui-options-header-general");
AddCheckBox("ui-options-hotkey-keymap", _cfg.GetCVar(CVars.DisplayUSQWERTYHotkeys), HandleToggleUSQWERTYCheckbox);

Expand All @@ -161,6 +169,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(EngineKeyFunctions.MoveRight);
AddButton(EngineKeyFunctions.Walk);
AddCheckBox("ui-options-hotkey-toggle-walk", _cfg.GetCVar(CCVars.ToggleWalk), HandleToggleWalk);
AddCheckBox("ui-options-hotkey-auto-up", _cfg.GetCVar(Shared._CorvaxNext.NextVars.NextVars.AutoGetUp), HandleToggleAutoGetUp); // CorvaxNext: Laying System
InitToggleWalk();

AddHeader("ui-options-header-camera");
Expand All @@ -185,6 +194,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.RotateStoredItem);
AddButton(ContentKeyFunctions.SaveItemLocation);
AddButton(ContentKeyFunctions.OfferItem); // Corvax-Next-Offer
AddButton(ContentKeyFunctions.ToggleStanding); // CorvaxNext: Laying System
AddHeader("ui-options-header-interaction-adv");
AddButton(ContentKeyFunctions.SmartEquipBackpack);
AddButton(ContentKeyFunctions.SmartEquipBelt);
Expand Down Expand Up @@ -235,9 +245,13 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.TargetHead);
AddButton(ContentKeyFunctions.TargetTorso);
AddButton(ContentKeyFunctions.TargetLeftArm);
AddButton(ContentKeyFunctions.TargetLeftHand);
AddButton(ContentKeyFunctions.TargetRightArm);
AddButton(ContentKeyFunctions.TargetRightHand);
AddButton(ContentKeyFunctions.TargetLeftLeg);
AddButton(ContentKeyFunctions.TargetLeftFoot);
AddButton(ContentKeyFunctions.TargetRightLeg);
AddButton(ContentKeyFunctions.TargetRightFoot);
// end-_CorvaxNext: surgery

AddHeader("ui-options-header-misc");
Expand Down
9 changes: 9 additions & 0 deletions Content.Client/Smoking/MatchstickSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// CorvaxNext Change Start

using Content.Shared.Smoking.Systems;

namespace Content.Client.Smoking;

public sealed class MatchstickSystem : SharedMatchstickSystem;

// CorvaxNext Change End
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using Content.Shared._CorvaxNext.BluespaceHarvester;
using JetBrains.Annotations;

namespace Content.Client._CorvaxNext.BluespaceHarvester;

[UsedImplicitly]
public sealed class BluespaceHarvesterBoundUserInterface : BoundUserInterface
{
private BluespaceHarvesterMenu? _window;

public BluespaceHarvesterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_window = new BluespaceHarvesterMenu(this);
_window.OnClose += Close;
_window?.OpenCentered();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

_window?.Dispose();
_window = null;
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

if (state is not BluespaceHarvesterBoundUserInterfaceState current)
return;

_window?.UpdateState(current);
}

public void SendTargetLevel(int level)
{
SendMessage(new BluespaceHarvesterTargetLevelMessage(level));
}

public void SendBuy(Shared._CorvaxNext.BluespaceHarvester.BluespaceHarvesterCategory category)
{
SendMessage(new BluespaceHarvesterBuyMessage(category));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Control xmlns="https://spacestation14.io">
<GridContainer Margin = "2 0 0 0" Columns="2">
<Label Name="CategoryLabel" Text="Category" StyleClasses="StatusFieldTitle"></Label>
<Button Name="CategoryButton" Text="10000" StyleClasses="OpenRight" Access="Public"/>
</GridContainer>
</Control>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Content.Shared._CorvaxNext.BluespaceHarvester;

namespace Content.Client._CorvaxNext.BluespaceHarvester;

[GenerateTypedNameReferences]
public sealed partial class BluespaceHarvesterCategory : Control
{
public BluespaceHarvesterCategory(BluespaceHarvesterCategoryInfo category, bool canBuy)
{
RobustXamlLoader.Load(this);

CategoryLabel.Text = Loc.GetString($"bluespace-harvester-category-{Enum.GetName(typeof(Shared._CorvaxNext.BluespaceHarvester.BluespaceHarvesterCategory), category.Type)}");

CategoryButton.Text = $"{category.Cost}";
CategoryButton.Disabled = !canBuy;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'bluespace-harvester-window-title'}"
MinSize="480 360">
<BoxContainer Orientation="Vertical">
<Label Text="{Loc 'bluespace-harvester-window-lable-input'}"/>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<GridContainer Margin="2 0 0 0" Columns="2">
<Label Text="{Loc 'bluespace-harvester-window-level-input'}" StyleClasses="StatusFieldTitle"/>
<LineEdit Name="InputLevelBar" PlaceHolder="0" HorizontalExpand="True" Margin ="0 4"/>
<Label Text="{Loc 'bluespace-harvester-window-level-target'}" StyleClasses="StatusFieldTitle"/>
<Label Name="TargetLevel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-level-current'}" StyleClasses="StatusFieldTitle"/>
<Label Name="CurrentLevel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-level-desired'}" StyleClasses="StatusFieldTitle"/>
<ProgressBar Name="DesiredBar"
HorizontalExpand="True"
MinValue="0"
MaxValue="1"
SetHeight="25"/>
<Label Text="{Loc 'bluespace-harvester-window-power-usage'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerUsageLabel" Text="0w"/>
<Label Text="{Loc 'bluespace-harvester-window-power-next'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerUsageNextLabel" Text="0w"/>
<Label Text="{Loc 'bluespace-harvester-window-power-surplus'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerSuppliertLabel" Text="0w"/>
</GridContainer>
<Control/>
<Label Text="{Loc 'bluespace-harvester-window-lable-output'}"/>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<GridContainer Margin="2 0 10 0" Columns="2">
<BoxContainer Orientation="Vertical">
<GridContainer Margin="2 0 0 0" Columns="2">
<Label Text="{Loc 'bluespace-harvester-window-points-available'}" StyleClasses="StatusFieldTitle"/>
<Label Name="AvailablePointsLabel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-points-generation'}" StyleClasses="StatusFieldTitle"/>
<Label Name="GenerationPointsLabel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-points-total'}" StyleClasses="StatusFieldTitle"/>
<Label Name="TotalPontsLabel" Text="0"/>
</GridContainer>
</BoxContainer>
<BoxContainer Name="Categories" Orientation="Vertical">
</BoxContainer>
</GridContainer>
</BoxContainer>
</controls:FancyWindow>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Content.Client.UserInterface.Controls;
using Content.Shared._CorvaxNext.BluespaceHarvester;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;

namespace Content.Client._CorvaxNext.BluespaceHarvester;

[GenerateTypedNameReferences]
public sealed partial class BluespaceHarvesterMenu : FancyWindow
{
private readonly BluespaceHarvesterBoundUserInterface _owner;

public BluespaceHarvesterMenu(BluespaceHarvesterBoundUserInterface owner)
{
RobustXamlLoader.Load(this);

_owner = owner;

InputLevelBar.OnTextEntered += (args) =>
{
if (!int.TryParse(args.Text, out var level) || level < 0 || level > 20)
{
InputLevelBar.Text = "0";
return;
}
_owner.SendTargetLevel(level);
};

// EntityView.SetEntity(_owner.Owner);
}

public void UpdateState(BluespaceHarvesterBoundUserInterfaceState state)
{
TargetLevel.Text = $"{state.TargetLevel}";
CurrentLevel.Text = $"{state.CurrentLevel}";
DesiredBar.Value = ((float)state.CurrentLevel) / ((float)state.MaxLevel);

PowerUsageLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerUsage));
PowerUsageNextLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerUsageNext));
PowerSuppliertLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerSuppliert));

AvailablePointsLabel.Text = $"{state.Points}";
TotalPontsLabel.Text = $"{state.TotalPoints}";
GenerationPointsLabel.Text = $"{state.PointsGen}";

Categories.RemoveAllChildren();
foreach (var category in state.Categories)
{
var child = new BluespaceHarvesterCategory(category, state.Points >= category.Cost);

child.CategoryButton.OnButtonDown += (args) =>
{
_owner.SendBuy(category.Type);
};

Categories.AddChild(child);
}
}
}
Loading

0 comments on commit decde33

Please sign in to comment.