Skip to content

Commit

Permalink
🐛 NewCoreItemsDisplay 不尊重原版设置
Browse files Browse the repository at this point in the history
  • Loading branch information
way-zer committed Feb 7, 2025
1 parent dfbdc1e commit 9374078
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/mindustryX/features/ui/NewCoreItemsDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ public class NewCoreItemsDisplay extends Table{
private final ItemSeq planItems = new ItemSeq();
private final ObjectIntMap<Block> planCounter = new ObjectIntMap<>();

private final SettingsV2.Data<Boolean> enable = CheckPref.INSTANCE.create("coreitems");//Origin Setting
private final SettingsV2.Data<Integer> columns = new SettingsV2.SliderPref(4, 15).create("coreItems.columns", 5);
private final SettingsV2.Data<Boolean> showItem = CheckPref.INSTANCE.create("coreItems.showItem", true);
private final SettingsV2.Data<Boolean> showUnit = CheckPref.INSTANCE.create("coreItems.showUnit", true);
private final SettingsV2.Data<Boolean> showPlan = CheckPref.INSTANCE.create("coreItems.showPlan", true);
private final SettingsV2.Data<Boolean> showPower = CheckPref.INSTANCE.create("coreItems.showPower", true);
final List<Data<?>> settings = CollectionsKt.listOf(columns, showItem, showUnit, showPlan, showPower);
final List<Data<?>> settings = CollectionsKt.listOf(enable, columns, showItem, showUnit, showPlan, showPower);

public NewCoreItemsDisplay(){
itemDelta = new int[content.items().size];
Expand Down
2 changes: 1 addition & 1 deletion src/mindustryX/features/ui/WaveInfoDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public float getPrefWidth(){

public Element wrapped(){
var ret = new Table();
ret.add(UIExt.coreItems).touchable(Touchable.disabled).fillX().row();
ret.collapser(UIExt.coreItems, () -> Core.settings.getBool("coreitems")).touchable(Touchable.disabled).growX().row();
ret.add().height(4).row();
ret.collapser(this, () -> enable.getValue()).growX().row();
ret.collapser(tt -> tt.button(Icon.downOpen, Styles.emptyi, () -> enable.setValue(true)), () -> !enable.getValue()).center().row();
Expand Down

0 comments on commit 9374078

Please sign in to comment.