Fixes lathe stuff (#3383)

This commit is contained in:
Swept
2021-02-23 07:53:14 +00:00
committed by GitHub
parent e05698c027
commit 1e13c3b265
17 changed files with 99 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
using System; using System;
using Content.Shared.GameObjects.Components.Power; using Content.Shared.GameObjects.Components.Power;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.Animations; using Robust.Client.Animations;
@@ -18,6 +18,7 @@ namespace Content.Client.GameObjects.Components.Power
private Animation _insertingGlassAnimation; private Animation _insertingGlassAnimation;
private Animation _insertingGoldAnimation; private Animation _insertingGoldAnimation;
private Animation _insertingPlasmaAnimation; private Animation _insertingPlasmaAnimation;
private Animation _insertingPlasticAnimation;
public override void LoadData(YamlMappingNode node) public override void LoadData(YamlMappingNode node)
{ {
@@ -28,6 +29,7 @@ namespace Content.Client.GameObjects.Components.Power
_insertingGlassAnimation = PopulateAnimation("autolathe_inserting_glass_plate", "autolathe_inserting_unlit", 0.9f); _insertingGlassAnimation = PopulateAnimation("autolathe_inserting_glass_plate", "autolathe_inserting_unlit", 0.9f);
_insertingGoldAnimation = PopulateAnimation("autolathe_inserting_gold_plate", "autolathe_inserting_unlit", 0.9f); _insertingGoldAnimation = PopulateAnimation("autolathe_inserting_gold_plate", "autolathe_inserting_unlit", 0.9f);
_insertingPlasmaAnimation = PopulateAnimation("autolathe_inserting_plasma_sheet", "autolathe_inserting_unlit", 0.9f); _insertingPlasmaAnimation = PopulateAnimation("autolathe_inserting_plasma_sheet", "autolathe_inserting_unlit", 0.9f);
_insertingPlasticAnimation = PopulateAnimation("autolathe_inserting_plastic_sheet", "autolathe_inserting_unlit", 0.9f);
} }
private Animation PopulateAnimation(string sprite, string spriteUnlit, float length) private Animation PopulateAnimation(string sprite, string spriteUnlit, float length)
@@ -107,6 +109,12 @@ namespace Content.Client.GameObjects.Components.Power
animPlayer.Play(_insertingPlasmaAnimation, AnimationKey); animPlayer.Play(_insertingPlasmaAnimation, AnimationKey);
} }
break; break;
case LatheVisualState.InsertingPlastic:
if (!animPlayer.HasRunningAnimation(AnimationKey))
{
animPlayer.Play(_insertingPlasticAnimation, AnimationKey);
}
break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using Content.Shared.GameObjects.Components.Power; using Content.Shared.GameObjects.Components.Power;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.Animations; using Robust.Client.Animations;
@@ -18,6 +18,7 @@ namespace Content.Client.GameObjects.Components.Power
private Animation _insertingGlassAnimation; private Animation _insertingGlassAnimation;
private Animation _insertingGoldAnimation; private Animation _insertingGoldAnimation;
private Animation _insertingPlasmaAnimation; private Animation _insertingPlasmaAnimation;
private Animation _insertingPlasticAnimation;
public override void LoadData(YamlMappingNode node) public override void LoadData(YamlMappingNode node)
{ {
@@ -28,6 +29,7 @@ namespace Content.Client.GameObjects.Components.Power
_insertingGlassAnimation = PopulateAnimation("protolathe_glass", 0.9f); _insertingGlassAnimation = PopulateAnimation("protolathe_glass", 0.9f);
_insertingGoldAnimation = PopulateAnimation("protolathe_gold", 0.9f); _insertingGoldAnimation = PopulateAnimation("protolathe_gold", 0.9f);
_insertingPlasmaAnimation = PopulateAnimation("protolathe_plasma", 0.9f); _insertingPlasmaAnimation = PopulateAnimation("protolathe_plasma", 0.9f);
_insertingPlasticAnimation = PopulateAnimation("protolathe_plastic", 0.9f);
} }
private Animation PopulateAnimation(string sprite, float length) private Animation PopulateAnimation(string sprite, float length)
@@ -103,6 +105,12 @@ namespace Content.Client.GameObjects.Components.Power
animPlayer.Play(_insertingPlasmaAnimation, AnimationKey); animPlayer.Play(_insertingPlasmaAnimation, AnimationKey);
} }
break; break;
case LatheVisualState.InsertingPlastic:
if (!animPlayer.HasRunningAnimation(AnimationKey))
{
animPlayer.Play(_insertingPlasticAnimation, AnimationKey);
}
break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Power namespace Content.Shared.GameObjects.Components.Power
@@ -11,6 +11,7 @@ namespace Content.Shared.GameObjects.Components.Power
InsertingMetal, InsertingMetal,
InsertingGlass, InsertingGlass,
InsertingGold, InsertingGold,
InsertingPlasma InsertingPlasma,
InsertingPlastic
} }
} }

View File

@@ -41510,7 +41510,7 @@ entities:
- supplyRate: 6000 - supplyRate: 6000
type: PowerSupplier type: PowerSupplier
- uid: 4717 - uid: 4717
type: Spade type: HydroponicsToolSpade
components: components:
- parent: 853 - parent: 853
pos: -20.5,-1.5 pos: -20.5,-1.5

