This commit is contained in:
Anuken 2023-08-08 09:29:20 -04:00
parent 3157ff8cea
commit 19f34c14a0
2 changed files with 10 additions and 1 deletions

View File

@ -228,11 +228,20 @@ public class LogicDialog extends BaseDialog{
}
public void show(String code, LExecutor executor, boolean privileged, Cons<String> modified){
show(code, executor, privileged, null, modified);
}
public void show(String code, LExecutor executor, boolean privileged, @Nullable Building build, Cons<String> modified){
this.executor = executor;
this.privileged = privileged;
canvas.statements.clearChildren();
canvas.rebuild();
canvas.privileged = privileged;
update(() -> {
if(build != null && (!build.isValid() || !state.isGame())){
hide();
}
});
try{
canvas.load(code);
}catch(Throwable t){

View File

@ -577,7 +577,7 @@ public class LogicBlock extends Block{
@Override
public void buildConfiguration(Table table){
table.button(Icon.pencil, Styles.cleari, () -> {
ui.logic.show(code, executor, privileged, code -> configure(compress(code, relativeConnections())));
ui.logic.show(code, executor, privileged, this, code -> configure(compress(code, relativeConnections())));
}).size(40);
}