Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2026-02-19 22:01:31 -05:00
37 changed files with 76 additions and 18 deletions

View File

@@ -88,7 +88,7 @@ public class ContentInfoDialog extends BaseDialog{
for(Stat stat : map.keys()){
table.table(inset -> {
inset.left();
inset.add("[lightgray]" + stat.localized() + ":[] ").left().top();
stats.statInfo(inset.add("[lightgray]" + stat.localized() + ":[] ").left().top(), stat);
Seq<StatValue> arr = map.get(stat);
for(StatValue value : arr){
value.display(inset);

View File

@@ -1,11 +1,17 @@
package mindustry.world.meta;
import arc.*;
import arc.scene.ui.layout.*;
import arc.struct.ObjectMap.*;
import arc.struct.*;
import arc.util.*;
import mindustry.*;
import mindustry.gen.*;
import mindustry.mod.*;
import mindustry.type.*;
import java.util.*;
/** Hold and organizes a list of block stats. */
@NoPatch
public class Stats{
@@ -131,4 +137,21 @@ public class Stats{
}
return map;
}
public void statInfo(Cell<?> cell, Stat stat){
if(cell == null || stat == null) return;
String key = "stat." + stat.name.toLowerCase(Locale.ROOT);
if(Core.bundle.has(key + ".info")){
if(Vars.mobile && !Core.graphics.isPortrait()){ //disabled in portrait - broken and goes offscreen
Table table = new Table();
table.add(cell.get()).left().expandX().fillX();
cell.clearElement();
table.button(Icon.infoSmall, () -> Vars.ui.showInfo("@" + key + ".info")).size(32f).right();
cell.setElement(table).left().expandX().fillX();
}else{
cell.tooltip("@" + key + ".info");
}
}
}
}