mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-04 15:27:19 +07:00
Added instantBuild rule for editor
This commit is contained in:
@ -100,9 +100,9 @@ abstract class BuilderComp implements Posc, Statusc, Teamc, Rotc{
|
|||||||
buildCounter = Math.min(buildCounter, 10f);
|
buildCounter = Math.min(buildCounter, 10f);
|
||||||
|
|
||||||
//random attempt to fix a freeze that only occurs on Android
|
//random attempt to fix a freeze that only occurs on Android
|
||||||
int maxPerFrame = 10, count = 0;
|
int maxPerFrame = state.rules.instantBuild ? plans.size : 10, count = 0;
|
||||||
|
|
||||||
while(buildCounter >= 1 && count++ < maxPerFrame){
|
while((buildCounter >= 1 || state.rules.instantBuild) && count++ < maxPerFrame){
|
||||||
buildCounter -= 1f;
|
buildCounter -= 1f;
|
||||||
|
|
||||||
validatePlans();
|
validatePlans();
|
||||||
|
@ -35,6 +35,7 @@ public enum Gamemode{
|
|||||||
}, map -> map.teams.size > 1),
|
}, map -> map.teams.size > 1),
|
||||||
editor(true, rules -> {
|
editor(true, rules -> {
|
||||||
rules.infiniteResources = true;
|
rules.infiniteResources = true;
|
||||||
|
rules.instantBuild = true;
|
||||||
rules.editor = true;
|
rules.editor = true;
|
||||||
rules.waves = false;
|
rules.waves = false;
|
||||||
rules.waveTimer = false;
|
rules.waveTimer = false;
|
||||||
|
@ -107,6 +107,8 @@ public class Rules{
|
|||||||
public boolean hideBannedBlocks = false;
|
public boolean hideBannedBlocks = false;
|
||||||
/** If true, most blocks (including environmental walls) can be deconstructed. This is only meant to be used internally in sandbox/test maps. */
|
/** If true, most blocks (including environmental walls) can be deconstructed. This is only meant to be used internally in sandbox/test maps. */
|
||||||
public boolean allowEnvironmentDeconstruct = false;
|
public boolean allowEnvironmentDeconstruct = false;
|
||||||
|
/** If true, buildings will be constructed instantly, with no limit on blocks placed per second. This is highly experimental and may cause lag! */
|
||||||
|
public boolean instantBuild = false;
|
||||||
/** If true, bannedBlocks becomes a whitelist. */
|
/** If true, bannedBlocks becomes a whitelist. */
|
||||||
public boolean blockWhitelist = false;
|
public boolean blockWhitelist = false;
|
||||||
/** If true, bannedUnits becomes a whitelist. */
|
/** If true, bannedUnits becomes a whitelist. */
|
||||||
|
@ -92,6 +92,7 @@ public class Floor extends Block{
|
|||||||
placeableLiquid = true;
|
placeableLiquid = true;
|
||||||
allowRectanglePlacement = true;
|
allowRectanglePlacement = true;
|
||||||
instantBuild = true;
|
instantBuild = true;
|
||||||
|
placeEffect = Fx.rotateBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user