From fe18222c6c5a6b60531d60b4ad73724b6851375d Mon Sep 17 00:00:00 2001 From: J-VdS Date: Wed, 19 Aug 2020 16:11:00 +0200 Subject: [PATCH 01/16] block schematics --- annotations/src/main/resources/revisions/Bullet/1.json | 1 + annotations/src/main/resources/revisions/EffectState/1.json | 1 + core/src/mindustry/game/Rules.java | 2 ++ core/src/mindustry/ui/fragments/HudFragment.java | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 annotations/src/main/resources/revisions/Bullet/1.json create mode 100644 annotations/src/main/resources/revisions/EffectState/1.json diff --git a/annotations/src/main/resources/revisions/Bullet/1.json b/annotations/src/main/resources/revisions/Bullet/1.json new file mode 100644 index 0000000000..bdb86498f2 --- /dev/null +++ b/annotations/src/main/resources/revisions/Bullet/1.json @@ -0,0 +1 @@ +{version:1,fields:[{name:collided,type:arc.struct.IntSeq,size:-1},{name:damage,type:float,size:4},{name:data,type:java.lang.Object,size:-1},{name:lifetime,type:float,size:4},{name:owner,type:Entityc,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:type,type:mindustry.entities.bullet.BulletType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/EffectState/1.json b/annotations/src/main/resources/revisions/EffectState/1.json new file mode 100644 index 0000000000..530155f361 --- /dev/null +++ b/annotations/src/main/resources/revisions/EffectState/1.json @@ -0,0 +1 @@ +{version:1,fields:[{name:color,type:arc.graphics.Color,size:-1},{name:data,type:java.lang.Object,size:-1},{name:effect,type:mindustry.entities.Effect,size:-1},{name:lifetime,type:float,size:4},{name:offsetX,type:float,size:4},{name:offsetY,type:float,size:4},{name:parent,type:Posc,size:-1},{name:rotation,type:float,size:4},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 83b0c67e6a..4fc2512923 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -38,6 +38,8 @@ public class Rules{ public boolean canGameOver = true; /** Whether reactors can explode and damage other blocks. */ public boolean reactorExplosions = true; + /** Whether schematics are allowed */ + public boolean schematicAllowed = true; /** Whether units use and require ammo. */ public boolean unitAmmo = false; /** How fast unit pads build units. */ diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index 585577fa0b..b5d21d0db9 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -89,7 +89,7 @@ public class HudFragment extends Fragment{ select.button(Icon.menu, style, ui.paused::show); flip = select.button(Icon.upOpen, style, this::toggleMenus).get(); - select.button(Icon.paste, style, ui.schematics::show); + select.button(Icon.paste, style, ui.schematics::show).disabled(!state.rules.schematicAllowed); select.button(Icon.pause, style, () -> { if(net.active()){ From 4938aac7317381e64e670e774a744b6f7bd738d5 Mon Sep 17 00:00:00 2001 From: J-VdS Date: Wed, 19 Aug 2020 19:10:25 +0200 Subject: [PATCH 02/16] schematic server setting --- core/assets/bundles/bundle.properties | 2 ++ core/src/mindustry/input/DesktopInput.java | 16 +++++++++++----- core/src/mindustry/ui/fragments/HudFragment.java | 2 +- server/src/mindustry/server/ServerControl.java | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index b945616494..77cbf73a84 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -53,6 +53,7 @@ schematic.saved = Schematic saved. schematic.delete.confirm = This schematic will be utterly eradicated. schematic.rename = Rename Schematic schematic.info = {0}x{1}, {2} blocks +schematic.disabled = [scarlet]Schematics are not allowed! stat.wave = Waves Defeated:[accent] {0} stat.enemiesDestroyed = Enemies Destroyed:[accent] {0} @@ -824,6 +825,7 @@ rules.lighting = Lighting rules.ambientlight = Ambient Light rules.solarpowermultiplier = Solar Power Multiplier + content.item.name = Items content.liquid.name = Liquids content.unit.name = Units diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 93f85a1b53..3a497b9c93 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -329,7 +329,7 @@ public class DesktopInput extends InputHandler{ table.button(Icon.paste, Styles.clearPartiali, () -> { ui.schematics.show(); - }).tooltip("Schematics"); + }).tooltip("Schematics").disabled(d -> !state.rules.schematicAllowed); table.button(Icon.tree, Styles.clearPartiali, () -> { ui.research.show(); @@ -387,6 +387,8 @@ public class DesktopInput extends InputHandler{ if(Core.input.keyTap(Binding.schematic_menu) && !Core.scene.hasKeyboard()){ if(ui.schematics.isShown()){ ui.schematics.hide(); + }else if(!state.rules.schematicAllowed) { + ui.showInfoToast("@schematic.disabled", 3f); }else{ ui.schematics.show(); ui.schematics.focusSearchField(); @@ -399,10 +401,14 @@ public class DesktopInput extends InputHandler{ } if(Core.input.keyRelease(Binding.schematic_select) && !Core.scene.hasKeyboard()){ - lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); - useSchematic(lastSchematic); - if(selectRequests.isEmpty()){ - lastSchematic = null; + if(!state.rules.schematicAllowed){ + ui.showInfoToast("@schematic.disabled", 3f); + }else { + lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); + useSchematic(lastSchematic); + if (selectRequests.isEmpty()) { + lastSchematic = null; + } } } diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index ded6d77d1c..b0f06a2ff8 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -90,7 +90,7 @@ public class HudFragment extends Fragment{ select.button(Icon.menu, style, ui.paused::show); flip = select.button(Icon.upOpen, style, this::toggleMenus).get(); - select.button(Icon.paste, style, ui.schematics::show).disabled(!state.rules.schematicAllowed); + select.button(Icon.paste, style, ui.schematics::show).disabled(d -> !state.rules.schematicAllowed); select.button(Icon.pause, style, () -> { if(net.active()){ diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 463ef9ad20..ba231a76a9 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -61,7 +61,7 @@ public class ServerControl implements ApplicationListener{ "bans", "", "admins", "", "shufflemode", "custom", - "globalrules", "{reactorExplosions: false}" + "globalrules", "{reactorExplosions: false, schematicAllowed: true}" ); Log.setLogger((level, text) -> { From 3753e8f54a9cde43375408abc68cbcc0f2fa007d Mon Sep 17 00:00:00 2001 From: J-VdS Date: Wed, 19 Aug 2020 20:29:03 +0200 Subject: [PATCH 03/16] global rule not working --- .../src/main/resources/classids.properties | 24 ------------------- .../src/mindustry/server/ServerControl.java | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/annotations/src/main/resources/classids.properties b/annotations/src/main/resources/classids.properties index 288f09bdbe..e69de29bb2 100644 --- a/annotations/src/main/resources/classids.properties +++ b/annotations/src/main/resources/classids.properties @@ -1,24 +0,0 @@ -#Maps entity names to IDs. Autogenerated. - -alpha=0 -atrax=1 -block=2 -flare=3 -mace=4 -mega=5 -mindustry.entities.comp.BuildingComp=6 -mindustry.entities.comp.BulletComp=7 -mindustry.entities.comp.DecalComp=8 -mindustry.entities.comp.EffectStateComp=9 -mindustry.entities.comp.FireComp=10 -mindustry.entities.comp.LaunchCoreComp=11 -mindustry.entities.comp.PlayerComp=12 -mindustry.entities.comp.PuddleComp=13 -mindustry.type.Weather.WeatherStateComp=14 -mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=15 -mono=16 -nova=17 -poly=18 -pulsar=19 -risso=20 -spiroct=21 \ No newline at end of file diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index ba231a76a9..3b52af9606 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -61,7 +61,7 @@ public class ServerControl implements ApplicationListener{ "bans", "", "admins", "", "shufflemode", "custom", - "globalrules", "{reactorExplosions: false, schematicAllowed: true}" + "globalrules", "{reactorExplosions: false}" //schematicAllowed: true} //is not working ); Log.setLogger((level, text) -> { From 0d425456befd4a7e907201d804db0bbac8e7b20e Mon Sep 17 00:00:00 2001 From: J-VdS Date: Thu, 20 Aug 2020 20:46:04 +0200 Subject: [PATCH 04/16] allow copies --- .../src/main/resources/classids.properties | 23 +++++++++++++++++++ core/assets/bundles/bundle.properties | 1 + core/src/mindustry/game/Rules.java | 2 ++ core/src/mindustry/input/DesktopInput.java | 4 ++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/annotations/src/main/resources/classids.properties b/annotations/src/main/resources/classids.properties index e69de29bb2..cb9d7967ca 100644 --- a/annotations/src/main/resources/classids.properties +++ b/annotations/src/main/resources/classids.properties @@ -0,0 +1,23 @@ +#Maps entity names to IDs. Autogenerated. + +atrax=0 +block=1 +flare=2 +mace=3 +mega=4 +mindustry.entities.comp.BuildingComp=5 +mindustry.entities.comp.BulletComp=6 +mindustry.entities.comp.DecalComp=7 +mindustry.entities.comp.EffectStateComp=8 +mindustry.entities.comp.FireComp=9 +mindustry.entities.comp.LaunchCoreComp=10 +mindustry.entities.comp.PlayerComp=11 +mindustry.entities.comp.PuddleComp=12 +mindustry.type.Weather.WeatherStateComp=13 +mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=14 +mono=15 +nova=16 +poly=17 +pulsar=18 +risso=19 +spiroct=20 \ No newline at end of file diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 77cbf73a84..eba495d38a 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -54,6 +54,7 @@ schematic.delete.confirm = This schematic will be utterly eradicated. schematic.rename = Rename Schematic schematic.info = {0}x{1}, {2} blocks schematic.disabled = [scarlet]Schematics are not allowed! +schematic.copydisabled = [scarlet]Copying isn't allowed! stat.wave = Waves Defeated:[accent] {0} stat.enemiesDestroyed = Enemies Destroyed:[accent] {0} diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 8c277977fb..9efdc32944 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -40,6 +40,8 @@ public class Rules{ public boolean reactorExplosions = true; /** Whether schematics are allowed */ public boolean schematicAllowed = true; + /** Whether copying is allowed */ + public boolean copyAllowed = true; /** Whether units use and require ammo. */ public boolean unitAmmo = false; /** How fast unit pads build units. */ diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 3a497b9c93..a4eb342f0a 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -401,8 +401,8 @@ public class DesktopInput extends InputHandler{ } if(Core.input.keyRelease(Binding.schematic_select) && !Core.scene.hasKeyboard()){ - if(!state.rules.schematicAllowed){ - ui.showInfoToast("@schematic.disabled", 3f); + if(!state.rules.copyAllowed){ + ui.showInfoToast("@schematic.copydisabled", 3f); }else { lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); useSchematic(lastSchematic); From a418d7e59f6a80580b18c8db03f8a9aa8ec23258 Mon Sep 17 00:00:00 2001 From: J-VdS Date: Thu, 20 Aug 2020 23:34:24 +0200 Subject: [PATCH 05/16] fix mobile copysetting --- core/src/mindustry/input/MobileInput.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 3f6853f4a1..a78ffdd0c0 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -485,11 +485,15 @@ public class MobileInput extends InputHandler implements GestureListener{ lineMode = false; }else if(mode == schematicSelect){ - selectRequests.clear(); - lastSchematic = schematics.create(lineStartX, lineStartY, lastLineX, lastLineY); - useSchematic(lastSchematic); - if(selectRequests.isEmpty()){ - lastSchematic = null; + if(!state.rules.copyAllowed){ + ui.showInfoToast("@schematic.copydisabled", 3f); + }else { + selectRequests.clear(); + lastSchematic = schematics.create(lineStartX, lineStartY, lastLineX, lastLineY); + useSchematic(lastSchematic); + if (selectRequests.isEmpty()) { + lastSchematic = null; + } } schematicMode = false; mode = none; From 51065b57c4da0fcbeae006c8b0a22a82de39146d Mon Sep 17 00:00:00 2001 From: J-VdS Date: Tue, 22 Sep 2020 18:40:04 +0200 Subject: [PATCH 06/16] info popup --- core/assets/bundles/bundle.properties | 4 ++-- core/src/mindustry/game/Rules.java | 2 -- core/src/mindustry/input/DesktopInput.java | 16 +++++----------- core/src/mindustry/input/MobileInput.java | 14 +++++--------- .../mindustry/ui/dialogs/CustomRulesDialog.java | 1 + .../mindustry/ui/dialogs/SchematicsDialog.java | 17 +++++++++++++---- .../src/mindustry/ui/fragments/HudFragment.java | 2 +- 7 files changed, 27 insertions(+), 29 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index eba495d38a..a9b2287157 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -53,8 +53,7 @@ schematic.saved = Schematic saved. schematic.delete.confirm = This schematic will be utterly eradicated. schematic.rename = Rename Schematic schematic.info = {0}x{1}, {2} blocks -schematic.disabled = [scarlet]Schematics are not allowed! -schematic.copydisabled = [scarlet]Copying isn't allowed! +schematic.disabled = [scarlet]Schematics disabled[]\nYou are not allowed to use schematics on this [accent]map[] or [accent]server. stat.wave = Waves Defeated:[accent] {0} stat.enemiesDestroyed = Enemies Destroyed:[accent] {0} @@ -799,6 +798,7 @@ mode.custom = Custom Rules rules.infiniteresources = Infinite Resources rules.reactorexplosions = Reactor Explosions +rules.schematic = Schematics allowed rules.wavetimer = Wave Timer rules.waves = Waves rules.attack = Attack Mode diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 9efdc32944..8c277977fb 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -40,8 +40,6 @@ public class Rules{ public boolean reactorExplosions = true; /** Whether schematics are allowed */ public boolean schematicAllowed = true; - /** Whether copying is allowed */ - public boolean copyAllowed = true; /** Whether units use and require ammo. */ public boolean unitAmmo = false; /** How fast unit pads build units. */ diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index a4eb342f0a..82cea19de6 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -329,7 +329,7 @@ public class DesktopInput extends InputHandler{ table.button(Icon.paste, Styles.clearPartiali, () -> { ui.schematics.show(); - }).tooltip("Schematics").disabled(d -> !state.rules.schematicAllowed); + }).tooltip("Schematics"); table.button(Icon.tree, Styles.clearPartiali, () -> { ui.research.show(); @@ -387,8 +387,6 @@ public class DesktopInput extends InputHandler{ if(Core.input.keyTap(Binding.schematic_menu) && !Core.scene.hasKeyboard()){ if(ui.schematics.isShown()){ ui.schematics.hide(); - }else if(!state.rules.schematicAllowed) { - ui.showInfoToast("@schematic.disabled", 3f); }else{ ui.schematics.show(); ui.schematics.focusSearchField(); @@ -401,14 +399,10 @@ public class DesktopInput extends InputHandler{ } if(Core.input.keyRelease(Binding.schematic_select) && !Core.scene.hasKeyboard()){ - if(!state.rules.copyAllowed){ - ui.showInfoToast("@schematic.copydisabled", 3f); - }else { - lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); - useSchematic(lastSchematic); - if (selectRequests.isEmpty()) { - lastSchematic = null; - } + lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); + useSchematic(lastSchematic); + if (selectRequests.isEmpty()) { + lastSchematic = null; } } diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index a78ffdd0c0..6b4de9b93f 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -485,15 +485,11 @@ public class MobileInput extends InputHandler implements GestureListener{ lineMode = false; }else if(mode == schematicSelect){ - if(!state.rules.copyAllowed){ - ui.showInfoToast("@schematic.copydisabled", 3f); - }else { - selectRequests.clear(); - lastSchematic = schematics.create(lineStartX, lineStartY, lastLineX, lastLineY); - useSchematic(lastSchematic); - if (selectRequests.isEmpty()) { - lastSchematic = null; - } + selectRequests.clear(); + lastSchematic = schematics.create(lineStartX, lineStartY, lastLineX, lastLineY); + useSchematic(lastSchematic); + if (selectRequests.isEmpty()) { + lastSchematic = null; } schematicMode = false; mode = none; diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index 74e0730f68..b6fa18f0c4 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -135,6 +135,7 @@ public class CustomRulesDialog extends BaseDialog{ title("@rules.title.resourcesbuilding"); check("@rules.infiniteresources", b -> rules.infiniteResources = b, () -> rules.infiniteResources); 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.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier); number("@rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources); diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java index 6cd110f4b7..0510abde3b 100644 --- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java +++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java @@ -12,6 +12,7 @@ import arc.scene.ui.TextButton.*; import arc.scene.ui.layout.*; import arc.struct.*; import arc.util.*; +import mindustry.Vars; import mindustry.game.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -64,8 +65,12 @@ public class SchematicsDialog extends BaseDialog{ t.update(() -> { if(Core.input.keyTap(Binding.chat) && Core.scene.getKeyboardFocus() == searchField && firstSchematic != null){ - control.input.useSchematic(firstSchematic); - hide(); + if(!Vars.state.rules.schematicAllowed){ + ui.showInfo("@schematic.disabled"); + }else { + control.input.useSchematic(firstSchematic); + hide(); + } } }); @@ -146,8 +151,12 @@ public class SchematicsDialog extends BaseDialog{ if(state.isMenu()){ showInfo(s); }else{ - control.input.useSchematic(s); - hide(); + if(!Vars.state.rules.schematicAllowed){ + ui.showInfo("@schematic.disabled"); + }else{ + control.input.useSchematic(s); + hide(); + } } }).pad(4).style(Styles.cleari).get(); diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index b0f06a2ff8..d1eae438a2 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -90,7 +90,7 @@ public class HudFragment extends Fragment{ select.button(Icon.menu, style, ui.paused::show); 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, () -> { if(net.active()){ From 393ca67291d69ed80223fbec40378641f50361f0 Mon Sep 17 00:00:00 2001 From: J-VdS Date: Tue, 22 Sep 2020 18:42:59 +0200 Subject: [PATCH 07/16] cleanup --- core/src/mindustry/game/Rules.java | 5 ----- core/src/mindustry/input/DesktopInput.java | 5 ----- 2 files changed, 10 deletions(-) diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 5cf90b9de5..7be274bbef 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -40,15 +40,10 @@ public class Rules{ public boolean reactorExplosions = true; /** Whether schematics are allowed */ public boolean schematicAllowed = true; -<<<<<<< HEAD -======= - /** Whether copying is allowed */ - public boolean copyAllowed = true; /** Whether friendly explosions can occur and set fire/damage other blocks. */ public boolean damageExplosions = true; /** Whether fire is enabled. */ public boolean fire = true; ->>>>>>> fee15caf7aa42f112eebe4c465885b6c37fd51a5 /** Whether units use and require ammo. */ public boolean unitAmmo = false; /** How fast unit pads build units. */ diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index dfea18f26c..47538f7f23 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -344,12 +344,7 @@ public class DesktopInput extends InputHandler{ table.button(Icon.paste, Styles.clearPartiali, () -> { ui.schematics.show(); -<<<<<<< HEAD }).tooltip("Schematics"); -======= - - }).tooltip("@schematics").disabled(d -> !state.rules.schematicAllowed); ->>>>>>> fee15caf7aa42f112eebe4c465885b6c37fd51a5 table.button(Icon.tree, Styles.clearPartiali, () -> { ui.research.show(); From 3a3367b510c0fe6ec0c858bd76138b8951b010ae Mon Sep 17 00:00:00 2001 From: J-VdS Date: Tue, 22 Sep 2020 18:46:28 +0200 Subject: [PATCH 08/16] prepush2 --- .../src/main/resources/classids.properties | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 annotations/src/main/resources/classids.properties diff --git a/annotations/src/main/resources/classids.properties b/annotations/src/main/resources/classids.properties deleted file mode 100644 index cb9d7967ca..0000000000 --- a/annotations/src/main/resources/classids.properties +++ /dev/null @@ -1,23 +0,0 @@ -#Maps entity names to IDs. Autogenerated. - -atrax=0 -block=1 -flare=2 -mace=3 -mega=4 -mindustry.entities.comp.BuildingComp=5 -mindustry.entities.comp.BulletComp=6 -mindustry.entities.comp.DecalComp=7 -mindustry.entities.comp.EffectStateComp=8 -mindustry.entities.comp.FireComp=9 -mindustry.entities.comp.LaunchCoreComp=10 -mindustry.entities.comp.PlayerComp=11 -mindustry.entities.comp.PuddleComp=12 -mindustry.type.Weather.WeatherStateComp=13 -mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=14 -mono=15 -nova=16 -poly=17 -pulsar=18 -risso=19 -spiroct=20 \ No newline at end of file From 89ea055a24a7b37c9306e7558de327026aaafd00 Mon Sep 17 00:00:00 2001 From: J-VdS <38380578+J-VdS@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:58:47 +0200 Subject: [PATCH 09/16] comment change --- server/src/mindustry/server/ServerControl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index f541ed9cce..366f9b1d4e 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -61,7 +61,7 @@ public class ServerControl implements ApplicationListener{ "bans", "", "admins", "", "shufflemode", "custom", - "globalrules", "{reactorExplosions: false}" //schematicAllowed: true} //is not working + "globalrules", "{reactorExplosions: false}" ); //update log level From 4608697d0d16191ab685adce34398eb3a68c8fc0 Mon Sep 17 00:00:00 2001 From: J-VdS <38380578+J-VdS@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:59:35 +0200 Subject: [PATCH 10/16] capitals --- core/assets/bundles/bundle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 361782102c..b2a8d460a1 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -804,7 +804,7 @@ mode.custom = Custom Rules rules.infiniteresources = Infinite Resources rules.reactorexplosions = Reactor Explosions -rules.schematic = Schematics allowed +rules.schematic = Schematics Allowed rules.wavetimer = Wave Timer rules.waves = Waves rules.attack = Attack Mode From ba4612ed96c3c8c4c95ee6ccf86a2187405ce222 Mon Sep 17 00:00:00 2001 From: J-VdS <38380578+J-VdS@users.noreply.github.com> Date: Tue, 22 Sep 2020 19:00:25 +0200 Subject: [PATCH 11/16] indent --- core/assets/bundles/bundle.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index b2a8d460a1..d21a061c73 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -832,7 +832,6 @@ rules.lighting = Lighting rules.ambientlight = Ambient Light rules.solarpowermultiplier = Solar Power Multiplier - content.item.name = Items content.liquid.name = Liquids content.unit.name = Units From a0913c67dff1c36a05dba1ab3aec77f1dbeea5f3 Mon Sep 17 00:00:00 2001 From: J-VdS <38380578+J-VdS@users.noreply.github.com> Date: Tue, 22 Sep 2020 19:01:51 +0200 Subject: [PATCH 12/16] Update DesktopInput.java --- core/src/mindustry/input/DesktopInput.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 47538f7f23..fbf935d631 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -344,7 +344,7 @@ public class DesktopInput extends InputHandler{ table.button(Icon.paste, Styles.clearPartiali, () -> { ui.schematics.show(); - }).tooltip("Schematics"); + }).tooltip("@schematics"); table.button(Icon.tree, Styles.clearPartiali, () -> { ui.research.show(); From 890dfdeb063d6e8b49c07184f64ff82698e0783b Mon Sep 17 00:00:00 2001 From: J-VdS <38380578+J-VdS@users.noreply.github.com> Date: Tue, 22 Sep 2020 19:03:27 +0200 Subject: [PATCH 13/16] weird intellij --- core/src/mindustry/input/DesktopInput.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index fbf935d631..9b02aba3be 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -416,7 +416,7 @@ public class DesktopInput extends InputHandler{ if(Core.input.keyRelease(Binding.schematic_select) && !Core.scene.hasKeyboard()){ lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); useSchematic(lastSchematic); - if (selectRequests.isEmpty()) { + if(selectRequests.isEmpty()){ lastSchematic = null; } } From 428c396968eee57cb0b7b7ad903b40f0ad331cf5 Mon Sep 17 00:00:00 2001 From: J-VdS <38380578+J-VdS@users.noreply.github.com> Date: Tue, 22 Sep 2020 19:04:05 +0200 Subject: [PATCH 14/16] Update SchematicsDialog.java --- core/src/mindustry/ui/dialogs/SchematicsDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java index f4b2031cd9..8a2a28b15b 100644 --- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java +++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java @@ -67,7 +67,7 @@ public class SchematicsDialog extends BaseDialog{ if(Core.input.keyTap(Binding.chat) && Core.scene.getKeyboardFocus() == searchField && firstSchematic != null){ if(!Vars.state.rules.schematicAllowed){ ui.showInfo("@schematic.disabled"); - }else { + }else{ control.input.useSchematic(firstSchematic); hide(); } From 28cd08bdd17e361780c5e69e40fd9d0dbdbc9ae9 Mon Sep 17 00:00:00 2001 From: J-VdS <38380578+J-VdS@users.noreply.github.com> Date: Tue, 22 Sep 2020 19:04:42 +0200 Subject: [PATCH 15/16] idk --- core/src/mindustry/input/MobileInput.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index d3ac4711fa..556d862965 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -488,7 +488,7 @@ public class MobileInput extends InputHandler implements GestureListener{ selectRequests.clear(); lastSchematic = schematics.create(lineStartX, lineStartY, lastLineX, lastLineY); useSchematic(lastSchematic); - if (selectRequests.isEmpty()) { + if(selectRequests.isEmpty()){ lastSchematic = null; } schematicMode = false; From 1e10817708b2422e6bbda09d413e75ded736a619 Mon Sep 17 00:00:00 2001 From: J-VdS Date: Wed, 23 Sep 2020 16:26:48 +0200 Subject: [PATCH 16/16] revert file --- .../src/main/resources/classids.properties | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 annotations/src/main/resources/classids.properties diff --git a/annotations/src/main/resources/classids.properties b/annotations/src/main/resources/classids.properties new file mode 100644 index 0000000000..cb9d7967ca --- /dev/null +++ b/annotations/src/main/resources/classids.properties @@ -0,0 +1,23 @@ +#Maps entity names to IDs. Autogenerated. + +atrax=0 +block=1 +flare=2 +mace=3 +mega=4 +mindustry.entities.comp.BuildingComp=5 +mindustry.entities.comp.BulletComp=6 +mindustry.entities.comp.DecalComp=7 +mindustry.entities.comp.EffectStateComp=8 +mindustry.entities.comp.FireComp=9 +mindustry.entities.comp.LaunchCoreComp=10 +mindustry.entities.comp.PlayerComp=11 +mindustry.entities.comp.PuddleComp=12 +mindustry.type.Weather.WeatherStateComp=13 +mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=14 +mono=15 +nova=16 +poly=17 +pulsar=18 +risso=19 +spiroct=20 \ No newline at end of file