mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-23 13:01:38 -08:00
Added rule for editing world processors in-game
This commit is contained in:
parent
27603165ab
commit
acbd8bb190
9 changed files with 14 additions and 8 deletions
|
|
@ -1340,6 +1340,8 @@ rules.wavetimer = Wave Timer
|
|||
rules.wavesending = Wave Sending
|
||||
rules.allowedit = Allow Editing Rules
|
||||
rules.allowedit.info = When enabled, the player can edit rules in-game via the button in the bottom left corner of the Pause menu.
|
||||
rules.alloweditworldprocessors = Allow Editing World Processors
|
||||
rules.alloweditworldprocessors.info = When enabled, world logic blocks can be placed and edited even outside the editor.
|
||||
rules.waves = Waves
|
||||
rules.airUseSpawns = Air units use spawn points
|
||||
rules.attack = Attack Mode
|
||||
|
|
|
|||
|
|
@ -5916,7 +5916,7 @@ public class Blocks{
|
|||
}};
|
||||
|
||||
worldProcessor = new LogicBlock("world-processor"){{
|
||||
requirements(Category.logic, BuildVisibility.editorOnly, with());
|
||||
requirements(Category.logic, BuildVisibility.worldProcessorOnly, with());
|
||||
|
||||
canOverdrive = false;
|
||||
targetable = false;
|
||||
|
|
@ -5929,7 +5929,7 @@ public class Blocks{
|
|||
}};
|
||||
|
||||
worldCell = new MemoryBlock("world-cell"){{
|
||||
requirements(Category.logic, BuildVisibility.editorOnly, with());
|
||||
requirements(Category.logic, BuildVisibility.worldProcessorOnly, with());
|
||||
|
||||
targetable = false;
|
||||
privileged = true;
|
||||
|
|
@ -5938,14 +5938,14 @@ public class Blocks{
|
|||
}};
|
||||
|
||||
worldMessage = new MessageBlock("world-message"){{
|
||||
requirements(Category.logic, BuildVisibility.editorOnly, with());
|
||||
requirements(Category.logic, BuildVisibility.worldProcessorOnly, with());
|
||||
|
||||
targetable = false;
|
||||
privileged = true;
|
||||
}};
|
||||
|
||||
worldSwitch = new SwitchBlock("world-switch"){{
|
||||
requirements(Category.logic, BuildVisibility.editorOnly, with());
|
||||
requirements(Category.logic, BuildVisibility.worldProcessorOnly, with());
|
||||
|
||||
targetable = false;
|
||||
privileged = true;
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ public class Rules{
|
|||
public boolean ghostBlocks = true;
|
||||
/** Whether to allow units to build with logic. */
|
||||
public boolean logicUnitBuild = true;
|
||||
/** If true, world processors can be edited and placed on this map. */
|
||||
public boolean allowEditWorldProcessors = false;
|
||||
/** If true, world processors no longer update. Used for testing. */
|
||||
public boolean disableWorldProcessors = false;
|
||||
/** How much health blocks start with. */
|
||||
|
|
|
|||
|
|
@ -230,6 +230,7 @@ public class CustomRulesDialog extends BaseDialog{
|
|||
number("@rules.dropzoneradius", false, f -> rules.dropZoneRadius = f * tilesize, () -> rules.dropZoneRadius / tilesize, () -> rules.waves);
|
||||
|
||||
category("resourcesbuilding");
|
||||
check("@rules.alloweditworldprocessors", b -> rules.allowEditWorldProcessors = b, () -> rules.allowEditWorldProcessors);
|
||||
check("@rules.infiniteresources", b -> rules.infiniteResources = b, () -> rules.infiniteResources);
|
||||
check("@rules.onlydepositcore", b -> rules.onlyDepositCore = b, () -> rules.onlyDepositCore);
|
||||
check("@rules.derelictrepair", b -> rules.derelictRepair = b, () -> rules.derelictRepair);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class LogicBlock extends Block{
|
|||
}
|
||||
|
||||
public boolean accessible(){
|
||||
return !privileged || state.rules.editor || state.playtestingMap != null;
|
||||
return !privileged || state.rules.editor || state.playtestingMap != null || state.rules.allowEditWorldProcessors;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class MemoryBlock extends Block{
|
|||
}
|
||||
|
||||
public boolean accessible(){
|
||||
return !privileged || state.rules.editor;
|
||||
return !privileged || state.rules.editor || state.rules.allowEditWorldProcessors;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class MessageBlock extends Block{
|
|||
}
|
||||
|
||||
public boolean accessible(){
|
||||
return !privileged || state.rules.editor;
|
||||
return !privileged || state.rules.editor || state.rules.allowEditWorldProcessors;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class SwitchBlock extends Block{
|
|||
}
|
||||
|
||||
public boolean accessible(){
|
||||
return !privileged || state.rules.editor;
|
||||
return !privileged || state.rules.editor || state.rules.allowEditWorldProcessors;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ public class BuildVisibility{
|
|||
shown = new BuildVisibility(() -> true),
|
||||
debugOnly = new BuildVisibility(() -> false),
|
||||
editorOnly = new BuildVisibility(() -> Vars.state.rules.editor),
|
||||
worldProcessorOnly = new BuildVisibility(() -> Vars.state.rules.editor || Vars.state.rules.allowEditWorldProcessors),
|
||||
sandboxOnly = new BuildVisibility(() -> Vars.state == null || Vars.state.rules.infiniteResources),
|
||||
campaignOnly = new BuildVisibility(() -> Vars.state == null || Vars.state.isCampaign()),
|
||||
lightingOnly = new BuildVisibility(() -> Vars.state == null || Vars.state.rules.lighting || Vars.state.isCampaign()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue