Config previews

This commit is contained in:
Anuken 2020-05-03 12:08:11 -04:00
parent de77d80dab
commit f188fbb567
2 changed files with 15 additions and 0 deletions

View File

@ -148,6 +148,14 @@ public class DesktopInput extends InputHandler{
Draw.color();
drawRequest(cursorX, cursorY, block, rotation);
block.drawPlace(cursorX, cursorY, rotation, validPlace(cursorX, cursorY, block, rotation));
if(block.saveConfig && block.lastConfig != null){
brequest.set(cursorX, cursorY, rotation, block);
brequest.config = block.lastConfig;
block.drawRequestConfig(brequest, allRequests());
}
}
Draw.reset();

View File

@ -507,6 +507,13 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
protected void drawRequest(BuildRequest request){
request.block.drawRequest(request, allRequests(), validPlace(request.x, request.y, request.block, request.rotation));
if(request.block.saveConfig && request.block.lastConfig != null){
Object conf = request.config;
request.config = block.lastConfig;
request.block.drawRequestConfig(request, allRequests());
request.config = conf;
}
}
/** Draws a placement icon for a specific block. */