@@ -1045,6 +1045,7 @@ stat.boosteffect = Boost Effect
|
|||||||
stat.maxunits = Max Active Units
|
stat.maxunits = Max Active Units
|
||||||
stat.health = Health
|
stat.health = Health
|
||||||
stat.armor = Armor
|
stat.armor = Armor
|
||||||
|
stat.armor.info = Applied damage = incoming damage - armor.\nUp to 90% maximum damage reduction.
|
||||||
stat.buildtime = Build Time
|
stat.buildtime = Build Time
|
||||||
stat.maxconsecutive = Max Consecutive
|
stat.maxconsecutive = Max Consecutive
|
||||||
stat.buildcost = Build Cost
|
stat.buildcost = Build Cost
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class ContentInfoDialog extends BaseDialog{
|
|||||||
for(Stat stat : map.keys()){
|
for(Stat stat : map.keys()){
|
||||||
table.table(inset -> {
|
table.table(inset -> {
|
||||||
inset.left();
|
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);
|
Seq<StatValue> arr = map.get(stat);
|
||||||
for(StatValue value : arr){
|
for(StatValue value : arr){
|
||||||
value.display(inset);
|
value.display(inset);
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package mindustry.world.meta;
|
package mindustry.world.meta;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
import arc.struct.ObjectMap.*;
|
import arc.struct.ObjectMap.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
import mindustry.mod.*;
|
import mindustry.mod.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/** Hold and organizes a list of block stats. */
|
/** Hold and organizes a list of block stats. */
|
||||||
@NoPatch
|
@NoPatch
|
||||||
public class Stats{
|
public class Stats{
|
||||||
@@ -131,4 +137,21 @@ public class Stats{
|
|||||||
}
|
}
|
||||||
return map;
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user