Skip to content

Commit

Permalink
Merge branch 'master' into klng
Browse files Browse the repository at this point in the history
  • Loading branch information
KillanGenifer authored Nov 27, 2024
2 parents ac8cbd1 + 598bc1c commit 53bfe82
Show file tree
Hide file tree
Showing 1,496 changed files with 16,318 additions and 2,163 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
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
89 changes: 89 additions & 0 deletions Content.Client/_CorvaxNext/Cards/Card/CardSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using System.Linq;
using Content.Shared._CorvaxNext.Cards.Card;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;

namespace Content.Client._CorvaxNext.Cards.Card;

/// <summary>
/// Handles the initialization and updating of card sprites on the client side,
/// particularly when a card is flipped or when the component starts up.
/// </summary>
public sealed class CardSystem : EntitySystem
{
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<CardComponent, ComponentStartup>(OnComponentStartupEvent);
SubscribeNetworkEvent<CardFlipUpdatedEvent>(OnFlip);
}

private void OnComponentStartupEvent(EntityUid uid, CardComponent comp, ComponentStartup args)
{
if (!TryComp(uid, out SpriteComponent? spriteComponent))
return;

var layerCount = spriteComponent.AllLayers.Count();
for (var i = 0; i < layerCount; i++)
{
if (!spriteComponent.TryGetLayer(i, out var layer) || layer.State == null || layer.State.Name == null)
continue;

var rsi = layer.RSI ?? spriteComponent.BaseRSI;
if (rsi == null)
continue;

comp.FrontSprite.Add(new SpriteSpecifier.Rsi(rsi.Path, layer.State.Name));
}

comp.BackSprite ??= comp.FrontSprite;

// Removed Dirty(uid, comp); as calling Dirty on the client is inappropriate.
UpdateSprite(uid, comp);
}

private void OnFlip(CardFlipUpdatedEvent args)
{
var entity = GetEntity(args.Card);
if (!TryComp(entity, out CardComponent? comp))
return;

UpdateSprite(entity, comp);
}

private void UpdateSprite(EntityUid uid, CardComponent comp)
{
var newSprite = comp.Flipped ? comp.BackSprite : comp.FrontSprite;
if (newSprite == null)
return;

if (!TryComp(uid, out SpriteComponent? spriteComponent))
return;

var layerCount = newSprite.Count;
var spriteLayerCount = spriteComponent.AllLayers.Count();

// Inserts missing layers
if (spriteLayerCount < layerCount)
{
for (var i = spriteLayerCount; i < layerCount; i++)
{
spriteComponent.AddBlankLayer(i);
}
}
// Removes extra layers
else if (spriteLayerCount > layerCount)
{
for (var i = spriteLayerCount - 1; i >= layerCount; i--)
{
spriteComponent.RemoveLayer(i);
}
}

for (var i = 0; i < layerCount; i++)
{
var layer = newSprite[i];
spriteComponent.LayerSetSprite(i, layer);
}
}
}
85 changes: 85 additions & 0 deletions Content.Client/_CorvaxNext/Cards/CardSpriteSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using System.Linq;
using Content.Shared._CorvaxNext.Cards.Stack;
using Robust.Client.GameObjects;

namespace Content.Client._CorvaxNext.Cards;

/// <summary>
/// Manages the visual representation of card stacks by dynamically adjusting and configuring sprite layers
/// based on the number of cards in the stack and their properties.
/// </summary>
public sealed class CardSpriteSystem : EntitySystem
{
/// <inheritdoc/>
public override void Initialize()
{

}

public bool TryAdjustLayerQuantity(Entity<SpriteComponent, CardStackComponent> uid, int? cardLimit = null)
{
var sprite = uid.Comp1;
var stack = uid.Comp2;
var cardCount = cardLimit == null ? stack.Cards.Count : Math.Min(stack.Cards.Count, cardLimit.Value);

var layerCount = 0;
//Gets the quantity of layers
foreach (var card in stack.Cards.TakeLast(cardCount))
{
if (!TryComp(card, out SpriteComponent? cardSprite))
return false;

layerCount += cardSprite.AllLayers.Count();
}
//inserts Missing Layers
if (sprite.AllLayers.Count() < layerCount)
{
for (var i = sprite.AllLayers.Count(); i < layerCount; i++)
{
sprite.AddBlankLayer(i);
}
}
//Removes extra layers
else if (sprite.AllLayers.Count() > layerCount)
{
for (var i = sprite.AllLayers.Count() - 1; i >= layerCount; i--)
{
sprite.RemoveLayer(i);
}
}


return true;
}

public bool TryHandleLayerConfiguration(Entity<SpriteComponent, CardStackComponent> uid, int cardCount, Func<Entity<SpriteComponent>, int, int, bool> layerFunc)
{
var sprite = uid.Comp1;
var stack = uid.Comp2;

// int = index of what card it is from
List<(int, ISpriteLayer)> layers = [];

var i = 0;
foreach (var card in stack.Cards.TakeLast(cardCount))
{
if (!TryComp(card, out SpriteComponent? cardSprite))
return false;
layers.AddRange(cardSprite.AllLayers.Select(layer => (i, layer)));
i++;
}

var j = 0;
foreach (var obj in layers)
{
var (cardIndex, layer) = obj;
sprite.LayerSetVisible(j, true);
sprite.LayerSetTexture(j, layer.Texture);
sprite.LayerSetState(j, layer.RsiState.Name);
layerFunc.Invoke((uid, sprite), cardIndex, j);
j++;
}

return true;
}
}
Loading

0 comments on commit 53bfe82

Please sign in to comment.