mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-15 10:17:39 +07:00
Config previews
This commit is contained in:
@ -148,6 +148,14 @@ public class DesktopInput extends InputHandler{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
drawRequest(cursorX, cursorY, block, rotation);
|
drawRequest(cursorX, cursorY, block, rotation);
|
||||||
block.drawPlace(cursorX, cursorY, rotation, validPlace(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();
|
Draw.reset();
|
||||||
|
@ -507,6 +507,13 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
|
|
||||||
protected void drawRequest(BuildRequest request){
|
protected void drawRequest(BuildRequest request){
|
||||||
request.block.drawRequest(request, allRequests(), validPlace(request.x, request.y, request.block, request.rotation));
|
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. */
|
/** Draws a placement icon for a specific block. */
|
||||||
|
Reference in New Issue
Block a user