mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 19:39:04 +07:00
Bugfixes
This commit is contained in:
parent
f1f8130718
commit
3e43f5577e
@ -616,6 +616,7 @@ setting.difficulty.insane = Insane
|
|||||||
setting.difficulty.name = Difficulty:
|
setting.difficulty.name = Difficulty:
|
||||||
setting.screenshake.name = Screen Shake
|
setting.screenshake.name = Screen Shake
|
||||||
setting.effects.name = Display Effects
|
setting.effects.name = Display Effects
|
||||||
|
setting.destroyedblocks.name = Display Destroyed Blocks
|
||||||
setting.sensitivity.name = Controller Sensitivity
|
setting.sensitivity.name = Controller Sensitivity
|
||||||
setting.saveinterval.name = Save Interval
|
setting.saveinterval.name = Save Interval
|
||||||
setting.seconds = {0} Seconds
|
setting.seconds = {0} Seconds
|
||||||
|
@ -18,6 +18,8 @@ import io.anuke.mindustry.world.blocks.*;
|
|||||||
import io.anuke.mindustry.world.blocks.BuildBlock.*;
|
import io.anuke.mindustry.world.blocks.BuildBlock.*;
|
||||||
import io.anuke.mindustry.world.blocks.power.*;
|
import io.anuke.mindustry.world.blocks.power.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,14 +81,12 @@ public class Logic implements ApplicationListener{
|
|||||||
Events.on(BlockBuildEndEvent.class, event -> {
|
Events.on(BlockBuildEndEvent.class, event -> {
|
||||||
if(!event.breaking){
|
if(!event.breaking){
|
||||||
TeamData data = state.teams.get(event.team);
|
TeamData data = state.teams.get(event.team);
|
||||||
|
Iterator<BrokenBlock> it = data.brokenBlocks.iterator();
|
||||||
//painful O(n) iteration + copy
|
while(it.hasNext()){
|
||||||
for(int i = 0; i < data.brokenBlocks.size; i++){
|
BrokenBlock b = it.next();
|
||||||
BrokenBlock b = data.brokenBlocks.get(i);
|
|
||||||
Block block = content.block(b.block);
|
Block block = content.block(b.block);
|
||||||
if(event.tile.block().bounds(event.tile.x, event.tile.y, Tmp.r1).overlaps(block.bounds(b.x, b.y, Tmp.r2))){
|
if(event.tile.block().bounds(event.tile.x, event.tile.y, Tmp.r1).overlaps(block.bounds(b.x, b.y, Tmp.r2))){
|
||||||
data.brokenBlocks.removeIndex(i);
|
it.remove();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ public class Renderer implements ApplicationListener{
|
|||||||
blocks.drawBlocks(Layer.block);
|
blocks.drawBlocks(Layer.block);
|
||||||
blocks.drawFog();
|
blocks.drawFog();
|
||||||
|
|
||||||
blocks.drawBroken();
|
blocks.drawDestroyed();
|
||||||
|
|
||||||
Draw.shader(Shaders.blockbuild, true);
|
Draw.shader(Shaders.blockbuild, true);
|
||||||
blocks.drawBlocks(Layer.placement);
|
blocks.drawBlocks(Layer.placement);
|
||||||
|
@ -124,7 +124,9 @@ public class BlockRenderer implements Disposable{
|
|||||||
Draw.shader();
|
Draw.shader();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawBroken(){
|
public void drawDestroyed(){
|
||||||
|
if(!Core.settings.getBool("destroyedblocks")) return;
|
||||||
|
|
||||||
if(control.input.isPlacing() || control.input.isBreaking()){
|
if(control.input.isPlacing() || control.input.isBreaking()){
|
||||||
brokenFade = Mathf.lerpDelta(brokenFade, 1f, 0.1f);
|
brokenFade = Mathf.lerpDelta(brokenFade, 1f, 0.1f);
|
||||||
}else{
|
}else{
|
||||||
|
@ -294,6 +294,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
graphics.checkPref("effects", true);
|
graphics.checkPref("effects", true);
|
||||||
|
graphics.checkPref("destroyedblocks", true);
|
||||||
graphics.checkPref("playerchat", true);
|
graphics.checkPref("playerchat", true);
|
||||||
graphics.checkPref("minimap", !mobile);
|
graphics.checkPref("minimap", !mobile);
|
||||||
graphics.checkPref("position", false);
|
graphics.checkPref("position", false);
|
||||||
|
Loading…
Reference in New Issue
Block a user