Fix various bugs with construction (#446)

This commit is contained in:
Ephememory
2019-11-21 17:46:37 -05:00
committed by Pieter-Jan Briers
parent 0595088409
commit 94c00dda95
4 changed files with 24 additions and 12 deletions

View File

@@ -161,17 +161,17 @@ namespace Content.Client.Construction
{ {
case ConstructionStepMaterial.MaterialType.Metal: case ConstructionStepMaterial.MaterialType.Metal:
icon = ResourceCache.GetResource<TextureResource>( icon = ResourceCache.GetResource<TextureResource>(
"/Textures/Objects/sheet_metal.png"); "/Textures/Objects/Materials/sheet_metal.png");
text = $"Metal x{mat.Amount}"; text = $"Metal x{mat.Amount}";
break; break;
case ConstructionStepMaterial.MaterialType.Glass: case ConstructionStepMaterial.MaterialType.Glass:
icon = ResourceCache.GetResource<TextureResource>( icon = ResourceCache.GetResource<TextureResource>(
"/Textures/Objects/sheet_glass.png"); "/Textures/Objects/Materials/sheet_glass.png");
text = $"Glass x{mat.Amount}"; text = $"Glass x{mat.Amount}";
break; break;
case ConstructionStepMaterial.MaterialType.Cable: case ConstructionStepMaterial.MaterialType.Cable:
icon = ResourceCache.GetResource<TextureResource>( icon = ResourceCache.GetResource<TextureResource>(
"/Textures/Objects/cable_coil.png"); "/Textures/Objects/Tools/cable_coil.png");
text = $"Cable Coil x{mat.Amount}"; text = $"Cable Coil x{mat.Amount}";
break; break;
default: default:
@@ -183,16 +183,16 @@ namespace Content.Client.Construction
switch (tool.Tool) switch (tool.Tool)
{ {
case ConstructionStepTool.ToolType.Wrench: case ConstructionStepTool.ToolType.Wrench:
icon = ResourceCache.GetResource<TextureResource>("/Textures/Objects/wrench.png"); icon = ResourceCache.GetResource<TextureResource>("/Textures/Objects/Tools/wrench.png");
text = "Wrench"; text = "Wrench";
break; break;
case ConstructionStepTool.ToolType.Crowbar: case ConstructionStepTool.ToolType.Crowbar:
icon = ResourceCache.GetResource<TextureResource>("/Textures/Objects/crowbar.png"); icon = ResourceCache.GetResource<TextureResource>("/Textures/Objects/Tools/crowbar.png");
text = "Crowbar"; text = "Crowbar";
break; break;
case ConstructionStepTool.ToolType.Screwdriver: case ConstructionStepTool.ToolType.Screwdriver:
icon = ResourceCache.GetResource<TextureResource>( icon = ResourceCache.GetResource<TextureResource>(
"/Textures/Objects/screwdriver.png"); "/Textures/Objects/Tools/screwdriver.png");
text = "Screwdriver"; text = "Screwdriver";
break; break;
case ConstructionStepTool.ToolType.Welder: case ConstructionStepTool.ToolType.Welder:
@@ -202,7 +202,7 @@ namespace Content.Client.Construction
break; break;
case ConstructionStepTool.ToolType.Wirecutters: case ConstructionStepTool.ToolType.Wirecutters:
icon = ResourceCache.GetResource<TextureResource>( icon = ResourceCache.GetResource<TextureResource>(
"/Textures/Objects/wirecutter.png"); "/Textures/Objects/Tools/wirecutter.png");
text = "Wirecutters"; text = "Wirecutters";
break; break;
default: default:

View File

@@ -91,8 +91,17 @@ namespace Content.Server.GameObjects.Components.Construction
{ {
Prototype = prototype; Prototype = prototype;
Stage = 1; Stage = 1;
if(prototype.Stages[1].Icon != null)
{
Sprite.AddLayerWithSprite(prototype.Stages[1].Icon); Sprite.AddLayerWithSprite(prototype.Stages[1].Icon);
} }
else
{
Sprite.AddLayerWithSprite(prototype.Icon);
}
}
bool TryProcessStep(ConstructionStep step, IEntity slapped) bool TryProcessStep(ConstructionStep step, IEntity slapped)
{ {

View File

@@ -4,10 +4,10 @@
category: Structures category: Structures
description: Keeps the air in and the greytide out. description: Keeps the air in and the greytide out.
icon: icon:
sprite: Buildings/wall.rsi sprite: Buildings/Walls/solid.rsi
state: full state: full
objecttype: Structure objecttype: Structure
result: wall result: solid_wall
placementmode: SnapgridCenter placementmode: SnapgridCenter
steps: steps:
- material: Metal - material: Metal
@@ -25,7 +25,9 @@
name: Table name: Table
id: table id: table
category: Structures category: Structures
icon: Objects/Furniture/worktop_single.png icon:
sprite: Buildings/table_solid.rsi
state: plain_preview
result: table result: table
placementmode: SnapgridCenter placementmode: SnapgridCenter
steps: steps:

View File

@@ -5,6 +5,7 @@
keywords: [melee] keywords: [melee]
description: A crude spear for when you need to put holes in somebody. description: A crude spear for when you need to put holes in somebody.
icon: Objects/Melee/spear.rsi/spear.png icon: Objects/Melee/spear.rsi/spear.png
result: Spear
objecttype: Item objecttype: Item
steps: steps:
- material: Metal - material: Metal