diff --git a/assets/Data/entity/items/materials.json b/assets/Data/entity/items/materials.json index cf6c8c8e..2adc0da8 100644 --- a/assets/Data/entity/items/materials.json +++ b/assets/Data/entity/items/materials.json @@ -77,6 +77,110 @@ "offsetZ" : 0 }, "iconPath" : "Textures/icons/itemIconItemGeneric.png" + }, + { + "id" : "Copper", + "tokens" : [ + "GRAVITY", + "TARGETABLE" + ], + "graphicsTemplate": { + "model": { + "path" : "Models/items/materials/rock1.glb" + } + }, + "collidable": { + "type" : "CUBE", + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.35, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "rotW": 1, + "offsetX" : 0, + "offsetY" : 0.05, + "offsetZ" : 0 + }, + "iconPath" : "Textures/icons/itemIconItemGeneric.png" + }, + { + "id" : "Tin", + "tokens" : [ + "GRAVITY", + "TARGETABLE" + ], + "graphicsTemplate": { + "model": { + "path" : "Models/items/materials/rock1.glb" + } + }, + "collidable": { + "type" : "CUBE", + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.35, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "rotW": 1, + "offsetX" : 0, + "offsetY" : 0.05, + "offsetZ" : 0 + }, + "iconPath" : "Textures/icons/itemIconItemGeneric.png" + }, + { + "id" : "Bronze", + "tokens" : [ + "GRAVITY", + "TARGETABLE" + ], + "graphicsTemplate": { + "model": { + "path" : "Models/items/materials/rock1.glb" + } + }, + "collidable": { + "type" : "CUBE", + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.35, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "rotW": 1, + "offsetX" : 0, + "offsetY" : 0.05, + "offsetZ" : 0 + }, + "iconPath" : "Textures/icons/itemIconItemGeneric.png" + }, + { + "id" : "Clay", + "tokens" : [ + "GRAVITY", + "TARGETABLE" + ], + "graphicsTemplate": { + "model": { + "path" : "Models/items/materials/rock1.glb" + } + }, + "collidable": { + "type" : "CUBE", + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.35, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "rotW": 1, + "offsetX" : 0, + "offsetY" : 0.05, + "offsetZ" : 0 + }, + "iconPath" : "Textures/icons/itemIconItemGeneric.png" } ], "files" : [ diff --git a/docs/src/highlevel-design/survival/survivalprogression.md b/docs/src/highlevel-design/survival/survivalprogression.md index 84d0de6b..973f67de 100644 --- a/docs/src/highlevel-design/survival/survivalprogression.md +++ b/docs/src/highlevel-design/survival/survivalprogression.md @@ -32,6 +32,7 @@ Chop trees for lumber Stone products - Stone tools - Forge + - Hearth # Copper Age @@ -43,10 +44,38 @@ Copper materials Tools - Scissors - Saw - - Crafting Stations - Spinning wheel - Loom + - Anvil + +Electrical wire + +Piping (antimicrobial) + +# Bronze Age +Essentially just durability improvements on copper age +Allows mining of Iron + +New mechanics? + - Automatons + - Complex machinery + - Flying contraptions + +Tin + - Floating glass process + +# Iron Age + + +Magnets + - Generators + + +# Steel Age + +Rails +Pipes diff --git a/src/main/java/electrosphere/client/ui/components/CraftingPanel.java b/src/main/java/electrosphere/client/ui/components/CraftingPanel.java index cb279f51..4d9dc493 100644 --- a/src/main/java/electrosphere/client/ui/components/CraftingPanel.java +++ b/src/main/java/electrosphere/client/ui/components/CraftingPanel.java @@ -13,6 +13,7 @@ import electrosphere.renderer.ui.elements.Label; import electrosphere.renderer.ui.elements.VirtualScrollable; import electrosphere.renderer.ui.elementtypes.Element; import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaAlignment; +import electrosphere.renderer.ui.events.FocusEvent; /** * The crafting panel @@ -88,6 +89,12 @@ public class CraftingPanel { CraftingPanel.setDetails(rVal, recipeDetailsSection, recipe); selectedRecipe = recipe; }); + recipeButton.setOnFocus((FocusEvent event) -> { + CraftingPanel.setDetails(rVal, recipeDetailsSection, recipe); + selectedRecipe = recipe; + }); + recipeButton.setMarginTop(DETAILS_SPACER_HEIGHT); + recipeButton.setMarginLeft(DETAILS_SPACER_HEIGHT); recipeScrollable.addChild(recipeButton); }); diff --git a/src/main/java/electrosphere/renderer/ui/elements/Button.java b/src/main/java/electrosphere/renderer/ui/elements/Button.java index 69c3f61f..39b435c1 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/Button.java +++ b/src/main/java/electrosphere/renderer/ui/elements/Button.java @@ -1,5 +1,7 @@ package electrosphere.renderer.ui.elements; +import java.util.function.Consumer; + import org.joml.Vector3f; import electrosphere.engine.Globals; @@ -310,6 +312,20 @@ public class Button extends StandardContainerElement implements DrawableElement, onFocusCallback = callback; } + /** + * Custom method to register a consumer as a callback for focus + * @param callback The callback + */ + public void setOnFocus(Consumer callback){ + onFocusCallback = new FocusEventCallback() { + @Override + public boolean execute(FocusEvent event) { + callback.accept(event); + return false; + } + }; + } + @Override public void setOnLoseFocus(FocusEventCallback callback) { onLoseFocusCallback = callback;