Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2025-04-30 13:10:10 -04:00
36 changed files with 46 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ public class LogicDialog extends BaseDialog{
boolean privileged;
@Nullable LExecutor executor;
GlobalVarsDialog globalsDialog = new GlobalVarsDialog();
boolean wasRows, wasPortrait;
boolean wasRows, wasPortrait, forceRestart;
public LogicDialog(){
super("logic");
@@ -142,7 +142,14 @@ public class LogicDialog extends BaseDialog{
}catch(Throwable e){
ui.showException(e);
}
}).marginLeft(12f).disabled(b -> Core.app.getClipboardText() == null);
}).marginLeft(12f).disabled(b -> Core.app.getClipboardText() == null).row();
t.button("@logic.restart", Icon.refresh, style, () -> {
forceRestart = true;
dialog.hide();
hide();
}).marginLeft(12f);
});
});
@@ -336,6 +343,7 @@ public class LogicDialog extends BaseDialog{
public void show(String code, LExecutor executor, boolean privileged, Cons<String> modified){
this.executor = executor;
this.privileged = privileged;
this.forceRestart = false;
canvas.statements.clearChildren();
canvas.rebuild();
canvas.privileged = privileged;
@@ -346,7 +354,7 @@ public class LogicDialog extends BaseDialog{
canvas.load("");
}
this.consumer = result -> {
if(!result.equals(code)){
if(forceRestart || !result.equals(code)){
modified.get(result);
}
};