Всякое по мелочи (#148)

* fix: у мартышек снова отображается одежда

* fix: с зеркалом снова можно взаимодействовать

* tweak: шлюзы культа теперь работают как двери, а не шлюзы

* remove: убрано отображение текущего патрона у револьверов

* add: новые плитки для мапперов
This commit is contained in:
Remuchi
2024-03-01 15:51:17 +07:00
committed by GitHub
parent 95589e29c1
commit 9430e2d53c
41 changed files with 284 additions and 276 deletions

View File

@@ -102,13 +102,8 @@ public sealed class ClientClothingSystem : ClothingSystem
// if that returned nothing, attempt to find generic data
if (layers == null && !item.ClothingVisuals.TryGetValue(args.Slot, out layers))
{
if (!TryComp(args.Equipee, out HumanoidAppearanceComponent? humanoid))
{
return;
}
// No generic data either. Attempt to generate defaults from the item's RSI & item-prefixes
if (!TryGetDefaultVisuals(uid, item, args.Slot, inventory.SpeciesId, humanoid, out layers))
if (!TryGetDefaultVisuals(uid, item, args.Slot, inventory.SpeciesId, args.Equipee, out layers))
return;
}
@@ -139,7 +134,7 @@ public sealed class ClientClothingSystem : ClothingSystem
ClothingComponent clothing,
string slot,
string? speciesId,
HumanoidAppearanceComponent humanoid,
EntityUid? target,
[NotNullWhen(true)] out List<PrototypeLayerData>? layers)
{
layers = null;
@@ -166,10 +161,13 @@ public sealed class ClientClothingSystem : ClothingSystem
state = $"{clothing.EquippedState}";
// body type specific
var bodyTypeProto = _prototypeManager.Index<BodyTypePrototype>(humanoid.BodyType);
if (rsi.TryGetState($"{state}-{bodyTypeProto.Name}", out _))
if (TryComp(target, out HumanoidAppearanceComponent? humanoid))
{
state = $"{state}-{bodyTypeProto.Name}";
var bodyTypeProto = _prototypeManager.Index<BodyTypePrototype>(humanoid.BodyType);
if (rsi.TryGetState($"{state}-{bodyTypeProto.Name}", out _))
{
state = $"{state}-{bodyTypeProto.Name}";
}
}
// species specific
@@ -389,4 +387,4 @@ public sealed class ClientClothingSystem : ClothingSystem
sprite.LayerSetVisible(layer, true);
}
}
}

View File

@@ -434,7 +434,7 @@ public sealed partial class GunSystem
}));
}
public void Update(int currentIndex, bool?[] bullets)
public void Update(bool?[] bullets)
{
_bulletsList.RemoveAllChildren();
var capacity = bullets.Length;
@@ -456,10 +456,10 @@ public sealed partial class GunSystem
var texture = StaticIoC.ResC.GetTexture(texturePath);
var spentTexture = StaticIoC.ResC.GetTexture("/Textures/Interface/ItemStatus/Bullets/empty.png");
FillBulletRow(currentIndex, bullets, _bulletsList, texture, spentTexture);
FillBulletRow(bullets, _bulletsList, texture, spentTexture);
}
private void FillBulletRow(int currentIndex, bool?[] bullets, Control container, Texture texture, Texture emptyTexture)
private void FillBulletRow(bool?[] bullets, Control container, Texture texture, Texture emptyTexture)
{
var capacity = bullets.Length;
var colorA = Color.FromHex("#b68f0e");
@@ -467,7 +467,6 @@ public sealed partial class GunSystem
var colorSpentA = Color.FromHex("#b50e25");
var colorSpentB = Color.FromHex("#d3745f");
var colorGoneA = Color.FromHex("#000000");
var colorGoneB = Color.FromHex("#222222");
var altColor = false;
var scale = 1.3f;
@@ -480,15 +479,6 @@ public sealed partial class GunSystem
{
MinSize = texture.Size * scale,
};
if (i == currentIndex)
{
box.AddChild(new TextureRect
{
Texture = texture,
TextureScale = new Vector2(scale, scale),
ModulateSelfOverride = Color.LimeGreen,
});
}
Color color;
Texture bulletTexture = texture;
@@ -506,7 +496,7 @@ public sealed partial class GunSystem
}
else
{
color = altColor ? colorGoneA : colorGoneB;
color = colorGoneA;
}
box.AddChild(new TextureRect

View File

@@ -29,7 +29,7 @@ public sealed partial class GunSystem
private void OnRevolverAmmoUpdate(EntityUid uid, RevolverAmmoProviderComponent component, UpdateAmmoCounterEvent args)
{
if (args.Control is not RevolverStatusControl control) return;
control.Update(component.CurrentIndex, component.Chambers);
control.Update(component.Chambers);
}
private void OnRevolverCounter(EntityUid uid, RevolverAmmoProviderComponent component, AmmoCounterControlEvent args)