Moved pref saving to specific locations
|
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 313 B |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
@@ -327,6 +327,7 @@ public class Vars implements Loadable{
|
|||||||
|
|
||||||
settings.defaults("locale", "default", "blocksync", true);
|
settings.defaults("locale", "default", "blocksync", true);
|
||||||
keybinds.setDefaults(Binding.values());
|
keybinds.setDefaults(Binding.values());
|
||||||
|
settings.setAutosave(false);
|
||||||
settings.load();
|
settings.load();
|
||||||
|
|
||||||
Scl.setProduct(settings.getInt("uiscale", 100) / 100f);
|
Scl.setProduct(settings.getInt("uiscale", 100) / 100f);
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
Effects.shake(5f, 5f, core);
|
Effects.shake(5f, 5f, core);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ public class Logic implements ApplicationListener{
|
|||||||
//SectorDamage.apply(seconds);
|
//SectorDamage.apply(seconds);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
//add resources based on turns passed
|
//add resources based on turns passed
|
||||||
if(state.rules.sector.save != null && core != null){
|
if(state.rules.sector.save != null && core != null){
|
||||||
|
|
||||||
@@ -126,6 +125,9 @@ public class Logic implements ApplicationListener{
|
|||||||
|
|
||||||
//enable infinite ammo for wave team by default
|
//enable infinite ammo for wave team by default
|
||||||
state.rules.waveTeam.rules().infiniteAmmo = true;
|
state.rules.waveTeam.rules().infiniteAmmo = true;
|
||||||
|
|
||||||
|
//save settings
|
||||||
|
Core.settings.manualSave();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -161,6 +163,9 @@ public class Logic implements ApplicationListener{
|
|||||||
Groups.all.clear();
|
Groups.all.clear();
|
||||||
Time.clear();
|
Time.clear();
|
||||||
Events.fire(new ResetEvent());
|
Events.fire(new ResetEvent());
|
||||||
|
|
||||||
|
//save settings on reset
|
||||||
|
Core.settings.manualSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runWave(){
|
public void runWave(){
|
||||||
@@ -295,6 +300,12 @@ public class Logic implements ApplicationListener{
|
|||||||
netClient.setQuiet();
|
netClient.setQuiet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose(){
|
||||||
|
//save the settings before quitting
|
||||||
|
Core.settings.manualSave();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
Events.fire(Trigger.update);
|
Events.fire(Trigger.update);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import java.io.*;
|
|||||||
import java.text.*;
|
import java.text.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static arc.Core.*;
|
||||||
import static mindustry.Vars.net;
|
import static mindustry.Vars.net;
|
||||||
|
|
||||||
public class CrashSender{
|
public class CrashSender{
|
||||||
@@ -39,6 +40,11 @@ public class CrashSender{
|
|||||||
try{
|
try{
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
|
|
||||||
|
//try saving game data
|
||||||
|
try{
|
||||||
|
settings.manualSave();
|
||||||
|
}catch(Throwable ignored){}
|
||||||
|
|
||||||
//don't create crash logs for custom builds, as it's expected
|
//don't create crash logs for custom builds, as it's expected
|
||||||
if(Version.build == -1 || (System.getProperty("user.name").equals("anuke") && "release".equals(Version.modifier))){
|
if(Version.build == -1 || (System.getProperty("user.name").equals("anuke") && "release".equals(Version.modifier))){
|
||||||
ret();
|
ret();
|
||||||
|
|||||||
@@ -293,11 +293,11 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
stable.table(t -> {
|
stable.table(t -> {
|
||||||
t.left();
|
t.left();
|
||||||
|
|
||||||
sector.save.meta.secinfo.exportRates().each(entry -> {
|
sector.save.meta.secinfo.production.each((item, stat) -> {
|
||||||
int total = (int)(entry.value * eventRate / 60f);
|
int total = (int)(stat.mean * 60);
|
||||||
if(total > 1){
|
if(total > 1){
|
||||||
t.image(entry.key.icon(Cicon.small)).padRight(3);
|
t.image(item.icon(Cicon.small)).padRight(3);
|
||||||
t.add(ui.formatAmount(total) + " /turn").color(Color.lightGray);
|
t.add(ui.formatAmount(total) + " /min").color(Color.lightGray);
|
||||||
t.row();
|
t.row();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ public class SurgeWall extends Wall{
|
|||||||
public class SurgeEntity extends Building{
|
public class SurgeEntity extends Building{
|
||||||
@Override
|
@Override
|
||||||
public boolean collision(Bullet bullet){
|
public boolean collision(Bullet bullet){
|
||||||
super.collision(bullet);
|
|
||||||
if(Mathf.chance(lightningChance)){
|
if(Mathf.chance(lightningChance)){
|
||||||
Lightning.create(team(), Pal.surge, lightningDamage, x, y, bullet.rotation() + 180f, lightningLength);
|
Lightning.create(team(), Pal.surge, lightningDamage, x, y, bullet.rotation() + 180f, lightningLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return super.collision(bullet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=0582cfd3b405d534c948383578c7a3f0c0d9dd6b
|
archash=95c135917655b61d636292ba9dfd05766019c1d8
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import mindustry.net.*;
|
|||||||
|
|
||||||
import java.time.*;
|
import java.time.*;
|
||||||
|
|
||||||
import static arc.util.Log.format;
|
import static arc.util.Log.*;
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
import static mindustry.server.ServerControl.*;
|
import static mindustry.server.ServerControl.*;
|
||||||
|
|
||||||
@@ -86,4 +86,5 @@ public class ServerLauncher implements ApplicationListener{
|
|||||||
|
|
||||||
Events.fire(new ServerLoadEvent());
|
Events.fire(new ServerLoadEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ task pack(dependsOn: classes){
|
|||||||
|
|
||||||
//antialias everything except UI elements
|
//antialias everything except UI elements
|
||||||
fileTree(dir: '../core/assets-raw/sprites_out/', include: "**/*.png").visit{ file ->
|
fileTree(dir: '../core/assets-raw/sprites_out/', include: "**/*.png").visit{ file ->
|
||||||
if(file.isDirectory() || (file.toString().replace("\\", "/").contains("/ui/") && file.toString().startsWith("icon-"))) return
|
if(file.isDirectory() || (file.toString().replace("\\", "/").contains("/ui/") && file.toString().startsWith("icon-")) || file.toString().contains(".9.png")) return
|
||||||
|
|
||||||
executor.submit{
|
executor.submit{
|
||||||
antialias(file.file)
|
antialias(file.file)
|
||||||
|
|||||||
@@ -23,10 +23,33 @@ import mindustry.world.blocks.legacy.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class Generators{
|
public class Generators{
|
||||||
|
//used for changing colors in the UI - testing only
|
||||||
|
static final IntIntMap paletteMap = IntIntMap.with(
|
||||||
|
//empty for now
|
||||||
|
0x454545ff, 0x00000000,//0x32394bff,
|
||||||
|
0x00000099, 0x00000000//0x000000ff
|
||||||
|
);
|
||||||
|
|
||||||
public static void generate(){
|
public static void generate(){
|
||||||
ObjectMap<Block, Image> gens = new ObjectMap<>();
|
ObjectMap<Block, Image> gens = new ObjectMap<>();
|
||||||
|
|
||||||
|
if(!paletteMap.isEmpty()){
|
||||||
|
ImagePacker.generate("uipalette", () -> {
|
||||||
|
Fi.get("../ui").walk(fi -> {
|
||||||
|
if(!fi.extEquals("png")) return;
|
||||||
|
|
||||||
|
Pixmap pix = new Pixmap(fi);
|
||||||
|
pix.setBlending(Pixmap.Blending.sourceOver);
|
||||||
|
pix.each((x, y) -> {
|
||||||
|
int value = pix.getPixel(x, y);
|
||||||
|
pix.draw(x, y, paletteMap.get(value, value));
|
||||||
|
});
|
||||||
|
|
||||||
|
fi.writePNG(pix);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ImagePacker.generate("splashes", () -> {
|
ImagePacker.generate("splashes", () -> {
|
||||||
ArcNativesLoader.load();
|
ArcNativesLoader.load();
|
||||||
|
|
||||||
|
|||||||