diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 0fbcc45895..8cc3716be8 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1114,6 +1114,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Select Region keybind.schematic_menu.name = Schematic Menu keybind.schematic_flip_x.name = Flip Schematic X diff --git a/core/assets/bundles/bundle_be.properties b/core/assets/bundles/bundle_be.properties index 4d0f324d87..c52e53f3f6 100644 --- a/core/assets/bundles/bundle_be.properties +++ b/core/assets/bundles/bundle_be.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = наследуе курсорам keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Абраць вобласць keybind.schematic_menu.name = Меню схем keybind.schematic_flip_x.name = Адлюстраваць схему па восі X diff --git a/core/assets/bundles/bundle_bg.properties b/core/assets/bundles/bundle_bg.properties index 9e46ac70b0..3542547340 100644 --- a/core/assets/bundles/bundle_bg.properties +++ b/core/assets/bundles/bundle_bg.properties @@ -1101,6 +1101,7 @@ keybind.mouse_move.name = Следвай Мишката keybind.pan.name = Панорамен Изглед keybind.boost.name = Ускорение keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Избери Регион keybind.schematic_menu.name = Меню със Схеми keybind.schematic_flip_x.name = Завърти Схема по X diff --git a/core/assets/bundles/bundle_ca.properties b/core/assets/bundles/bundle_ca.properties index 6d55a61b99..7f60021106 100644 --- a/core/assets/bundles/bundle_ca.properties +++ b/core/assets/bundles/bundle_ca.properties @@ -1106,6 +1106,7 @@ keybind.mouse_move.name = Segueix el ratolí keybind.pan.name = Desplaça la vista keybind.boost.name = Sobrevola keybind.command_mode.name = Mode de comandament +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Selecciona una regió keybind.schematic_menu.name = Menú de plànols keybind.schematic_flip_x.name = Volta el plànol horitzontalment diff --git a/core/assets/bundles/bundle_cs.properties b/core/assets/bundles/bundle_cs.properties index 267c9f6ea3..4ef211bb43 100644 --- a/core/assets/bundles/bundle_cs.properties +++ b/core/assets/bundles/bundle_cs.properties @@ -1103,6 +1103,7 @@ keybind.mouse_move.name = Následovat myš keybind.pan.name = Následovat kameru keybind.boost.name = Posílení keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Vybrat oblast keybind.schematic_menu.name = Nabídka šablon keybind.schematic_flip_x.name = Překlopit šablona podle svislé osy diff --git a/core/assets/bundles/bundle_da.properties b/core/assets/bundles/bundle_da.properties index 9155800207..406fb76b7a 100644 --- a/core/assets/bundles/bundle_da.properties +++ b/core/assets/bundles/bundle_da.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Følg musen keybind.pan.name = Panorer billede keybind.boost.name = Forstærk keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Vælg region keybind.schematic_menu.name = Skabelon-visning keybind.schematic_flip_x.name = Flip skabelon X diff --git a/core/assets/bundles/bundle_de.properties b/core/assets/bundles/bundle_de.properties index fe8dd9c6b5..97e8cd016f 100644 --- a/core/assets/bundles/bundle_de.properties +++ b/core/assets/bundles/bundle_de.properties @@ -1106,6 +1106,7 @@ keybind.mouse_move.name = Der Maus folgen keybind.pan.name = Kamera alleine bewegen keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Bereich auswählen keybind.schematic_menu.name = Entwurfsmenü keybind.schematic_flip_x.name = Entwurf umdrehen X diff --git a/core/assets/bundles/bundle_es.properties b/core/assets/bundles/bundle_es.properties index a3e0d01662..508da610b9 100644 --- a/core/assets/bundles/bundle_es.properties +++ b/core/assets/bundles/bundle_es.properties @@ -1112,6 +1112,7 @@ keybind.mouse_move.name = Seguir al cursor keybind.pan.name = Desplazar la cámara keybind.boost.name = Sobrevolar keybind.command_mode.name = Modo Escuadrón +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Seleccionar región keybind.schematic_menu.name = Menú de esquemas keybind.schematic_flip_x.name = Invertir esquema X diff --git a/core/assets/bundles/bundle_et.properties b/core/assets/bundles/bundle_et.properties index 997526b458..c22aa3b9d1 100644 --- a/core/assets/bundles/bundle_et.properties +++ b/core/assets/bundles/bundle_et.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Select Region keybind.schematic_menu.name = Schematic Menu keybind.schematic_flip_x.name = Flip Schematic X diff --git a/core/assets/bundles/bundle_eu.properties b/core/assets/bundles/bundle_eu.properties index b9a22c8ecf..316ea03310 100644 --- a/core/assets/bundles/bundle_eu.properties +++ b/core/assets/bundles/bundle_eu.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Hautatu eskualdea keybind.schematic_menu.name = Eskema menua keybind.schematic_flip_x.name = Itzulbiratu X diff --git a/core/assets/bundles/bundle_fi.properties b/core/assets/bundles/bundle_fi.properties index e0b10d059a..c30be04f27 100644 --- a/core/assets/bundles/bundle_fi.properties +++ b/core/assets/bundles/bundle_fi.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Seuraa Hiirtä keybind.pan.name = Kelaa näkymää keybind.boost.name = Tehosta keybind.command_mode.name = Komentotila +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Valitse alue keybind.schematic_menu.name = Kaavio Valikko keybind.schematic_flip_x.name = Käännä kaavio X-akselilla diff --git a/core/assets/bundles/bundle_fil.properties b/core/assets/bundles/bundle_fil.properties index 0dbe0cf10f..3ba8d2ae43 100644 --- a/core/assets/bundles/bundle_fil.properties +++ b/core/assets/bundles/bundle_fil.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Select Region keybind.schematic_menu.name = Schematic Menu keybind.schematic_flip_x.name = Flip Schematic X diff --git a/core/assets/bundles/bundle_fr.properties b/core/assets/bundles/bundle_fr.properties index 9ee5679065..1ed90eef98 100644 --- a/core/assets/bundles/bundle_fr.properties +++ b/core/assets/bundles/bundle_fr.properties @@ -1111,6 +1111,7 @@ keybind.mouse_move.name = Suivre la souris keybind.pan.name = Vue Panoramique keybind.boost.name = Boost keybind.command_mode.name = Mode « Commande » +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Sélectionner une Région keybind.schematic_menu.name = Menu des schémas keybind.schematic_flip_x.name = Retourner le schéma sur l'axe des X diff --git a/core/assets/bundles/bundle_hu.properties b/core/assets/bundles/bundle_hu.properties index 446a55f2fb..f0429f7aae 100644 --- a/core/assets/bundles/bundle_hu.properties +++ b/core/assets/bundles/bundle_hu.properties @@ -1100,6 +1100,7 @@ keybind.mouse_move.name = Egér követése keybind.pan.name = Felderítés keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Terület kijelölése keybind.schematic_menu.name = Schematic menü keybind.schematic_flip_x.name = Schematic tükrözése vízszintesen diff --git a/core/assets/bundles/bundle_id_ID.properties b/core/assets/bundles/bundle_id_ID.properties index b669d9fa95..aa0d28199c 100644 --- a/core/assets/bundles/bundle_id_ID.properties +++ b/core/assets/bundles/bundle_id_ID.properties @@ -1111,6 +1111,7 @@ keybind.mouse_move.name = Ikuti Tetikus keybind.pan.name = Tampilan Geser keybind.boost.name = Dorongan keybind.command_mode.name = Mode Perintah +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Pilih Daerah keybind.schematic_menu.name = Menu Skema keybind.schematic_flip_x.name = Balik Skema X diff --git a/core/assets/bundles/bundle_it.properties b/core/assets/bundles/bundle_it.properties index 734d86d0e8..d10b64052d 100644 --- a/core/assets/bundles/bundle_it.properties +++ b/core/assets/bundles/bundle_it.properties @@ -1098,6 +1098,7 @@ keybind.mouse_move.name = Segui il Mouse keybind.pan.name = Vista Panoramica keybind.boost.name = Scatto keybind.command_mode.name = Modalità di comando +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Seleziona Regione keybind.schematic_menu.name = Menu Schematica keybind.schematic_flip_x.name = Ruota Schematica Orizzontalmente diff --git a/core/assets/bundles/bundle_ja.properties b/core/assets/bundles/bundle_ja.properties index 3281cf4b3a..0820fec406 100644 --- a/core/assets/bundles/bundle_ja.properties +++ b/core/assets/bundles/bundle_ja.properties @@ -1103,6 +1103,7 @@ keybind.mouse_move.name = マウスを追う keybind.pan.name = 視点移動 keybind.boost.name = ブースト keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = 範囲選択 keybind.schematic_menu.name = 設計図メニュー keybind.schematic_flip_x.name = 設計図をX座標で反転 diff --git a/core/assets/bundles/bundle_ko.properties b/core/assets/bundles/bundle_ko.properties index c4ff8776d1..b5aec7b677 100644 --- a/core/assets/bundles/bundle_ko.properties +++ b/core/assets/bundles/bundle_ko.properties @@ -1104,6 +1104,7 @@ keybind.mouse_move.name = 커서를 따라서 이동 keybind.pan.name = 팬 보기 keybind.boost.name = 이륙 keybind.command_mode.name = 명령 모드 +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = 영역 설정 keybind.schematic_menu.name = 설계도 메뉴 keybind.schematic_flip_x.name = 설계도 X축 뒤집기 diff --git a/core/assets/bundles/bundle_lt.properties b/core/assets/bundles/bundle_lt.properties index 2d05b7f285..2f250d4453 100644 --- a/core/assets/bundles/bundle_lt.properties +++ b/core/assets/bundles/bundle_lt.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Sekti Pelę keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Pasirinkite Regioną keybind.schematic_menu.name = Schemų Meniu keybind.schematic_flip_x.name = Apversti schemą per X ašį diff --git a/core/assets/bundles/bundle_nl.properties b/core/assets/bundles/bundle_nl.properties index 5a02a109c8..88403c82a1 100644 --- a/core/assets/bundles/bundle_nl.properties +++ b/core/assets/bundles/bundle_nl.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Volg Muis keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Selecteer gebied keybind.schematic_menu.name = Ontwerp Menu keybind.schematic_flip_x.name = Spiegel ontwerp X diff --git a/core/assets/bundles/bundle_nl_BE.properties b/core/assets/bundles/bundle_nl_BE.properties index 58db307042..013a72d7bd 100644 --- a/core/assets/bundles/bundle_nl_BE.properties +++ b/core/assets/bundles/bundle_nl_BE.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Select Region keybind.schematic_menu.name = Schematic Menu keybind.schematic_flip_x.name = Flip Schematic X diff --git a/core/assets/bundles/bundle_pl.properties b/core/assets/bundles/bundle_pl.properties index e976e737b0..268073894e 100644 --- a/core/assets/bundles/bundle_pl.properties +++ b/core/assets/bundles/bundle_pl.properties @@ -1102,6 +1102,7 @@ keybind.mouse_move.name = Podążaj Za Myszą keybind.pan.name = Widok Panoramiczny keybind.boost.name = Przyspiesz keybind.command_mode.name = Tryb Komend +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Wybierz region keybind.schematic_menu.name = Menu schematów keybind.schematic_flip_x.name = Obróć schemat w poziomie diff --git a/core/assets/bundles/bundle_pt_BR.properties b/core/assets/bundles/bundle_pt_BR.properties index ac39fd8c40..60cad3c653 100644 --- a/core/assets/bundles/bundle_pt_BR.properties +++ b/core/assets/bundles/bundle_pt_BR.properties @@ -1113,6 +1113,7 @@ keybind.mouse_move.name = Seguir o Cursor keybind.pan.name = Câmera livre keybind.boost.name = Impulsionar keybind.command_mode.name = Modo de Comando +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Selecionar região keybind.schematic_menu.name = Menu de Esquemas keybind.schematic_flip_x.name = Girar o Esquema no eixo X diff --git a/core/assets/bundles/bundle_pt_PT.properties b/core/assets/bundles/bundle_pt_PT.properties index e1b8867ea2..bb5b84c0d8 100644 --- a/core/assets/bundles/bundle_pt_PT.properties +++ b/core/assets/bundles/bundle_pt_PT.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Selecionar região keybind.schematic_menu.name = Menu esquemático keybind.schematic_flip_x.name = Rodar esquema X diff --git a/core/assets/bundles/bundle_ro.properties b/core/assets/bundles/bundle_ro.properties index c65c4b6c3f..228a61e05e 100644 --- a/core/assets/bundles/bundle_ro.properties +++ b/core/assets/bundles/bundle_ro.properties @@ -1103,6 +1103,7 @@ keybind.mouse_move.name = Urmărește Mouseul keybind.pan.name = Mișcă Harta keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Selectează Regiunea keybind.schematic_menu.name = Meniu Scheme keybind.schematic_flip_x.name = Întoarce Schema X diff --git a/core/assets/bundles/bundle_ru.properties b/core/assets/bundles/bundle_ru.properties index 9e7aa7b678..986838171a 100644 --- a/core/assets/bundles/bundle_ru.properties +++ b/core/assets/bundles/bundle_ru.properties @@ -1102,6 +1102,7 @@ keybind.mouse_move.name = Следовать за курсором keybind.pan.name = Панорамирование камеры keybind.boost.name = Полёт/ускорение keybind.command_mode.name = Командование боевыми единицами +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Выбрать область keybind.schematic_menu.name = Меню схем keybind.schematic_flip_x.name = Отразить схему по оси X diff --git a/core/assets/bundles/bundle_sr.properties b/core/assets/bundles/bundle_sr.properties index 6b6aca310b..015fd6fb4e 100644 --- a/core/assets/bundles/bundle_sr.properties +++ b/core/assets/bundles/bundle_sr.properties @@ -1103,6 +1103,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Upravljački Mod +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Izageri Region keybind.schematic_menu.name = Menu Šema keybind.schematic_flip_x.name = Okreni Šemu X diff --git a/core/assets/bundles/bundle_sv.properties b/core/assets/bundles/bundle_sv.properties index 8ae8b20be4..13a24859a2 100644 --- a/core/assets/bundles/bundle_sv.properties +++ b/core/assets/bundles/bundle_sv.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Select Region keybind.schematic_menu.name = Schematic Menu keybind.schematic_flip_x.name = Flip Schematic X diff --git a/core/assets/bundles/bundle_th.properties b/core/assets/bundles/bundle_th.properties index 12dd3261e5..56ec13f276 100644 --- a/core/assets/bundles/bundle_th.properties +++ b/core/assets/bundles/bundle_th.properties @@ -1104,6 +1104,7 @@ keybind.mouse_move.name = ตามเม้าส์ keybind.pan.name = เคลื่อนการมองเห็น keybind.boost.name = บูสต์ keybind.command_mode.name = โหมดสั่งการ +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = เลือกพื้นที่ keybind.schematic_menu.name = เมนูแผนผัง keybind.schematic_flip_x.name = กลับด้านแผนผังแกน X diff --git a/core/assets/bundles/bundle_tk.properties b/core/assets/bundles/bundle_tk.properties index a0e47d5839..7fbb2e4e1e 100644 --- a/core/assets/bundles/bundle_tk.properties +++ b/core/assets/bundles/bundle_tk.properties @@ -1091,6 +1091,7 @@ keybind.mouse_move.name = Follow Mouse keybind.pan.name = Pan View keybind.boost.name = Boost keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Select Region keybind.schematic_menu.name = Schematic Menu keybind.schematic_flip_x.name = Flip Schematic X diff --git a/core/assets/bundles/bundle_tr.properties b/core/assets/bundles/bundle_tr.properties index 38e46cd532..413074f2e4 100644 --- a/core/assets/bundles/bundle_tr.properties +++ b/core/assets/bundles/bundle_tr.properties @@ -1103,6 +1103,7 @@ keybind.mouse_move.name = Fareyi Takip Et keybind.pan.name = Yatay Kaydırma Görünümü keybind.boost.name = Yükselt keybind.command_mode.name = Komuta Modu +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Bölge Seç keybind.schematic_menu.name = Şema Menüsü keybind.schematic_flip_x.name = Şemayı X ekseninde Döndür diff --git a/core/assets/bundles/bundle_uk_UA.properties b/core/assets/bundles/bundle_uk_UA.properties index 2954298117..3e4585a04e 100644 --- a/core/assets/bundles/bundle_uk_UA.properties +++ b/core/assets/bundles/bundle_uk_UA.properties @@ -1109,6 +1109,7 @@ keybind.mouse_move.name = Рухатися за мишею keybind.pan.name = Політ камери за мишею keybind.boost.name = Прискорення keybind.command_mode.name = Режим командування +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Вибрати ділянку keybind.schematic_menu.name = Меню схем keybind.schematic_flip_x.name = Віддзеркалити за віссю X diff --git a/core/assets/bundles/bundle_vi.properties b/core/assets/bundles/bundle_vi.properties index 853d78a18f..f202769e16 100644 --- a/core/assets/bundles/bundle_vi.properties +++ b/core/assets/bundles/bundle_vi.properties @@ -1103,6 +1103,7 @@ keybind.mouse_move.name = Theo chuột keybind.pan.name = Di chuyển góc nhìn keybind.boost.name = Tăng tốc keybind.command_mode.name = Command Mode +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = Chọn khu vực keybind.schematic_menu.name = Menu bản thiết kế keybind.schematic_flip_x.name = Lật bản thiết kế X diff --git a/core/assets/bundles/bundle_zh_CN.properties b/core/assets/bundles/bundle_zh_CN.properties index d1bcc58add..5e37063a43 100644 --- a/core/assets/bundles/bundle_zh_CN.properties +++ b/core/assets/bundles/bundle_zh_CN.properties @@ -1104,6 +1104,7 @@ keybind.mouse_move.name = 单位跟随鼠标 keybind.pan.name = 鼠标控制镜头 keybind.boost.name = 启动助推 keybind.command_mode.name = 指挥模式 +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = 框选建筑 keybind.schematic_menu.name = 蓝图目录 keybind.schematic_flip_x.name = 水平翻转 diff --git a/core/assets/bundles/bundle_zh_TW.properties b/core/assets/bundles/bundle_zh_TW.properties index f14b5358a0..57c9ce484d 100644 --- a/core/assets/bundles/bundle_zh_TW.properties +++ b/core/assets/bundles/bundle_zh_TW.properties @@ -1111,6 +1111,7 @@ keybind.mouse_move.name = 跟隨滑鼠 keybind.pan.name = 平移鏡頭 keybind.boost.name = 加速 keybind.command_mode.name = 指揮模式 +keybind.rebuild_select.name = Rebuild Region keybind.schematic_select.name = 選擇區域 keybind.schematic_menu.name = 藍圖目錄 keybind.schematic_flip_x.name = X軸翻轉 diff --git a/core/src/mindustry/graphics/BlockRenderer.java b/core/src/mindustry/graphics/BlockRenderer.java index 0208aa433d..b19c2cdac6 100644 --- a/core/src/mindustry/graphics/BlockRenderer.java +++ b/core/src/mindustry/graphics/BlockRenderer.java @@ -262,7 +262,7 @@ public class BlockRenderer{ public void drawDestroyed(){ if(!Core.settings.getBool("destroyedblocks")) return; - if(control.input.isPlacing() || control.input.isBreaking()){ + if(control.input.isPlacing() || control.input.isBreaking() || control.input.isRebuildSelecting()){ brokenFade = Mathf.lerpDelta(brokenFade, 1f, 0.1f); }else{ brokenFade = Mathf.lerpDelta(brokenFade, 0f, 0.1f); diff --git a/core/src/mindustry/input/Binding.java b/core/src/mindustry/input/Binding.java index 3ea269ead7..cc38bb570b 100644 --- a/core/src/mindustry/input/Binding.java +++ b/core/src/mindustry/input/Binding.java @@ -31,6 +31,7 @@ public enum Binding implements KeyBind{ diagonal_placement(KeyCode.controlLeft), pick(KeyCode.mouseMiddle), + rebuild_select(KeyCode.b), schematic_select(KeyCode.f), schematic_flip_x(KeyCode.z), schematic_flip_y(KeyCode.x), diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index b0451213b9..fb2449ebd5 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -12,15 +12,20 @@ import arc.scene.*; import arc.scene.ui.layout.*; import arc.util.*; import mindustry.*; +import mindustry.content.*; import mindustry.core.*; import mindustry.entities.units.*; import mindustry.game.EventType.*; import mindustry.game.*; +import mindustry.game.Teams.*; import mindustry.gen.*; import mindustry.graphics.*; +import mindustry.input.Placement.*; import mindustry.ui.*; import mindustry.world.*; +import java.util.*; + import static arc.Core.*; import static mindustry.Vars.*; import static mindustry.input.PlaceMode.*; @@ -109,10 +114,28 @@ public class DesktopInput extends InputHandler{ drawBreakSelection(selectX, selectY, cursorX, cursorY, !Core.input.keyDown(Binding.schematic_select) ? maxLength : Vars.maxSchematicSize); } - if(Core.input.keyDown(Binding.schematic_select) && !Core.scene.hasKeyboard() && mode != breaking){ - drawSelection(schemX, schemY, cursorX, cursorY, Vars.maxSchematicSize); + if(!Core.scene.hasKeyboard() && mode != breaking){ + + if(Core.input.keyDown(Binding.schematic_select)){ + drawSelection(schemX, schemY, cursorX, cursorY, Vars.maxSchematicSize); + }else if(Core.input.keyDown(Binding.rebuild_select)){ + //TODO color? + drawSelection(schemX, schemY, cursorX, cursorY, 0, Pal.sapBulletBack, Pal.sapBullet); + + NormalizeDrawResult result = Placement.normalizeDrawArea(Blocks.air, schemX, schemY, cursorX, cursorY, false, 0, 1f); + + Tmp.r1.set(result.x, result.y, result.x2 - result.x, result.y2 - result.y); + + for(BlockPlan plan : player.team().data().plans){ + Block block = content.block(plan.block); + if(block.bounds(plan.x, plan.y, Tmp.r2).overlaps(Tmp.r1)){ + drawSelected(plan.x, plan.y, content.block(plan.block), Pal.sapBullet); + } + } + } } + drawCommanded(); Draw.reset(); @@ -467,7 +490,7 @@ public class DesktopInput extends InputHandler{ player.unit().clearBuilding(); } - if(Core.input.keyTap(Binding.schematic_select) && !Core.scene.hasKeyboard() && mode != breaking){ + if((Core.input.keyTap(Binding.schematic_select) || Core.input.keyTap(Binding.rebuild_select)) && !Core.scene.hasKeyboard() && mode != breaking){ schemX = rawCursorX; schemY = rawCursorY; } @@ -485,14 +508,33 @@ public class DesktopInput extends InputHandler{ selectPlans.clear(); } - if(Core.input.keyRelease(Binding.schematic_select) && !Core.scene.hasKeyboard() && selectX == -1 && selectY == -1 && schemX != -1 && schemY != -1){ - lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); - useSchematic(lastSchematic); - if(selectPlans.isEmpty()){ - lastSchematic = null; + if( !Core.scene.hasKeyboard() && selectX == -1 && selectY == -1 && schemX != -1 && schemY != -1){ + if(Core.input.keyRelease(Binding.schematic_select)){ + lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); + useSchematic(lastSchematic); + if(selectPlans.isEmpty()){ + lastSchematic = null; + } + schemX = -1; + schemY = -1; + }else if(input.keyRelease(Binding.rebuild_select)){ + //TODO rebuild!!! + + NormalizeResult result = Placement.normalizeArea(schemX, schemY, rawCursorX, rawCursorY, rotation, false, 999999999); + Tmp.r1.set(result.x * tilesize, result.y * tilesize, (result.x2 - result.x) * tilesize, (result.y2 - result.y) * tilesize); + + Iterator broken = player.team().data().plans.iterator(); + while(broken.hasNext()){ + BlockPlan plan = broken.next(); + Block block = content.block(plan.block); + if(block.bounds(plan.x, plan.y, Tmp.r2).overlaps(Tmp.r1)){ + player.unit().addBuild(new BuildPlan(plan.x, plan.y, plan.rotation, content.block(plan.block), plan.config)); + } + } + + schemX = -1; + schemY = -1; } - schemX = -1; - schemY = -1; } if(!selectPlans.isEmpty()){ diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index f66c57ae76..a306f29e7d 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -1165,13 +1165,17 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } protected void drawSelection(int x1, int y1, int x2, int y2, int maxLength){ + drawSelection(x1, y1, x2, y2, maxLength, Pal.accentBack, Pal.accent); + } + + protected void drawSelection(int x1, int y1, int x2, int y2, int maxLength, Color col1, Color col2){ NormalizeDrawResult result = Placement.normalizeDrawArea(Blocks.air, x1, y1, x2, y2, false, maxLength, 1f); Lines.stroke(2f); - Draw.color(Pal.accentBack); + Draw.color(col1); Lines.rect(result.x, result.y - 1, result.x2 - result.x, result.y2 - result.y); - Draw.color(Pal.accent); + Draw.color(col2); Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y); } @@ -1486,6 +1490,10 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ return false; } + public boolean isRebuildSelecting(){ + return input.keyDown(Binding.rebuild_select); + } + public float mouseAngle(float x, float y){ return Core.input.mouseWorld(getMouseX(), getMouseY()).sub(x, y).angle(); } diff --git a/core/src/mindustry/input/PlaceMode.java b/core/src/mindustry/input/PlaceMode.java index 1c2d0d6ce2..84bab76248 100644 --- a/core/src/mindustry/input/PlaceMode.java +++ b/core/src/mindustry/input/PlaceMode.java @@ -1,5 +1,5 @@ package mindustry.input; public enum PlaceMode{ - none, breaking, placing, schematicSelect + none, breaking, placing, schematicSelect, rebuildSelect } diff --git a/core/src/mindustry/input/Placement.java b/core/src/mindustry/input/Placement.java index bb87739a71..2bac4db62b 100644 --- a/core/src/mindustry/input/Placement.java +++ b/core/src/mindustry/input/Placement.java @@ -376,12 +376,14 @@ public class Placement{ } } - if(Math.abs(endx - tilex) > maxLength){ - endx = Mathf.sign(endx - tilex) * maxLength + tilex; - } + if(maxLength > 0){ + if(Math.abs(endx - tilex) > maxLength){ + endx = Mathf.sign(endx - tilex) * maxLength + tilex; + } - if(Math.abs(endy - tiley) > maxLength){ - endy = Mathf.sign(endy - tiley) * maxLength + tiley; + if(Math.abs(endy - tiley) > maxLength){ + endy = Mathf.sign(endy - tiley) * maxLength + tiley; + } } int dx = endx - tilex, dy = endy - tiley;