mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 04:09:07 +07:00
parent
cccce6badd
commit
c5a90759e5
@ -114,7 +114,7 @@ public class Renderer implements ApplicationListener{
|
||||
public void update(){
|
||||
Color.white.set(1f, 1f, 1f, 1f);
|
||||
|
||||
float dest = Mathf.round(targetscale, 0.5f);
|
||||
float dest = Mathf.clamp(Mathf.round(targetscale, 0.5f), minScale(), maxScale());
|
||||
camerascale = Mathf.lerpDelta(camerascale, dest, 0.1f);
|
||||
if(Mathf.equal(camerascale, dest, 0.001f)) camerascale = dest;
|
||||
laserOpacity = settings.getInt("lasersopacity") / 100f;
|
||||
|
@ -292,15 +292,20 @@ public class Schematics implements Loadable{
|
||||
private void checkLoadout(Schematic s, boolean validate){
|
||||
Stile core = s.tiles.find(t -> t.block instanceof CoreBlock);
|
||||
int cores = s.tiles.count(t -> t.block instanceof CoreBlock);
|
||||
int maxSize = getMaxLaunchSize(core.block);
|
||||
|
||||
//make sure a core exists, and that the schematic is small enough.
|
||||
if(core == null || (validate && (s.width > core.block.size + maxLoadoutSchematicPad *2 || s.height > core.block.size + maxLoadoutSchematicPad *2
|
||||
if(core == null || (validate && (s.width > maxSize || s.height > maxSize
|
||||
|| s.tiles.contains(t -> t.block.buildVisibility == BuildVisibility.sandboxOnly || !t.block.unlocked()) || cores > 1))) return;
|
||||
|
||||
//place in the cache
|
||||
loadouts.get((CoreBlock)core.block, Seq::new).add(s);
|
||||
}
|
||||
|
||||
public int getMaxLaunchSize(Block block){
|
||||
return block.size + maxLoadoutSchematicPad*2;
|
||||
}
|
||||
|
||||
/** Adds a schematic to the list, also copying it into the files.*/
|
||||
public void add(Schematic schematic){
|
||||
all.add(schematic);
|
||||
|
@ -230,8 +230,12 @@ public class SettingsMenuDialog extends Dialog{
|
||||
platform.shareFile(logs);
|
||||
}else{
|
||||
platform.showFileChooser(false, "txt", file -> {
|
||||
file.writeString(getLogs());
|
||||
app.post(() -> ui.showInfo("@crash.exported"));
|
||||
try{
|
||||
file.writeBytes(getLogs().getBytes(Strings.utf8));
|
||||
app.post(() -> ui.showInfo("@crash.exported"));
|
||||
}catch(Throwable e){
|
||||
ui.showException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user