Launch sector description

This commit is contained in:
Anuken
2022-04-20 14:15:23 -04:00
parent 6441d0b2d5
commit f1c6b6f949
5 changed files with 13 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ import static mindustry.ai.Pathfinder.*;
public class ControlPathfinder{ public class ControlPathfinder{
//TODO this FPS-based update system could be flawed. //TODO this FPS-based update system could be flawed.
private static final long maxUpdate = Time.millisToNanos(20); private static final long maxUpdate = Time.millisToNanos(30);
private static final int updateFPS = 60; private static final int updateFPS = 60;
private static final int updateInterval = 1000 / updateFPS; private static final int updateInterval = 1000 / updateFPS;
private static final int wallImpassableCap = 100_000; private static final int wallImpassableCap = 100_000;
@@ -272,6 +272,7 @@ public class ControlPathfinder{
threads = new PathfindThread[Mathf.clamp(Runtime.getRuntime().availableProcessors() - 2, 1, 6)]; threads = new PathfindThread[Mathf.clamp(Runtime.getRuntime().availableProcessors() - 2, 1, 6)];
for(int i = 0; i < threads.length; i ++){ for(int i = 0; i < threads.length; i ++){
threads[i] = new PathfindThread("ControlPathfindThread-" + i); threads[i] = new PathfindThread("ControlPathfindThread-" + i);
threads[i].setPriority(Thread.MIN_PRIORITY);
threads[i].setDaemon(true); threads[i].setDaemon(true);
threads[i].start(); threads[i].start();
} }

View File

@@ -19,7 +19,7 @@ import mindustry.world.meta.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
public class Pathfinder implements Runnable{ public class Pathfinder implements Runnable{
private static final long maxUpdate = Time.millisToNanos(5); private static final long maxUpdate = Time.millisToNanos(7);
private static final int updateFPS = 60; private static final int updateFPS = 60;
private static final int updateInterval = 1000 / updateFPS; private static final int updateInterval = 1000 / updateFPS;
@@ -197,7 +197,10 @@ public class Pathfinder implements Runnable{
stop(); stop();
if(net.client()) return; if(net.client()) return;
thread = Threads.daemon("Pathfinder", this); thread = new Thread(this, "Pathfinder");
thread.setPriority(Thread.MIN_PRIORITY);
thread.setDaemon(true);
thread.start();
} }
/** Stops the pathfinding thread. */ /** Stops the pathfinding thread. */

View File

@@ -194,12 +194,14 @@ public final class FogControl implements CustomChunk{
//not run clientside, the CPU side isn't needed here. //not run clientside, the CPU side isn't needed here.
if(staticFogThread == null && !net.client()){ if(staticFogThread == null && !net.client()){
staticFogThread = new StaticFogThread(); staticFogThread = new StaticFogThread();
staticFogThread.setPriority(Thread.NORM_PRIORITY - 1);
staticFogThread.setDaemon(true); staticFogThread.setDaemon(true);
staticFogThread.start(); staticFogThread.start();
} }
if(dynamicFogThread == null){ if(dynamicFogThread == null){
dynamicFogThread = new DynamicFogThread(); dynamicFogThread = new DynamicFogThread();
dynamicFogThread.setPriority(Thread.NORM_PRIORITY - 1);
dynamicFogThread.setDaemon(true); dynamicFogThread.setDaemon(true);
dynamicFogThread.start(); dynamicFogThread.start();
} }

View File

@@ -91,7 +91,6 @@ public class MultiPacker implements Disposable{
} }
} }
//There are several pages for sprites. //There are several pages for sprites.
//main page (sprites.png) - all sprites for units, weapons, placeable blocks, effects, bullets, etc //main page (sprites.png) - all sprites for units, weapons, placeable blocks, effects, bullets, etc
//environment page (sprites2.png) - all sprites for things in the environmental cache layer //environment page (sprites2.png) - all sprites for things in the environmental cache layer

View File

@@ -196,6 +196,10 @@ public class LaunchLoadoutDialog extends BaseDialog{
cont.label(() -> Core.bundle.format("launch.capacity", lastCapacity)).row(); cont.label(() -> Core.bundle.format("launch.capacity", lastCapacity)).row();
cont.row(); cont.row();
}else if(destination.preset != null && destination.preset.description != null){
cont.pane(p -> {
p.add(destination.preset.description).grow().wrap().labelAlign(Align.center);
}).pad(10f).grow().row();
} }
cont.pane(items); cont.pane(items);