MaterialsList.SetOwner(Entity);
}
+ protected override void Opened()
+ {
+ base.Opened();
+
+ if (_entityManager.TryGetComponent<LatheComponent>(Entity, out var latheComp))
+ {
+ AmountLineEdit.SetText(latheComp.DefaultProductionAmount.ToString());
+ }
+ }
+
/// <summary>
/// Populates the list of all the recipes
/// </summary>
var recipe = component.Queue.First();
component.Queue.RemoveAt(0);
- var time = _reagentSpeed.ApplySpeed(uid, recipe.CompleteTime);
+ var time = _reagentSpeed.ApplySpeed(uid, recipe.CompleteTime) * component.TimeMultiplier;
var lathe = EnsureComp<LatheProducingComponent>(uid);
lathe.StartTime = _timing.CurTime;
- lathe.ProductionLength = time * component.TimeMultiplier;
+ lathe.ProductionLength = time;
component.CurrentRecipe = recipe;
var ev = new LatheStartPrintingEvent(recipe);
_audio.PlayPvs(component.ProducingSound, uid);
UpdateRunningAppearance(uid, true);
UpdateUserInterfaceState(uid, component);
+
+ if (time == TimeSpan.Zero)
+ {
+ FinishProducing(uid, component, lathe);
+ }
return true;
}
[DataField]
public string? ReagentOutputSlotId;
+ /// <summary>
+ /// The default amount that's displayed in the UI for selecting the print amount.
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public int DefaultProductionAmount = 1;
+
#region Visualizer info
[DataField]
public string? IdleState;
foreach (var otherStack in intersecting)
{
var otherEnt = otherStack.Owner;
+ // if you merge a ton of stacks together, you will end up deleting a few by accident.
+ if (TerminatingOrDeleted(otherEnt) || EntityManager.IsQueuedForDeletion(otherEnt))
+ continue;
if (!TryMergeStacks(uid, otherEnt, out _, stack, otherStack))
continue;
- type: Lathe
idleState: icon
runningState: building
+ defaultProductionAmount: 10
staticRecipes:
- - SheetSteel30
- - SheetGlass30
- - SheetRGlass30
- - SheetPlasma30
- - SheetPGlass30
- - SheetRPGlass30
- - SheetUranium30
- - IngotGold30
- - IngotSilver30
- - MaterialBananium10
+ - SheetSteel
+ - SheetGlass1
+ - SheetRGlass
+ - SheetPlasma1
+ - SheetPGlass1
+ - SheetRPGlass1
+ - SheetUranium1
+ - IngotGold1
+ - IngotSilver1
+ - MaterialBananium1
- MaterialDiamond
- type: entity
materialUseMultiplier: 0.75
timeMultiplier: 0.5
staticRecipes:
- - SheetSteel30
- - SheetGlass30
- - SheetRGlass30
- - SheetPlasma30
- - SheetPGlass30
- - SheetRPGlass30
- - SheetPlasteel30
- - SheetUranium30
- - SheetUGlass30
- - SheetRUGlass30
- - IngotGold30
- - IngotSilver30
- - MaterialBananium10
+ - SheetSteel
+ - SheetGlass1
+ - SheetRGlass
+ - SheetPlasma1
+ - SheetPGlass1
+ - SheetRPGlass1
+ - SheetPlasteel1
+ - SheetUranium1
+ - SheetUGlass1
+ - SheetRUGlass1
+ - IngotGold1
+ - IngotSilver1
+ - MaterialBananium1
- MaterialDiamond
- type: entity
- type: latheRecipe
id: SheetSteel
result: SheetSteel1
- applyMaterialDiscount: false
- completetime: 2
+ completetime: 0
materials:
RawIron: 100
+ Coal: 30
- type: latheRecipe
id: SheetSteel30
- type: latheRecipe
id: SheetGlass1
result: SheetGlass1
- applyMaterialDiscount: false
- completetime: 2
+ completetime: 0
materials:
RawQuartz: 100
- type: latheRecipe
id: SheetRGlass
result: SheetRGlass1
- applyMaterialDiscount: false
- completetime: 2
+ completetime: 0
materials:
Glass: 100
Steel: 50
+ Coal: 15
- type: latheRecipe
id: SheetRGlass30
RawIron: 1500
Coal: 500
+- type: latheRecipe
+ id: SheetPGlass1
+ result: SheetPGlass1
+ completetime: 0
+ materials:
+ RawQuartz: 100
+ RawPlasma: 100
+
- type: latheRecipe
id: SheetPGlass30
result: SheetPGlass
RawQuartz: 3000
RawPlasma: 3000
+- type: latheRecipe
+ id: SheetRPGlass1
+ result: SheetRPGlass1
+ completetime: 0
+ materials:
+ RawQuartz: 100
+ RawPlasma: 100
+ RawIron: 50
+ Coal: 15
+
- type: latheRecipe
id: SheetRPGlass30
result: SheetRPGlass
RawIron: 1500
Coal: 500
+- type: latheRecipe
+ id: SheetPlasma1
+ result: SheetPlasma1
+ completetime: 0
+ materials:
+ RawPlasma: 100
+
- type: latheRecipe
id: SheetPlasma30
result: SheetPlasma
materials:
RawPlasma: 3000
+- type: latheRecipe
+ id: SheetPlasteel1
+ result: SheetPlasteel1
+ completetime: 0
+ materials:
+ RawPlasma: 100
+ RawIron: 200 #Twice as durable as steel, Twice the material cost
+ Coal: 30
+
- type: latheRecipe
id: SheetPlasteel30
result: SheetPlasteel
materials:
RawUranium: 3000
+- type: latheRecipe
+ id: SheetUGlass1
+ result: SheetUGlass1
+ completetime: 0
+ materials:
+ RawUranium: 100
+ RawQuartz: 100
+
- type: latheRecipe
id: SheetUGlass30
result: SheetUGlass
RawUranium: 3000
RawQuartz: 3000
+- type: latheRecipe
+ id: SheetRUGlass1
+ result: SheetRUGlass1
+ completetime: 0
+ materials:
+ RawUranium: 100
+ RawQuartz: 100
+ RawIron: 50
+ Coal: 15
+
- type: latheRecipe
id: SheetRUGlass30
result: SheetRUGlass
- type: latheRecipe
id: MaterialDiamond
result: MaterialDiamond1
- completetime: 3
+ completetime: 0
materials:
- RawDiamond: 1000
+ RawDiamond: 100
- type: latheRecipe
id: SheetUranium1
result: SheetUranium1
- completetime: 2
+ completetime: 0
materials:
- RawUranium: 500
+ RawUranium: 100
- type: latheRecipe
id: IngotGold1
result: IngotGold1
- completetime: 2
+ completetime: 0
materials:
- RawGold: 500
+ RawGold: 100
- type: latheRecipe
id: IngotSilver1
result: IngotSilver1
- completetime: 2
+ completetime: 0
materials:
- RawSilver: 500
+ RawSilver: 100
- type: latheRecipe
id: SheetPlastic
result: SheetPlastic1
applyMaterialDiscount: false
- completetime: 2
+ completetime: 0
materials:
Plastic: 100
- type: latheRecipe
id: MaterialBananium1
result: MaterialBananium1
- completetime: 2
+ completetime: 0
materials:
- RawBananium: 500
+ RawBananium: 100
- type: latheRecipe
id: MaterialSheetMeat