mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-13 10:20:43 -07:00
parent
b72031e62f
commit
061b12ed80
3 changed files with 25 additions and 1 deletions
|
|
@ -1045,6 +1045,7 @@ stat.boosteffect = Boost Effect
|
|||
stat.maxunits = Max Active Units
|
||||
stat.health = Health
|
||||
stat.armor = Armor
|
||||
stat.armor.info = Applied damage = incoming damage - armor.\nUp to 90% maximum damage reduction.
|
||||
stat.buildtime = Build Time
|
||||
stat.maxconsecutive = Max Consecutive
|
||||
stat.buildcost = Build Cost
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue