From 124480f96bb8d5810f328bb05ccf9b771ce8b182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=82=A4=EC=97=90=EB=A5=B4?= <44261958+Kieaer@users.noreply.github.com> Date: Sat, 9 Nov 2019 00:17:29 +0900 Subject: [PATCH 1/8] Update EventType.java --- core/src/io/anuke/mindustry/game/EventType.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/game/EventType.java b/core/src/io/anuke/mindustry/game/EventType.java index fef2556d35..189ea60de4 100644 --- a/core/src/io/anuke/mindustry/game/EventType.java +++ b/core/src/io/anuke/mindustry/game/EventType.java @@ -126,9 +126,19 @@ public class EventType{ } - /** Called when a player withdraws items from a block. Tutorial only.*/ + /** Called when the player withdraws items from a block. */ public static class WithdrawEvent{ + public final Tile tile; + public final Player player; + public final Item item; + public final int amount; + public WithdrawEvent(Tile tile, Player player, Item item, int amount){ + this.tile = tile; + this.player = player; + this.item = item; + this.amount = amount; + } } /** Called when a player deposits items to a block.*/ From 7871b5bdaac59e668ab5aa040d6b689441f5ede8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=82=A4=EC=97=90=EB=A5=B4?= <44261958+Kieaer@users.noreply.github.com> Date: Sat, 9 Nov 2019 00:18:41 +0900 Subject: [PATCH 2/8] Update BlockInventoryFragment.java --- .../anuke/mindustry/ui/fragments/BlockInventoryFragment.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java index 1c663f2b4a..094b56026a 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java @@ -42,6 +42,7 @@ public class BlockInventoryFragment extends Fragment{ int removed = tile.block().removeStack(tile, item, amount); player.addItem(item, removed); + Events.fire(new WithdrawEvent(tile, player, item, amount)); for(int j = 0; j < Mathf.clamp(removed / 3, 1, 8); j++){ Time.run(j * 3f, () -> Call.transferItemEffect(item, tile.drawx(), tile.drawy(), player)); } @@ -100,7 +101,7 @@ public class BlockInventoryFragment extends Fragment{ holding = false; holdTime = 0f; - Events.fire(new WithdrawEvent()); + Events.fire(new WithdrawEvent(tile, player, item, amount)); } } @@ -153,7 +154,7 @@ public class BlockInventoryFragment extends Fragment{ lastItem = item; holding = true; holdTime = 0f; - Events.fire(new WithdrawEvent()); + Events.fire(new WithdrawEvent(tile, player, item, amount)); } return true; } From 0c430527b85178ed0783836494becadf6aa9590e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=82=A4=EC=97=90=EB=A5=B4?= <44261958+Kieaer@users.noreply.github.com> Date: Sat, 9 Nov 2019 00:41:31 +0900 Subject: [PATCH 3/8] Fix error --- .../io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java index 094b56026a..05b7a1ea47 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java @@ -101,7 +101,7 @@ public class BlockInventoryFragment extends Fragment{ holding = false; holdTime = 0f; - Events.fire(new WithdrawEvent(tile, player, item, amount)); + Events.fire(new WithdrawEvent(tile, player, lastItem, amount)); } } From 736737f151976f286733130916b2fe015a2b157b Mon Sep 17 00:00:00 2001 From: joshuaptfan Date: Thu, 12 Dec 2019 12:23:32 -0800 Subject: [PATCH 4/8] Make scroll zoom by default, remove zoom hold keybind --- core/assets/bundles/bundle.properties | 3 +-- core/assets/bundles/bundle_cs.properties | 1 - core/assets/bundles/bundle_de.properties | 1 - core/assets/bundles/bundle_es.properties | 1 - core/assets/bundles/bundle_et.properties | 1 - core/assets/bundles/bundle_eu.properties | 1 - core/assets/bundles/bundle_fi.properties | 1 - core/assets/bundles/bundle_fr.properties | 1 - core/assets/bundles/bundle_fr_BE.properties | 1 - core/assets/bundles/bundle_in_ID.properties | 1 - core/assets/bundles/bundle_it.properties | 1 - core/assets/bundles/bundle_ja.properties | 1 - core/assets/bundles/bundle_ko.properties | 1 - core/assets/bundles/bundle_nl.properties | 1 - core/assets/bundles/bundle_nl_BE.properties | 1 - core/assets/bundles/bundle_pl.properties | 1 - core/assets/bundles/bundle_pt.properties | 1 - core/assets/bundles/bundle_pt_BR.properties | 1 - core/assets/bundles/bundle_ru.properties | 1 - core/assets/bundles/bundle_sv.properties | 1 - core/assets/bundles/bundle_tk.properties | 1 - core/assets/bundles/bundle_tr.properties | 1 - core/assets/bundles/bundle_uk_UA.properties | 1 - core/assets/bundles/bundle_zh_CN.properties | 1 - core/assets/bundles/bundle_zh_TW.properties | 1 - core/src/io/anuke/mindustry/input/Binding.java | 3 +-- core/src/io/anuke/mindustry/input/DesktopInput.java | 5 ++--- core/src/io/anuke/mindustry/input/MobileInput.java | 2 +- 28 files changed, 5 insertions(+), 32 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index a42c94141a..ba37ff4782 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -705,7 +705,6 @@ keybind.pick.name = Pick Block keybind.break_block.name = Break Block keybind.deselect.name = Deselect keybind.shoot.name = Shoot -keybind.zoom_hold.name = Zoom Hold keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pause @@ -1046,7 +1045,7 @@ unit.eradicator.name = Eradicator unit.lich.name = Lich unit.reaper.name = Reaper tutorial.next = [lightgray] -tutorial.intro = You have entered the[scarlet] Mindustry Tutorial.[]\nUse [accent][[WASD][] to move.\n[accent]Hold [[Ctrl] while scrolling[] to zoom in and out.\nBegin by[accent] mining copper[]. Move close to it, then tap a copper ore vein near your core to do this.\n\n[accent]{0}/{1} copper +tutorial.intro = You have entered the[scarlet] Mindustry Tutorial.[]\nUse[accent] [[WASD][] to move.\n[accent]Scroll[] to zoom in and out.\nBegin by[accent] mining copper[]. Move close to it, then tap a copper ore vein near your core to do this.\n\n[accent]{0}/{1} copper tutorial.intro.mobile = You have entered the[scarlet] Mindustry Tutorial.[]\nSwipe the screen to move.\n[accent]Pinch with 2 fingers[] to zoom in and out.\nBegin by[accent] mining copper[]. Move close to it, then tap a copper ore vein near your core to do this.\n\n[accent]{0}/{1} copper tutorial.drill = Mining manually is inefficient.\n[accent]Drills[] can mine automatically.\nClick the drill tab in the bottom right.\nSelect the[accent] mechanical drill[]. Place it on a copper vein by clicking.\nYou can also select the drill by tapping [accent][[2][] then [accent][[1][] quickly, regardless of which tab is open.\n[accent]Right-click[] to stop building. tutorial.drill.mobile = Mining manually is inefficient.\n[accent]Drills[] can mine automatically.\nTap the drill tab in the bottom right.\nSelect the[accent] mechanical drill[].\nPlace it on a copper vein by tapping, then press the[accent] checkmark[] below to confirm your selection.\nPress the[accent] X button[] to cancel placement. diff --git a/core/assets/bundles/bundle_cs.properties b/core/assets/bundles/bundle_cs.properties index c8e5294c26..2160901318 100644 --- a/core/assets/bundles/bundle_cs.properties +++ b/core/assets/bundles/bundle_cs.properties @@ -652,7 +652,6 @@ keybind.pick.name = Pick Block keybind.break_block.name = Break Block keybind.deselect.name = Odznačit keybind.shoot.name = Střílet -keybind.zoom_hold.name = Přiblížení-podržení keybind.zoom.name = přiblížení keybind.menu.name = Hlavní nabídka keybind.pause.name = pauza diff --git a/core/assets/bundles/bundle_de.properties b/core/assets/bundles/bundle_de.properties index 4d21b8d8db..4960165cf7 100644 --- a/core/assets/bundles/bundle_de.properties +++ b/core/assets/bundles/bundle_de.properties @@ -652,7 +652,6 @@ keybind.pick.name = Block Auswählen keybind.break_block.name = Block zerstören keybind.deselect.name = Auswahl aufheben keybind.shoot.name = Schießen -keybind.zoom_hold.name = Zoom halten keybind.zoom.name = Zoomen keybind.menu.name = Menü keybind.pause.name = Pause diff --git a/core/assets/bundles/bundle_es.properties b/core/assets/bundles/bundle_es.properties index 1901f2c3c1..38f9696ea3 100644 --- a/core/assets/bundles/bundle_es.properties +++ b/core/assets/bundles/bundle_es.properties @@ -652,7 +652,6 @@ keybind.pick.name = Pick Block keybind.break_block.name = Destruir Bloque keybind.deselect.name = Deseleccionar keybind.shoot.name = Disparar -keybind.zoom_hold.name = Mantener Zoom keybind.zoom.name = Zoom keybind.menu.name = Menú keybind.pause.name = Pausa diff --git a/core/assets/bundles/bundle_et.properties b/core/assets/bundles/bundle_et.properties index adbd5393be..c3e62686d2 100644 --- a/core/assets/bundles/bundle_et.properties +++ b/core/assets/bundles/bundle_et.properties @@ -652,7 +652,6 @@ keybind.pick.name = Vali blokk keybind.break_block.name = Hävita blokk keybind.deselect.name = Tühista valik keybind.shoot.name = Tulista -keybind.zoom_hold.name = Suumimise režiim keybind.zoom.name = Muuda suumi keybind.menu.name = Menüü keybind.pause.name = Paus diff --git a/core/assets/bundles/bundle_eu.properties b/core/assets/bundles/bundle_eu.properties index c86b1c28cd..66d71a0dce 100644 --- a/core/assets/bundles/bundle_eu.properties +++ b/core/assets/bundles/bundle_eu.properties @@ -652,7 +652,6 @@ keybind.pick.name = Jaso blokea keybind.break_block.name = Apurtu blokea keybind.deselect.name = Deshautatu keybind.shoot.name = Tirokatu -keybind.zoom_hold.name = Zoom mantenduz keybind.zoom.name = Zoom keybind.menu.name = Menua keybind.pause.name = Pausatu diff --git a/core/assets/bundles/bundle_fi.properties b/core/assets/bundles/bundle_fi.properties index b441ee0a62..be59e014aa 100644 --- a/core/assets/bundles/bundle_fi.properties +++ b/core/assets/bundles/bundle_fi.properties @@ -547,7 +547,6 @@ keybind.pick.name = Pick Block keybind.break_block.name = Break Block keybind.deselect.name = Deselect keybind.shoot.name = Shoot -keybind.zoom_hold.name = Zoom Hold keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pause diff --git a/core/assets/bundles/bundle_fr.properties b/core/assets/bundles/bundle_fr.properties index f4464dd977..919f3bb615 100644 --- a/core/assets/bundles/bundle_fr.properties +++ b/core/assets/bundles/bundle_fr.properties @@ -698,7 +698,6 @@ keybind.pick.name = Choisir un bloc keybind.break_block.name = Supprimer un bloc keybind.deselect.name = Désélectionner keybind.shoot.name = Tirer -keybind.zoom_hold.name = Maintenir pour zoomer keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pause diff --git a/core/assets/bundles/bundle_fr_BE.properties b/core/assets/bundles/bundle_fr_BE.properties index 52e9efb2c2..9510ce227d 100644 --- a/core/assets/bundles/bundle_fr_BE.properties +++ b/core/assets/bundles/bundle_fr_BE.properties @@ -652,7 +652,6 @@ keybind.pick.name = Choisir un bloc keybind.break_block.name = Supprimer un bloc keybind.deselect.name = Déselectionner keybind.shoot.name = Tirer -keybind.zoom_hold.name = Tenir le zoom keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pause diff --git a/core/assets/bundles/bundle_in_ID.properties b/core/assets/bundles/bundle_in_ID.properties index 1f253e9698..73fff980c3 100644 --- a/core/assets/bundles/bundle_in_ID.properties +++ b/core/assets/bundles/bundle_in_ID.properties @@ -652,7 +652,6 @@ keybind.pick.name = Memilih Blok keybind.break_block.name = Menghancurkan Blok keybind.deselect.name = Batal Memilih keybind.shoot.name = Menembak -keybind.zoom_hold.name = Tahan Mode Zoom keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Jeda diff --git a/core/assets/bundles/bundle_it.properties b/core/assets/bundles/bundle_it.properties index 7fb632244c..75351ad9a8 100644 --- a/core/assets/bundles/bundle_it.properties +++ b/core/assets/bundles/bundle_it.properties @@ -699,7 +699,6 @@ keybind.pick.name = Scegli Blocco keybind.break_block.name = Rompi Blocco keybind.deselect.name = Deseleziona keybind.shoot.name = Spara -keybind.zoom_hold.name = Attiva Zoom keybind.zoom.name = Esegui Zoom keybind.menu.name = Menu keybind.pause.name = Pausa diff --git a/core/assets/bundles/bundle_ja.properties b/core/assets/bundles/bundle_ja.properties index 06cc822663..2d3db1916e 100644 --- a/core/assets/bundles/bundle_ja.properties +++ b/core/assets/bundles/bundle_ja.properties @@ -652,7 +652,6 @@ keybind.pick.name = ブロックの選択 keybind.break_block.name = ブロックの破壊 keybind.deselect.name = 選択解除 keybind.shoot.name = ショット -keybind.zoom_hold.name = 長押しズーム keybind.zoom.name = ズーム keybind.menu.name = メニュー keybind.pause.name = ポーズ diff --git a/core/assets/bundles/bundle_ko.properties b/core/assets/bundles/bundle_ko.properties index ddaa1612f0..71a44a6bff 100644 --- a/core/assets/bundles/bundle_ko.properties +++ b/core/assets/bundles/bundle_ko.properties @@ -704,7 +704,6 @@ keybind.pick.name = 블록 선택 keybind.break_block.name = 블록 파괴 keybind.deselect.name = 선택해제 keybind.shoot.name = 사격 -keybind.zoom_hold.name = 길게 확대 keybind.zoom.name = 확대 keybind.menu.name = 메뉴 keybind.pause.name = 일시중지 diff --git a/core/assets/bundles/bundle_nl.properties b/core/assets/bundles/bundle_nl.properties index a9bf6129f3..4e0b424284 100644 --- a/core/assets/bundles/bundle_nl.properties +++ b/core/assets/bundles/bundle_nl.properties @@ -652,7 +652,6 @@ keybind.pick.name = Pick Block keybind.break_block.name = Break Block keybind.deselect.name = Deselect keybind.shoot.name = Shoot -keybind.zoom_hold.name = Zoom Hold keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pause diff --git a/core/assets/bundles/bundle_nl_BE.properties b/core/assets/bundles/bundle_nl_BE.properties index 214dc53a1e..21e2410cfe 100644 --- a/core/assets/bundles/bundle_nl_BE.properties +++ b/core/assets/bundles/bundle_nl_BE.properties @@ -653,7 +653,6 @@ keybind.pick.name = Pick Block keybind.break_block.name = Break Block keybind.deselect.name = Deselect keybind.shoot.name = Shoot -keybind.zoom_hold.name = Zoom Hold keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pause diff --git a/core/assets/bundles/bundle_pl.properties b/core/assets/bundles/bundle_pl.properties index 7e8ddd3812..fd97dca25f 100644 --- a/core/assets/bundles/bundle_pl.properties +++ b/core/assets/bundles/bundle_pl.properties @@ -699,7 +699,6 @@ keybind.pick.name = Wybierz Blok keybind.break_block.name = Zniszcz Blok keybind.deselect.name = Odznacz keybind.shoot.name = Strzelanie -keybind.zoom_hold.name = Inicjator przybliżania keybind.zoom.name = Przybliżanie keybind.menu.name = Menu keybind.pause.name = Pauza diff --git a/core/assets/bundles/bundle_pt.properties b/core/assets/bundles/bundle_pt.properties index 6e6169b4b5..a0300813f5 100644 --- a/core/assets/bundles/bundle_pt.properties +++ b/core/assets/bundles/bundle_pt.properties @@ -652,7 +652,6 @@ keybind.pick.name = Pegar bloco keybind.break_block.name = Quebrar bloco keybind.deselect.name = Deselecionar keybind.shoot.name = Atirar -keybind.zoom_hold.name = segurar_zoom keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pausar diff --git a/core/assets/bundles/bundle_pt_BR.properties b/core/assets/bundles/bundle_pt_BR.properties index e2d775ff53..1e05466d91 100644 --- a/core/assets/bundles/bundle_pt_BR.properties +++ b/core/assets/bundles/bundle_pt_BR.properties @@ -700,7 +700,6 @@ keybind.pick.name = Pegar bloco keybind.break_block.name = Quebrar bloco keybind.deselect.name = Deselecionar keybind.shoot.name = Atirar -keybind.zoom_hold.name = segurar Zoom keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pausar diff --git a/core/assets/bundles/bundle_ru.properties b/core/assets/bundles/bundle_ru.properties index 8a7f6b3481..fe99336838 100644 --- a/core/assets/bundles/bundle_ru.properties +++ b/core/assets/bundles/bundle_ru.properties @@ -702,7 +702,6 @@ keybind.pick.name = Выбрать блок keybind.break_block.name = Разрушить блок keybind.deselect.name = Снять выделение keybind.shoot.name = Выстрел -keybind.zoom_hold.name = Управление масштабом keybind.zoom.name = Приблизить/Отдалить keybind.menu.name = Меню keybind.pause.name = Пауза diff --git a/core/assets/bundles/bundle_sv.properties b/core/assets/bundles/bundle_sv.properties index f01aa8b241..13ad6cdfae 100644 --- a/core/assets/bundles/bundle_sv.properties +++ b/core/assets/bundles/bundle_sv.properties @@ -652,7 +652,6 @@ keybind.pick.name = Pick Block keybind.break_block.name = Break Block keybind.deselect.name = Deselect keybind.shoot.name = Shoot -keybind.zoom_hold.name = Zoom Hold keybind.zoom.name = Zoom keybind.menu.name = Menu keybind.pause.name = Pause diff --git a/core/assets/bundles/bundle_tk.properties b/core/assets/bundles/bundle_tk.properties index 2fd55efb4d..ef01140591 100644 --- a/core/assets/bundles/bundle_tk.properties +++ b/core/assets/bundles/bundle_tk.properties @@ -652,7 +652,6 @@ keybind.pick.name = Pick Block keybind.break_block.name = Break Block keybind.deselect.name = Eldeki yapiyi birak keybind.shoot.name = Sik -keybind.zoom_hold.name = Yaklasma basili tutmasi keybind.zoom.name = Yaklas keybind.menu.name = Menu keybind.pause.name = Durdur diff --git a/core/assets/bundles/bundle_tr.properties b/core/assets/bundles/bundle_tr.properties index 9082a2ae3b..13550abe69 100644 --- a/core/assets/bundles/bundle_tr.properties +++ b/core/assets/bundles/bundle_tr.properties @@ -652,7 +652,6 @@ keybind.pick.name = Blok Seç keybind.break_block.name = Blok Kır keybind.deselect.name = Seçimleri Kaldır keybind.shoot.name = Ateş Et -keybind.zoom_hold.name = Zumu Sabit Tutma keybind.zoom.name = Zum keybind.menu.name = Menü keybind.pause.name = Durdur diff --git a/core/assets/bundles/bundle_uk_UA.properties b/core/assets/bundles/bundle_uk_UA.properties index 07cbede5c6..e44866227c 100644 --- a/core/assets/bundles/bundle_uk_UA.properties +++ b/core/assets/bundles/bundle_uk_UA.properties @@ -692,7 +692,6 @@ keybind.pick.name = Вибрати блок keybind.break_block.name = Зламати блок keybind.deselect.name = Скасувати keybind.shoot.name = Постріл -keybind.zoom_hold.name = Керування масштабом keybind.zoom.name = Приблизити keybind.menu.name = Меню keybind.pause.name = Пауза diff --git a/core/assets/bundles/bundle_zh_CN.properties b/core/assets/bundles/bundle_zh_CN.properties index b2ae9cdc24..edb60b0a77 100644 --- a/core/assets/bundles/bundle_zh_CN.properties +++ b/core/assets/bundles/bundle_zh_CN.properties @@ -699,7 +699,6 @@ keybind.pick.name = 选择方块 keybind.break_block.name = 破坏方块 keybind.deselect.name = 取消选择 keybind.shoot.name = 射击 -keybind.zoom_hold.name = 按住调整缩放 keybind.zoom.name = 缩放 keybind.menu.name = 菜单 keybind.pause.name = 暂停 diff --git a/core/assets/bundles/bundle_zh_TW.properties b/core/assets/bundles/bundle_zh_TW.properties index e286fa4854..050884d00f 100644 --- a/core/assets/bundles/bundle_zh_TW.properties +++ b/core/assets/bundles/bundle_zh_TW.properties @@ -680,7 +680,6 @@ keybind.pick.name = 選擇方塊 keybind.break_block.name = 移除方塊 keybind.deselect.name = 取消選取 keybind.shoot.name = 射擊 -keybind.zoom_hold.name = 按住縮放 keybind.zoom.name = 縮放 keybind.menu.name = 主選單 keybind.pause.name = 暫停遊戲 diff --git a/core/src/io/anuke/mindustry/input/Binding.java b/core/src/io/anuke/mindustry/input/Binding.java index 3ac5f68271..9134506735 100644 --- a/core/src/io/anuke/mindustry/input/Binding.java +++ b/core/src/io/anuke/mindustry/input/Binding.java @@ -40,8 +40,7 @@ public enum Binding implements KeyBind{ block_select_08(KeyCode.NUM_8), block_select_09(KeyCode.NUM_9), block_select_10(KeyCode.NUM_0), - zoom_hold(KeyCode.CONTROL_LEFT, "view"), - zoom(new Axis(KeyCode.SCROLL)), + zoom(new Axis(KeyCode.SCROLL), "view"), menu(Core.app.getType() == ApplicationType.Android ? KeyCode.BACK : KeyCode.ESCAPE), fullscreen(KeyCode.F11), pause(KeyCode.SPACE), diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index e8cc6793d8..90735461bc 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -150,7 +150,7 @@ public class DesktopInput extends InputHandler{ if(state.is(State.menu) || Core.scene.hasDialog()) return; //zoom things - if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && Core.input.keyDown(Binding.zoom_hold)){ + if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (block == null || !block.rotate) && selectRequests.isEmpty()){ renderer.scaleCamera(Core.input.axisTap(Binding.zoom)); } @@ -182,8 +182,7 @@ public class DesktopInput extends InputHandler{ selectScale = 0f; } - if(!Core.input.keyDown(Binding.zoom_hold) && Math.abs((int)Core.input.axisTap(Binding.rotate)) > 0){ - + if(Math.abs((int)Core.input.axisTap(Binding.rotate)) > 0){ rotation = Mathf.mod(rotation + (int)Core.input.axisTap(Binding.rotate), 4); if(sreq != null){ diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 717fb68c95..6cd2a8aee4 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -588,7 +588,7 @@ public class MobileInput extends InputHandler implements GestureListener{ } //zoom things - if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && (Core.input.keyDown(Binding.zoom_hold))){ + if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0){ renderer.scaleCamera(Core.input.axisTap(Binding.zoom)); } From 5db8520b743d4b02959a5bd04233870fe2836292 Mon Sep 17 00:00:00 2001 From: joshuaptfan Date: Thu, 12 Dec 2019 13:52:05 -0800 Subject: [PATCH 5/8] Add rotation checks to mobile zoom --- core/src/io/anuke/mindustry/input/MobileInput.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 6cd2a8aee4..7afd2444b4 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -588,7 +588,7 @@ public class MobileInput extends InputHandler implements GestureListener{ } //zoom things - if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0){ + if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (block == null || !block.rotate) && selectRequests.isEmpty()){ renderer.scaleCamera(Core.input.axisTap(Binding.zoom)); } From 6ce013a1ebeb4374b482587bb78dad1ed25a32aa Mon Sep 17 00:00:00 2001 From: joshuaptfan Date: Thu, 12 Dec 2019 14:56:32 -0800 Subject: [PATCH 6/8] Make diagonal placement keybind modify scroll to always zoom --- core/src/io/anuke/mindustry/input/DesktopInput.java | 6 +++--- core/src/io/anuke/mindustry/input/MobileInput.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index 90735461bc..f9fa0dc7cd 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -149,8 +149,8 @@ public class DesktopInput extends InputHandler{ if(state.is(State.menu) || Core.scene.hasDialog()) return; - //zoom things - if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (block == null || !block.rotate) && selectRequests.isEmpty()){ + //zoom camera + if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((block == null || !block.rotate) && selectRequests.isEmpty()))){ renderer.scaleCamera(Core.input.axisTap(Binding.zoom)); } @@ -182,7 +182,7 @@ public class DesktopInput extends InputHandler{ selectScale = 0f; } - if(Math.abs((int)Core.input.axisTap(Binding.rotate)) > 0){ + if(!Core.input.keyDown(Binding.diagonal_placement) && Math.abs((int)Core.input.axisTap(Binding.rotate)) > 0){ rotation = Mathf.mod(rotation + (int)Core.input.axisTap(Binding.rotate), 4); if(sreq != null){ diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 7afd2444b4..26cf3fcd09 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -587,8 +587,8 @@ public class MobileInput extends InputHandler implements GestureListener{ mode = none; } - //zoom things - if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (block == null || !block.rotate) && selectRequests.isEmpty()){ + //zoom camera + if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((block == null || !block.rotate) && selectRequests.isEmpty()))){ renderer.scaleCamera(Core.input.axisTap(Binding.zoom)); } From 9d2133814c308b5e17525b4f84699bb4b2d5e5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=82=A4=EC=97=90=EB=A5=B4?= <44261958+Kieaer@users.noreply.github.com> Date: Fri, 13 Dec 2019 07:56:50 +0900 Subject: [PATCH 7/8] Update MessageBlock.java --- .../io/anuke/mindustry/world/blocks/logic/MessageBlock.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/io/anuke/mindustry/world/blocks/logic/MessageBlock.java b/core/src/io/anuke/mindustry/world/blocks/logic/MessageBlock.java index 0cb2611815..0d00c50d09 100644 --- a/core/src/io/anuke/mindustry/world/blocks/logic/MessageBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/logic/MessageBlock.java @@ -147,8 +147,8 @@ public class MessageBlock extends Block{ } public class MessageBlockEntity extends TileEntity{ - protected String message = ""; - protected String[] lines = {""}; + public String message = ""; + public String[] lines = {""}; @Override public void write(DataOutput stream) throws IOException{ From 1f5e773c776da94612723cfb79113674c7a34143 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 13 Dec 2019 23:15:49 -0500 Subject: [PATCH 8/8] Fixed double-event firing --- .../anuke/mindustry/ui/fragments/BlockInventoryFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java index 05b7a1ea47..a844e448f3 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java @@ -101,7 +101,7 @@ public class BlockInventoryFragment extends Fragment{ holding = false; holdTime = 0f; - Events.fire(new WithdrawEvent(tile, player, lastItem, amount)); + if(net.client()) Events.fire(new WithdrawEvent(tile, player, lastItem, amount)); } } @@ -154,7 +154,7 @@ public class BlockInventoryFragment extends Fragment{ lastItem = item; holding = true; holdTime = 0f; - Events.fire(new WithdrawEvent(tile, player, item, amount)); + if(net.client()) Events.fire(new WithdrawEvent(tile, player, item, amount)); } return true; }