This commit is contained in:
austin 2025-04-13 13:40:25 -04:00
parent 18cf677bd3
commit 8b9a725763
4 changed files with 157 additions and 1 deletions

View File

@ -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" : [

View File

@ -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

View File

@ -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);
});

View File

@ -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<FocusEvent> callback){
onFocusCallback = new FocusEventCallback() {
@Override
public boolean execute(FocusEvent event) {
callback.accept(event);
return false;
}
};
}
@Override
public void setOnLoseFocus(FocusEventCallback callback) {
onLoseFocusCallback = callback;