]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make vox roundstart (#29704)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Thu, 4 Jul 2024 07:11:01 +0000 (17:11 +1000)
committerGitHub <noreply@github.com>
Thu, 4 Jul 2024 07:11:01 +0000 (17:11 +1000)
* Make vox roundstart

I believe all the issues are fixed.

* Click detection bandaid

Content.Client/Clickable/ClickableComponent.cs
Resources/Prototypes/Species/vox.yml

index 6f75df46830eb9b29d8e33d7073a13277b3b6bc0..987473ca46cdc12c39899a576758debf2c8a058e 100644 (file)
@@ -48,7 +48,7 @@ namespace Content.Client.Clickable
             Angle cardinalSnapping = sprite.SnapCardinals ? relativeRotation.GetCardinalDir().ToAngle() : Angle.Zero;
 
             // First we get `localPos`, the clicked location in the sprite-coordinate frame.
-            var entityXform = Matrix3Helpers.CreateInverseTransform(transform.WorldPosition, sprite.NoRotation ? -eye.Rotation : spriteRot - cardinalSnapping);
+            var entityXform = Matrix3Helpers.CreateInverseTransform(spritePos, sprite.NoRotation ? -eye.Rotation : spriteRot - cardinalSnapping);
             var localPos = Vector2.Transform(Vector2.Transform(worldPos, entityXform), invSpriteMatrix);
 
             // Check explicitly defined click-able bounds
@@ -58,8 +58,11 @@ namespace Content.Client.Clickable
             // Next check each individual sprite layer using automatically computed click maps.
             foreach (var spriteLayer in sprite.AllLayers)
             {
-                if (!spriteLayer.Visible || spriteLayer is not Layer layer)
+                // TODO: Move this to a system and also use SpriteSystem.IsVisible instead.
+                if (!spriteLayer.Visible || spriteLayer is not Layer layer || layer.CopyToShaderParameters != null)
+                {
                     continue;
+                }
 
                 // Check the layer's texture, if it has one
                 if (layer.Texture != null)
index e3fdb2bf08f0de1d05d929c712dc310c4cbf0816..7419f3f277e9fb16b2b48da69e551329ebb5be70 100644 (file)
@@ -1,7 +1,7 @@
 - type: species
   id: Vox
   name: species-name-vox
-  roundStart: false # sad
+  roundStart: true
   prototype: MobVox
   sprites: MobVoxSprites
   markingLimits: MobVoxMarkingLimits