info popup
This commit is contained in:
@@ -53,8 +53,7 @@ schematic.saved = Schematic saved.
|
|||||||
schematic.delete.confirm = This schematic will be utterly eradicated.
|
schematic.delete.confirm = This schematic will be utterly eradicated.
|
||||||
schematic.rename = Rename Schematic
|
schematic.rename = Rename Schematic
|
||||||
schematic.info = {0}x{1}, {2} blocks
|
schematic.info = {0}x{1}, {2} blocks
|
||||||
schematic.disabled = [scarlet]Schematics are not allowed!
|
schematic.disabled = [scarlet]Schematics disabled[]\nYou are not allowed to use schematics on this [accent]map[] or [accent]server.
|
||||||
schematic.copydisabled = [scarlet]Copying isn't allowed!
|
|
||||||
|
|
||||||
stat.wave = Waves Defeated:[accent] {0}
|
stat.wave = Waves Defeated:[accent] {0}
|
||||||
stat.enemiesDestroyed = Enemies Destroyed:[accent] {0}
|
stat.enemiesDestroyed = Enemies Destroyed:[accent] {0}
|
||||||
@@ -799,6 +798,7 @@ mode.custom = Custom Rules
|
|||||||
|
|
||||||
rules.infiniteresources = Infinite Resources
|
rules.infiniteresources = Infinite Resources
|
||||||
rules.reactorexplosions = Reactor Explosions
|
rules.reactorexplosions = Reactor Explosions
|
||||||
|
rules.schematic = Schematics allowed
|
||||||
rules.wavetimer = Wave Timer
|
rules.wavetimer = Wave Timer
|
||||||
rules.waves = Waves
|
rules.waves = Waves
|
||||||
rules.attack = Attack Mode
|
rules.attack = Attack Mode
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ public class Rules{
|
|||||||
public boolean reactorExplosions = true;
|
public boolean reactorExplosions = true;
|
||||||
/** Whether schematics are allowed */
|
/** Whether schematics are allowed */
|
||||||
public boolean schematicAllowed = true;
|
public boolean schematicAllowed = true;
|
||||||
/** Whether copying is allowed */
|
|
||||||
public boolean copyAllowed = true;
|
|
||||||
/** Whether units use and require ammo. */
|
/** Whether units use and require ammo. */
|
||||||
public boolean unitAmmo = false;
|
public boolean unitAmmo = false;
|
||||||
/** How fast unit pads build units. */
|
/** How fast unit pads build units. */
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
|
|
||||||
table.button(Icon.paste, Styles.clearPartiali, () -> {
|
table.button(Icon.paste, Styles.clearPartiali, () -> {
|
||||||
ui.schematics.show();
|
ui.schematics.show();
|
||||||
}).tooltip("Schematics").disabled(d -> !state.rules.schematicAllowed);
|
}).tooltip("Schematics");
|
||||||
|
|
||||||
table.button(Icon.tree, Styles.clearPartiali, () -> {
|
table.button(Icon.tree, Styles.clearPartiali, () -> {
|
||||||
ui.research.show();
|
ui.research.show();
|
||||||
@@ -387,8 +387,6 @@ public class DesktopInput extends InputHandler{
|
|||||||
if(Core.input.keyTap(Binding.schematic_menu) && !Core.scene.hasKeyboard()){
|
if(Core.input.keyTap(Binding.schematic_menu) && !Core.scene.hasKeyboard()){
|
||||||
if(ui.schematics.isShown()){
|
if(ui.schematics.isShown()){
|
||||||
ui.schematics.hide();
|
ui.schematics.hide();
|
||||||
}else if(!state.rules.schematicAllowed) {
|
|
||||||
ui.showInfoToast("@schematic.disabled", 3f);
|
|
||||||
}else{
|
}else{
|
||||||
ui.schematics.show();
|
ui.schematics.show();
|
||||||
ui.schematics.focusSearchField();
|
ui.schematics.focusSearchField();
|
||||||
@@ -401,14 +399,10 @@ public class DesktopInput extends InputHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyRelease(Binding.schematic_select) && !Core.scene.hasKeyboard()){
|
if(Core.input.keyRelease(Binding.schematic_select) && !Core.scene.hasKeyboard()){
|
||||||
if(!state.rules.copyAllowed){
|
lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY);
|
||||||
ui.showInfoToast("@schematic.copydisabled", 3f);
|
useSchematic(lastSchematic);
|
||||||
}else {
|
if (selectRequests.isEmpty()) {
|
||||||
lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY);
|
lastSchematic = null;
|
||||||
useSchematic(lastSchematic);
|
|
||||||
if (selectRequests.isEmpty()) {
|
|
||||||
lastSchematic = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -485,15 +485,11 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
|
|
||||||
lineMode = false;
|
lineMode = false;
|
||||||
}else if(mode == schematicSelect){
|
}else if(mode == schematicSelect){
|
||||||
if(!state.rules.copyAllowed){
|
selectRequests.clear();
|
||||||
ui.showInfoToast("@schematic.copydisabled", 3f);
|
lastSchematic = schematics.create(lineStartX, lineStartY, lastLineX, lastLineY);
|
||||||
}else {
|
useSchematic(lastSchematic);
|
||||||
selectRequests.clear();
|
if (selectRequests.isEmpty()) {
|
||||||
lastSchematic = schematics.create(lineStartX, lineStartY, lastLineX, lastLineY);
|
lastSchematic = null;
|
||||||
useSchematic(lastSchematic);
|
|
||||||
if (selectRequests.isEmpty()) {
|
|
||||||
lastSchematic = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
schematicMode = false;
|
schematicMode = false;
|
||||||
mode = none;
|
mode = none;
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ public class CustomRulesDialog extends BaseDialog{
|
|||||||
title("@rules.title.resourcesbuilding");
|
title("@rules.title.resourcesbuilding");
|
||||||
check("@rules.infiniteresources", b -> rules.infiniteResources = b, () -> rules.infiniteResources);
|
check("@rules.infiniteresources", b -> rules.infiniteResources = b, () -> rules.infiniteResources);
|
||||||
check("@rules.reactorexplosions", b -> rules.reactorExplosions = b, () -> rules.reactorExplosions);
|
check("@rules.reactorexplosions", b -> rules.reactorExplosions = b, () -> rules.reactorExplosions);
|
||||||
|
check("@rules.schematic", b-> rules.schematicAllowed = b, () -> rules.schematicAllowed);
|
||||||
number("@rules.buildcostmultiplier", false, f -> rules.buildCostMultiplier = f, () -> rules.buildCostMultiplier, () -> !rules.infiniteResources);
|
number("@rules.buildcostmultiplier", false, f -> rules.buildCostMultiplier = f, () -> rules.buildCostMultiplier, () -> !rules.infiniteResources);
|
||||||
number("@rules.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier);
|
number("@rules.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier);
|
||||||
number("@rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources);
|
number("@rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import arc.scene.ui.TextButton.*;
|
|||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.Vars;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
@@ -64,8 +65,12 @@ public class SchematicsDialog extends BaseDialog{
|
|||||||
|
|
||||||
t.update(() -> {
|
t.update(() -> {
|
||||||
if(Core.input.keyTap(Binding.chat) && Core.scene.getKeyboardFocus() == searchField && firstSchematic != null){
|
if(Core.input.keyTap(Binding.chat) && Core.scene.getKeyboardFocus() == searchField && firstSchematic != null){
|
||||||
control.input.useSchematic(firstSchematic);
|
if(!Vars.state.rules.schematicAllowed){
|
||||||
hide();
|
ui.showInfo("@schematic.disabled");
|
||||||
|
}else {
|
||||||
|
control.input.useSchematic(firstSchematic);
|
||||||
|
hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -146,8 +151,12 @@ public class SchematicsDialog extends BaseDialog{
|
|||||||
if(state.isMenu()){
|
if(state.isMenu()){
|
||||||
showInfo(s);
|
showInfo(s);
|
||||||
}else{
|
}else{
|
||||||
control.input.useSchematic(s);
|
if(!Vars.state.rules.schematicAllowed){
|
||||||
hide();
|
ui.showInfo("@schematic.disabled");
|
||||||
|
}else{
|
||||||
|
control.input.useSchematic(s);
|
||||||
|
hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).pad(4).style(Styles.cleari).get();
|
}).pad(4).style(Styles.cleari).get();
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class HudFragment extends Fragment{
|
|||||||
select.button(Icon.menu, style, ui.paused::show);
|
select.button(Icon.menu, style, ui.paused::show);
|
||||||
flip = select.button(Icon.upOpen, style, this::toggleMenus).get();
|
flip = select.button(Icon.upOpen, style, this::toggleMenus).get();
|
||||||
|
|
||||||
select.button(Icon.paste, style, ui.schematics::show).disabled(d -> !state.rules.schematicAllowed);
|
select.button(Icon.paste, style, ui.schematics::show);
|
||||||
|
|
||||||
select.button(Icon.pause, style, () -> {
|
select.button(Icon.pause, style, () -> {
|
||||||
if(net.active()){
|
if(net.active()){
|
||||||
|
|||||||
Reference in New Issue
Block a user