View File

@@ -3,7 +3,7 @@
icon: icon:
sprite: Objects/Tools/Hydroponics/hoe.rsi sprite: Objects/Tools/Hydroponics/hoe.rsi
state: icon state: icon
result: MiniHoe result: HydroponicsToolMiniHoe
completetime: 500 completetime: 500
materials: materials:
steel: 30 steel: 30
@@ -13,7 +13,7 @@
icon: icon:
sprite: Objects/Tools/Hydroponics/scythe.rsi sprite: Objects/Tools/Hydroponics/scythe.rsi
state: icon state: icon
result: Scythe result: HydroponicsToolScythe
completetime: 500 completetime: 500
materials: materials:
steel: 40 steel: 40
@@ -24,7 +24,7 @@
icon: icon:
sprite: Objects/Tools/Hydroponics/hatchet.rsi sprite: Objects/Tools/Hydroponics/hatchet.rsi
state: icon state: icon
result: Hatchet result: HydroponicsToolHatchet
completetime: 500 completetime: 500
materials: materials:
steel: 60 steel: 60
@@ -34,7 +34,7 @@
icon: icon:
sprite: Objects/Tools/Hydroponics/spade.rsi sprite: Objects/Tools/Hydroponics/spade.rsi
state: icon state: icon
result: Spade result: HydroponicsToolSpade
completetime: 500 completetime: 500
materials: materials:
steel: 40 steel: 40

View File

@@ -207,18 +207,18 @@
parent: MaterialStack parent: MaterialStack
suffix: Full suffix: Full
components: components:
- type: Material - type: Material
materials: materials:
- key: enum.MaterialKeys.Stack - key: enum.MaterialKeys.Stack
mat: wood mat: wood
- type: Stack - type: Stack
stacktype: enum.StackType.Wood stacktype: enum.StackType.Wood
- type: Sprite - type: Sprite
sprite: Objects/Materials/materials.rsi sprite: Objects/Materials/materials.rsi
state: wood state: wood
- type: Item - type: Item
sprite: Objects/Materials/materials.rsi sprite: Objects/Materials/materials.rsi
HeldPrefix: wood HeldPrefix: wood
- type: entity - type: entity
id: WoodPlank1 id: WoodPlank1
@@ -226,8 +226,8 @@
parent: WoodPlank parent: WoodPlank
suffix: 1 suffix: 1
components: components:
- type: Stack - type: Stack
count: 1 count: 1
- type: entity - type: entity
name: plastic sheet name: plastic sheet
@@ -235,18 +235,18 @@
parent: MaterialStack parent: MaterialStack
suffix: Full suffix: Full
components: components:
- type: Material - type: Material
materials: materials:
- key: enum.MaterialKeys.Stack - key: enum.MaterialKeys.Stack
mat: plastic mat: plastic
- type: Stack - type: Stack
stacktype: enum.StackType.Plastic stacktype: enum.StackType.Plastic
- type: Sprite - type: Sprite
sprite: Objects/Materials/sheets.rsi/plastic.png sprite: Objects/Materials/sheets.rsi
state: plastic state: plastic
- type: Item - type: Item
sprite: Objects/Materials/sheets.rsi/plastic.png sprite: Objects/Materials/sheets.rsi
HeldPrefix: plastic HeldPrefix: plastic
- type: entity - type: entity
id: PlasticSheet1 id: PlasticSheet1
@@ -254,5 +254,5 @@
parent: PlasticSheet parent: PlasticSheet
suffix: 1 suffix: 1
components: components:
- type: Stack - type: Stack
count: 1 count: 1

View File

@@ -52,7 +52,7 @@
- type: entity - type: entity
name: spade name: spade
parent: BaseItem parent: BaseItem
id: Spade id: HydroponicsToolSpade
description: A small tool for digging and moving dirt. description: A small tool for digging and moving dirt.
components: components:
- type: Tag - type: Tag

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -125,6 +125,22 @@
] ]
] ]
}, },
{
"name": "autolathe_inserting_plastic_sheet",
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
},
{ {
"name": "autolathe_inserting_unlit", "name": "autolathe_inserting_unlit",
"delays": [ "delays": [

View File

@@ -127,6 +127,22 @@
] ]
] ]
}, },
{
"name": "protolathe_plastic",
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{ {
"name": "protolathe_building", "name": "protolathe_building",
"delays": [ "delays": [

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

View File

@@ -32,7 +32,7 @@
"name": "uranium" "name": "uranium"
}, },
{ {
"name": "wood_plank" "name": "wood"
}, },
{ {
"name": "wool" "name": "wool"
@@ -75,9 +75,6 @@
}, },
{ {
"name": "rods" "name": "rods"
},
{
"name": "plastic"
} }
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

View File

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 335 B

View File

@@ -68,6 +68,17 @@
}, },
{ {
"name": "researchicon" "name": "researchicon"
},
{
"name": "plastic"
},
{
"name": "plastic-inhand-left",
"directions": 4
},
{
"name": "plastic-inhand-right",
"directions": 4
} }
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B