mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-21 01:37:13 +07:00
Fixed #8904
This commit is contained in:
parent
3157ff8cea
commit
19f34c14a0
@ -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){
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user