mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-30 04:10:41 -08:00
Processor list bugfixes
This commit is contained in:
parent
b4b6b9fa44
commit
37dc449471
3 changed files with 20 additions and 4 deletions
|
|
@ -92,7 +92,7 @@ public class MapProcessorsDialog extends BaseDialog{
|
|||
|
||||
t.button((log.tag == null ? "<no name>\n" : "[accent]" + log.tag + "\n") + "[lightgray][[" + log.tile.x + ", " + log.tile.y + "]", Styles.grayt, () -> {
|
||||
//TODO: bug: if you edit name inside of the edit dialog, it won't show up in the list properly
|
||||
log.showEditDialog();
|
||||
log.showEditDialog(true);
|
||||
}).size(Vars.mobile ? 390f : 450f, h).margin(10f).with(b -> {
|
||||
b.getLabel().setAlignment(Align.left, Align.left);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class LogicDialog extends BaseDialog{
|
|||
TextButtonStyle style = Styles.flatt;
|
||||
t.defaults().size(280f, 60f).left();
|
||||
|
||||
if(privileged && executor != null && executor.build != null){// && !ui.editor.isShown()
|
||||
if(privileged && executor != null && executor.build != null && !ui.editor.isShown()){
|
||||
t.button("@editor.worldprocessors.editname", Icon.edit, style, () -> {
|
||||
ui.showTextInput("", "@editor.name", LogicBlock.maxNameLength, executor.build.tag == null ? "" : executor.build.tag, tag -> {
|
||||
if(privileged && executor != null && executor.build != null){
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class LogicBlock extends Block{
|
|||
build.readCompressed(data, true);
|
||||
});
|
||||
|
||||
config(String.class,(LogicBuild build, String data) -> {
|
||||
config(String.class, (LogicBuild build, String data) -> {
|
||||
if(!accessible() || !privileged) return;
|
||||
|
||||
if(data != null && data.length() < maxNameLength){
|
||||
|
|
@ -68,6 +68,12 @@ public class LogicBlock extends Block{
|
|||
}
|
||||
});
|
||||
|
||||
config(Character.class, (LogicBuild build, Character data) -> {
|
||||
if(!accessible() || !privileged) return;
|
||||
|
||||
build.iconTag = data;
|
||||
});
|
||||
|
||||
config(Integer.class, (LogicBuild entity, Integer pos) -> {
|
||||
if(!accessible()) return;
|
||||
|
||||
|
|
@ -634,7 +640,17 @@ public class LogicBlock extends Block{
|
|||
}
|
||||
|
||||
public void showEditDialog(){
|
||||
ui.logic.show(code, executor, privileged, code -> configure(compress(code, relativeConnections())));
|
||||
showEditDialog(false);
|
||||
}
|
||||
|
||||
public void showEditDialog(boolean forceEditor){
|
||||
ui.logic.show(code, executor, privileged, code -> {
|
||||
boolean prev = state.rules.editor;
|
||||
//this is a hack to allow configuration to work correctly in the editor for privileged processors
|
||||
if(forceEditor) state.rules.editor = true;
|
||||
configure(compress(code, relativeConnections()));
|
||||
state.rules.editor = prev;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue