Skip to content

Commit

Permalink
Fixed Anuken#10394
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Jan 12, 2025
1 parent 75cd832 commit d414a65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/mindustry/editor/MapProcessorsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static mindustry.Vars.*;

public class MapProcessorsDialog extends BaseDialog{
private IconSelectDialog iconSelect = new IconSelectDialog();
private IconSelectDialog iconSelect = new IconSelectDialog(true);
private TextField search;
private Seq<Building> processors = new Seq<>();
private Table list;
Expand Down
6 changes: 3 additions & 3 deletions core/src/mindustry/logic/LogicDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ private void setup(){
buttons.button("@variables", Icon.menu, () -> {
BaseDialog dialog = new BaseDialog("@variables");
dialog.hidden(() -> {
if(!wasPaused && !net.active()){
if(!wasPaused && !net.active() && !state.isMenu()){
state.set(State.paused);
}
});

dialog.shown(() -> {
if(!wasPaused && !net.active()){
if(!wasPaused && !net.active() && !state.isMenu()){
state.set(State.playing);
}
});
Expand Down Expand Up @@ -220,7 +220,7 @@ private void setup(){
dialog.buttons.button("@logic.globals", Icon.list, () -> globalsDialog.show()).size(210f, 64f);

dialog.show();
}).name("variables").disabled(b -> executor == null || executor.vars.length == 0);
}).name("variables").disabled(b -> executor == null || executor.vars.length == 0 || state.isMenu());

buttons.button("@add", Icon.add, () -> {
showAddDialog();
Expand Down
7 changes: 6 additions & 1 deletion core/src/mindustry/ui/dialogs/IconSelectDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@

public class IconSelectDialog extends Dialog{
private Intc consumer = i -> Log.info("you have mere seconds");
private boolean allowLocked;

public IconSelectDialog(){
this(true);
}

public IconSelectDialog(boolean allowLocked){
closeOnBack();
setFillParent(true);

Expand Down Expand Up @@ -52,7 +57,7 @@ public IconSelectDialog(){

i = 0;
for(UnlockableContent u : content.getBy(ctype).<UnlockableContent>as()){
if(!u.isHidden() && u.unlocked()){
if(!u.isHidden() && (allowLocked || u.unlocked())){
t.button(new TextureRegionDrawable(u.uiIcon), Styles.flati, iconMed, () -> {
hide();
consumer.get(u.emojiChar());
Expand Down

0 comments on commit d414a65

Please sign in to comment.