Fixed #5609
This commit is contained in:
@@ -16,6 +16,7 @@ import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.logic.LStatements.*;
|
||||
import mindustry.ui.*;
|
||||
|
||||
public class LCanvas extends Table{
|
||||
@@ -395,11 +396,20 @@ public class LCanvas extends Table{
|
||||
}
|
||||
|
||||
public void copy(){
|
||||
st.saveUI();
|
||||
LStatement copy = st.copy();
|
||||
|
||||
if(copy instanceof JumpStatement st && st.destIndex != -1){
|
||||
int index = statements.getChildren().indexOf(this);
|
||||
if(index != -1 && index < st.destIndex){
|
||||
st.destIndex ++;
|
||||
}
|
||||
}
|
||||
|
||||
if(copy != null){
|
||||
StatementElem s = new StatementElem(copy);
|
||||
|
||||
statements.addChildAfter(StatementElem.this,s);
|
||||
statements.addChildAfter(StatementElem.this, s);
|
||||
statements.layout();
|
||||
copy.elem = s;
|
||||
copy.setupUI();
|
||||
|
||||
Reference in New Issue
Block a user