More precision in block stats
This commit is contained in:
@@ -816,9 +816,6 @@ public class Mods implements Loadable{
|
|||||||
public void loadScripts(){
|
public void loadScripts(){
|
||||||
if(skipModCode) return;
|
if(skipModCode) return;
|
||||||
|
|
||||||
Time.mark();
|
|
||||||
boolean[] any = {false};
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
eachEnabled(mod -> {
|
eachEnabled(mod -> {
|
||||||
if(mod.root.child("scripts").exists()){
|
if(mod.root.child("scripts").exists()){
|
||||||
@@ -831,7 +828,6 @@ public class Mods implements Loadable{
|
|||||||
if(scripts == null){
|
if(scripts == null){
|
||||||
scripts = platform.createScripts();
|
scripts = platform.createScripts();
|
||||||
}
|
}
|
||||||
any[0] = true;
|
|
||||||
scripts.run(mod, main);
|
scripts.run(mod, main);
|
||||||
}catch(Throwable e){
|
}catch(Throwable e){
|
||||||
Core.app.post(() -> {
|
Core.app.post(() -> {
|
||||||
@@ -847,10 +843,6 @@ public class Mods implements Loadable{
|
|||||||
}finally{
|
}finally{
|
||||||
content.setCurrentMod(null);
|
content.setCurrentMod(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(any[0]){
|
|
||||||
Log.info("Time to initialize modded scripts: @", Time.elapsed());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates all the content found in mod files. */
|
/** Creates all the content found in mod files. */
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class CrashHandler{
|
|||||||
return report
|
return report
|
||||||
+ "Version: " + Version.combined() + (Version.buildDate.equals("unknown") ? "" : " (Built " + Version.buildDate + ")") + (Vars.headless ? " (Server)" : "") + "\n"
|
+ "Version: " + Version.combined() + (Version.buildDate.equals("unknown") ? "" : " (Built " + Version.buildDate + ")") + (Vars.headless ? " (Server)" : "") + "\n"
|
||||||
+ "Date: " + new SimpleDateFormat("MMMM d, yyyy HH:mm:ss a", Locale.getDefault()).format(new Date()) + "\n"
|
+ "Date: " + new SimpleDateFormat("MMMM d, yyyy HH:mm:ss a", Locale.getDefault()).format(new Date()) + "\n"
|
||||||
+ "OS: " + OS.osName + " x" + (OS.osArchBits) + " (" + OS.osArch + ")\n"
|
+ "OS: " + OS.osName + (OS.osArchBits != null ? " x" + (OS.osArchBits) : "") + " (" + OS.osArch + ")\n"
|
||||||
+ ((OS.isAndroid || OS.isIos) && app != null ? "Android API level: " + Core.app.getVersion() + "\n" : "")
|
+ ((OS.isAndroid || OS.isIos) && app != null ? "Android API level: " + Core.app.getVersion() + "\n" : "")
|
||||||
+ "Java Version: " + OS.javaVersion + "\n"
|
+ "Java Version: " + OS.javaVersion + "\n"
|
||||||
+ "Runtime Available Memory: " + (Runtime.getRuntime().maxMemory() / 1024 / 1024) + "mb\n"
|
+ "Runtime Available Memory: " + (Runtime.getRuntime().maxMemory() / 1024 / 1024) + "mb\n"
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public class Sector{
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public TextureRegion icon(){
|
public TextureRegion icon(){
|
||||||
return info.contentIcon != null ? info.contentIcon.uiIcon : info.icon == null ? (preset != null && preset.uiIcon.found() && preset.unlocked() ? preset.uiIcon : null) : Fonts.getLargeIcon(info.icon);
|
return info.contentIcon != null ? info.contentIcon.uiIcon : info.icon == null ? (preset != null && preset.requireUnlock && preset.uiIcon.found() && preset.unlocked() ? preset.uiIcon : null) : Fonts.getLargeIcon(info.icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -988,6 +988,7 @@ public class HudFragment{
|
|||||||
table.table().update(t -> {
|
table.table().update(t -> {
|
||||||
if(player.unit() instanceof Payloadc payload){
|
if(player.unit() instanceof Payloadc payload){
|
||||||
if(count[0] != payload.payloadUsed()){
|
if(count[0] != payload.payloadUsed()){
|
||||||
|
t.clear();
|
||||||
payload.contentInfo(t, 8 * 2, 275f);
|
payload.contentInfo(t, 8 * 2, 275f);
|
||||||
count[0] = payload.payloadUsed();
|
count[0] = payload.payloadUsed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -683,10 +683,12 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return all extra tile data, packed into a single long for data transfer convenience. */
|
||||||
public long getPackedData(){
|
public long getPackedData(){
|
||||||
return PackedTileData.get(extraData, data, floorData, overlayData);
|
return PackedTileData.get(extraData, data, floorData, overlayData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Sets the packed data as obtained from {@link #getPackedData()}*/
|
||||||
public void setPackedData(long packed){
|
public void setPackedData(long packed){
|
||||||
extraData = PackedTileData.extraData(packed);
|
extraData = PackedTileData.extraData(packed);
|
||||||
data = PackedTileData.data(packed);
|
data = PackedTileData.data(packed);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class StatValues{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String fixValue(float value){
|
public static String fixValue(float value){
|
||||||
return Strings.autoFixed(value, 2);
|
return Strings.autoFixed(value, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static StatValue squared(float value, StatUnit unit){
|
public static StatValue squared(float value, StatUnit unit){
|
||||||
@@ -189,10 +189,10 @@ public class StatValues{
|
|||||||
|
|
||||||
if(amount != 0){
|
if(amount != 0){
|
||||||
Table t = new Table().left().bottom();
|
Table t = new Table().left().bottom();
|
||||||
t.add(Strings.autoFixed(amount, 2)).style(Styles.outlineLabel);
|
t.add(Strings.autoFixed(amount, 3)).style(Styles.outlineLabel);
|
||||||
add(t);
|
add(t);
|
||||||
}
|
}
|
||||||
}}).size(iconMed).padRight(3 + (amount != 0 ? (Strings.autoFixed(amount, 2).length() - 1) * 10 : 0)).with(s -> withTooltip(s, liquid, false));
|
}}).size(iconMed).padRight(3 + (amount != 0 ? (Strings.autoFixed(amount, 3).length() - 1) * 10 : 0)).with(s -> withTooltip(s, liquid, false));
|
||||||
|
|
||||||
if(perSecond && amount != 0){
|
if(perSecond && amount != 0){
|
||||||
t.add(StatUnit.perSecond.localized()).padLeft(2).padRight(5).color(Color.lightGray).style(Styles.outlineLabel);
|
t.add(StatUnit.perSecond.localized()).padLeft(2).padRight(5).color(Color.lightGray).style(Styles.outlineLabel);
|
||||||
@@ -290,7 +290,7 @@ public class StatValues{
|
|||||||
public static Table displayItem(Item item, int amount, float timePeriod, boolean showName){
|
public static Table displayItem(Item item, int amount, float timePeriod, boolean showName){
|
||||||
Table t = new Table();
|
Table t = new Table();
|
||||||
t.add(stack(item, amount, !showName));
|
t.add(stack(item, amount, !showName));
|
||||||
t.add((showName ? item.localizedName + "\n" : "") + "[lightgray]" + Strings.autoFixed(amount / (timePeriod / 60f), 2) + StatUnit.perSecond.localized()).padLeft(2).padRight(5).style(Styles.outlineLabel);
|
t.add((showName ? item.localizedName + "\n" : "") + "[lightgray]" + Strings.autoFixed(amount / (timePeriod / 60f), 3) + StatUnit.perSecond.localized()).padLeft(2).padRight(5).style(Styles.outlineLabel);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ public class StatValues{
|
|||||||
|
|
||||||
c.table(Styles.grayPanel, b -> {
|
c.table(Styles.grayPanel, b -> {
|
||||||
b.image(item.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit);
|
b.image(item.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit);
|
||||||
b.add(item.localizedName + (timePeriod > 0 ? "\n[lightgray]" + (time < 0.01f ? Strings.fixed(time, 4) : Strings.autoFixed(time, 2)) + StatUnit.perSecond.localized() : "")).left().grow();
|
b.add(item.localizedName + (timePeriod > 0 ? "\n[lightgray]" + Strings.autoFixed(time, time < 0.01f ? 4 : 2) + StatUnit.perSecond.localized() : "")).left().grow();
|
||||||
b.add(Core.bundle.format("stat.efficiency", fixValue(efficiency.get(item) * 100f))).right().pad(10f).padRight(15f);
|
b.add(Core.bundle.format("stat.efficiency", fixValue(efficiency.get(item) * 100f))).right().pad(10f).padRight(15f);
|
||||||
}).growX().pad(5).row();
|
}).growX().pad(5).row();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ org.gradle.caching=true
|
|||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
android.enableR8.fullMode=false
|
android.enableR8.fullMode=false
|
||||||
archash=bceaf78774
|
archash=5677d5c798
|
||||||
|
|||||||
Reference in New Issue
Block a user