Merge pull request #15 from Timmeey86/baltitenger

Baltitenger
This commit is contained in:
Baltazár Radics
2018-12-15 09:11:14 +01:00
committed by GitHub
35 changed files with 393 additions and 328 deletions

View File

@@ -107,8 +107,6 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor{
ClassEntry clas = new ClassEntry(callLocation); ClassEntry clas = new ClassEntry(callLocation);
classMap.put(callLocation, clas); classMap.put(callLocation, clas);
classes.add(clas); classes.add(clas);
Utils.messager.printMessage(Kind.NOTE, "Generating class '" + clas.name + "'.");
} }
ClassEntry entry = classMap.get(callLocation); ClassEntry entry = classMap.get(callLocation);

View File

@@ -45,6 +45,7 @@ public class SerializeAnnotationProcessor extends AbstractProcessor{
Set<TypeElement> elements = ElementFilter.typesIn(roundEnv.getElementsAnnotatedWith(Serialize.class)); Set<TypeElement> elements = ElementFilter.typesIn(roundEnv.getElementsAnnotatedWith(Serialize.class));
TypeSpec.Builder classBuilder = TypeSpec.classBuilder(className).addModifiers(Modifier.PUBLIC); TypeSpec.Builder classBuilder = TypeSpec.classBuilder(className).addModifiers(Modifier.PUBLIC);
classBuilder.addAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "\"unchecked\"").build());
MethodSpec.Builder method = MethodSpec.methodBuilder("init").addModifiers(Modifier.PUBLIC, Modifier.STATIC); MethodSpec.Builder method = MethodSpec.methodBuilder("init").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
for(TypeElement elem : elements){ for(TypeElement elem : elements){

View File

@@ -7,7 +7,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies{ dependencies{
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0' classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.5'
classpath "com.badlogicgames.gdx:gdx-tools:1.9.9" classpath "com.badlogicgames.gdx:gdx-tools:1.9.9"
} }
} }
@@ -24,7 +24,7 @@ allprojects {
appName = 'Mindustry' appName = 'Mindustry'
gdxVersion = '1.9.9' gdxVersion = '1.9.9'
roboVMVersion = '2.3.0' roboVMVersion = '2.3.0'
uCoreVersion = '5871d2d0385370bc937fed3e5e301d6962a50476' uCoreVersion = '7ffeb2a9c754f4d31ca13e02dd857876b0707dc5'
getVersionString = { getVersionString = {
String buildVersion = getBuildVersion() String buildVersion = getBuildVersion()
@@ -139,7 +139,9 @@ project(":ios") {
} }
build.dependsOn(incrementConfig) build.dependsOn(incrementConfig)
if(file('robovm.properties').exists()){
build.dependsOn(copyGen) build.dependsOn(copyGen)
}
dependencies{ dependencies{
compile project(":core") compile project(":core")
@@ -150,7 +152,6 @@ project(":ios") {
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion" compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios" compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
//compileOnly project(":annotations")
} }
} }

View File

@@ -384,6 +384,8 @@ category.multiplayer.name = Multiplayer
command.attack = Attack command.attack = Attack
command.retreat = Retreat command.retreat = Retreat
command.patrol = Patrol command.patrol = Patrol
keybind.gridMode.name = Block Select
keybind.gridModeShift.name = Category Select
keybind.press = Press a key... keybind.press = Press a key...
keybind.press.axis = Press an axis or key... keybind.press.axis = Press an axis or key...
keybind.screenshot.name = Map Screenshot keybind.screenshot.name = Map Screenshot
@@ -406,7 +408,7 @@ keybind.toggle_menus.name = Toggle menus
keybind.chat_history_prev.name = Chat history prev keybind.chat_history_prev.name = Chat history prev
keybind.chat_history_next.name = Chat history next keybind.chat_history_next.name = Chat history next
keybind.chat_scroll.name = Chat scroll keybind.chat_scroll.name = Chat scroll
keybind.drop_unit.name = drop unit keybind.drop_unit.name = Drop Unit
keybind.zoom_minimap.name = Zoom minimap keybind.zoom_minimap.name = Zoom minimap
mode.text.help.title = Description of modes mode.text.help.title = Description of modes
mode.waves.name = Waves mode.waves.name = Waves

View File

@@ -1,4 +1,4 @@
text.credits.text = Создатель [ROYAL] Anuken. - [SKY]anukendev@gmail.com[][]\n\nЕсть недоработки в переводе?\nПишите в офф. discord-сервер mindustry в канал #русский.\n\nПереводчики на русский язык:\n[YELLOW]Prosta4ok_ua\n[GREEN]xga\n[BLACK]XZimur text.credits.text = Создатель [ROYAL] Anuken. - [SKY]anukendev@gmail.com[][]\n\nЕсть недоработки в переводе?\nПишите в офф. discord-сервер mindustry в канал #русский.\n\nПереводчики на русский язык:\n[YELLOW]Prosta4ok_ua\n[GREEN]xga\n[BLACK]XZimur\n[BLUE]Beryllium
text.credits = Авторы text.credits = Авторы
text.contributors = Переводчики и контрибьюторы text.contributors = Переводчики и контрибьюторы
text.discord = Присоединяйтесь к нашему Discord! text.discord = Присоединяйтесь к нашему Discord!
@@ -23,9 +23,9 @@ text.level.select = Выбор карты
text.level.mode = Режим игры: text.level.mode = Режим игры:
text.construction.desktop = Чтобы отменить выбор блока или остановить строительство, [accent] используйте пробел[]. text.construction.desktop = Чтобы отменить выбор блока или остановить строительство, [accent] используйте пробел[].
text.construction.title = Руководство по размещению блоков text.construction.title = Руководство по размещению блоков
text.construction = Вы только что перешли в режим размещения[accent]блоков[].\n\nЧтобы начать размещение, просто коснитесь подходящего места рядом с вашим мехом.\nПосле того, как вы поставили несколько блоков, нажмите на галочку, чтобы подтвердить, и ваш мех начнет их строительство.\n\n- [accent]Удалите блоки [] из вашего плана строительства, нажав на них.n- [accent]Нажав Shift [] и, удерживая, перетащите любой выбранный блок.\n- [accent]Поместите блоки в линию [], нажимая и удерживая на пустое место, а затем перетаскивая в любом направлении.\n- [accent]Отмените размещение блоков [], нажав X в левом нижнем углу. text.construction = Вы только что перешли в режим размещения[accent]блоков[].\n\nЧтобы начать размещение, просто коснитесь подходящего места рядом с вашим мехом.\nПосле того, как вы поставили несколько блоков, нажмите на галочку, чтобы подтвердить, и ваш мех начнет их строительство.\n\n- [accent]Удалите блоки [] из вашего плана строительства, нажав на них.n- [accent]Нажав Shift [] и, удерживая, перетащите любой выбранный блок.\n- [accent]Поместите блоки в линию [], нажимая и удерживая на пустое место, а затем перетаскивая в любом направлении.\n- [accent]Отмените размещение блоков [], нажав X в нижнем правом углу.
text.deconstruction.title = Руководство по разрушению блоков text.deconstruction.title = Руководство по разрушению блоков
text.deconstruction = Вы только что перешли в режим сноса[accent] блоков.[].\n\nЧтобы начать удалять, просто нажмите на блок рядом с вашим мехом.\nПосле того как вы выбрали несколько блоков, нажмите на галочку, чтобы подтвердить, и ваш мех начнёт их сносить.\n\n- [accent]Уберите блоки [] из вашего выбора, нажав на них.\n- [accent]Удалите блоки в области [], нажав и удерживая на пустом месте, а затем перетаскивая в нужном направлении.\n- [accent]Отменить снос или выбор [] можно нажав X в левом нижнем углу. text.deconstruction = Вы только что перешли в режим сноса[accent] блоков.[].\n\nЧтобы начать удалять, просто нажмите на блок рядом с вашим мехом.\nПосле того как вы выбрали несколько блоков, нажмите на галочку, чтобы подтвердить, и ваш мех начнёт их сносить.\n\n- [accent]Уберите блоки [] из вашего выбора, нажав на них.\n- [accent]Удалите блоки в области [], нажав и удерживая на пустом месте, а затем перетаскивая в нужном направлении.\n- [accent]Отменить снос или выбор [] можно нажав X в нижнем правом углу.
text.showagain = Не показывать снова до следующей сессии text.showagain = Не показывать снова до следующей сессии
text.coreattack = < Ядро находится под атакой! > text.coreattack = < Ядро находится под атакой! >
text.unlocks = Разблокированные text.unlocks = Разблокированные
@@ -39,13 +39,13 @@ text.sector = Выбранный сектор: [LIGHT_GRAY]{0}
text.sector.time = Время: [LIGHT_GRAY]{0} text.sector.time = Время: [LIGHT_GRAY]{0}
text.sector.deploy = Высадиться text.sector.deploy = Высадиться
text.sector.abandon = Отступить text.sector.abandon = Отступить
text.sector.abandon.confirm = Вы уверены, что хотите отступить?\nЭто не может быть отменено! text.sector.abandon.confirm = Вы уверены, что хотите отступить?\nПрогресс на секторе нельзя восстановить!
text.sector.resume = Продолжить text.sector.resume = Продолжить
text.sector.locked = [scarlet][[Не завершён] text.sector.locked = [scarlet][[Не завершён]
text.sector.unexplored = [accent][[Неисследованный] text.sector.unexplored = [accent][[Неисследованный]
text.missions = Миссий:[LIGHT_GRAY] {0} text.missions = Миссий:[LIGHT_GRAY] {0}
text.mission = Миссия:[LIGHT_GRAY] {0} text.mission = Миссия:[LIGHT_GRAY] {0}
text.mission.main = Главная мисия:[LIGHT_GRAY] {0} text.mission.main = Главная миссия:[LIGHT_GRAY] {0}
text.mission.info = Информация о миссии text.mission.info = Информация о миссии
text.mission.complete = Миссия выполнена! text.mission.complete = Миссия выполнена!
text.mission.complete.body = Сектор {0},{1} был завоёван. text.mission.complete.body = Сектор {0},{1} был завоёван.
@@ -430,12 +430,12 @@ item.titanium.name = Титан
item.titanium.description = Редкий сверхлёгкий металл широко используется в производстве: транспорта, буров и самолётов. item.titanium.description = Редкий сверхлёгкий металл широко используется в производстве: транспорта, буров и самолётов.
item.thorium.name = Торий item.thorium.name = Торий
item.thorium.description = Плотный радиоактивный металл используется в качестве структурной поддержки и ядерного топлива. item.thorium.description = Плотный радиоактивный металл используется в качестве структурной поддержки и ядерного топлива.
item.silicon.name = Кремень item.silicon.name = Кремний
item.silicon.description = Очень полезный полупроводник с применениями в солнечных батареях и множестве сложной электроники. item.silicon.description = Очень полезный полупроводник с применениями в солнечных батареях и множестве сложной электроники.
item.plastanium.name = Пластиний item.plastanium.name = Пластиний
item.plastanium.description = Легкий, пластичный материал, используемый в современных самолетах и боеприпасах для фрагментации. item.plastanium.description = Легкий, пластичный материал, используемый в современных самолетах и боеприпасах для фрагментации.
item.phase-fabric.name = Фазовая ткань item.phase-fabric.name = Фазовая ткань
item.phase-fabric.description = Невесомое вещество, используемое в современной электронике и технологии самовосстановления. Непригодна для вышивания. item.phase-fabric.description = Невесомое вещество, используемое в современной электронике и технологии самовосстановления. Не для вышивания.
item.surge-alloy.name = Высокопрочный сплав item.surge-alloy.name = Высокопрочный сплав
item.surge-alloy.description = Передовой сплав с уникальными электрическими свойствами. item.surge-alloy.description = Передовой сплав с уникальными электрическими свойствами.
item.biomatter.name = Биоматерия item.biomatter.name = Биоматерия
@@ -463,7 +463,7 @@ mech.tau-mech.weapon = Восстановительный лазер
mech.tau-mech.ability = Регенирирующая вспышка mech.tau-mech.ability = Регенирирующая вспышка
mech.tau-mech.description = Мех поддержки. Чинит союзные блоки, стреляя в них. Может исцелить союзников радиусом с его способностью восстанавления. mech.tau-mech.description = Мех поддержки. Чинит союзные блоки, стреляя в них. Может исцелить союзников радиусом с его способностью восстанавления.
mech.omega-mech.name = Омега mech.omega-mech.name = Омега
mech.omega-mech.weapon = Ракетомётный пулемётконфигурация mech.omega-mech.weapon = Ракетомётный пулемёт
mech.omega-mech.ability = Защитная mech.omega-mech.ability = Защитная
mech.omega-mech.description = Громоздкий и хорошо бронированный мех, сделанный для фронтовых нападений. Его способность брони может блокировать до 90% входящего урона. mech.omega-mech.description = Громоздкий и хорошо бронированный мех, сделанный для фронтовых нападений. Его способность брони может блокировать до 90% входящего урона.
mech.dart-ship.name = Дротик mech.dart-ship.name = Дротик
@@ -655,7 +655,7 @@ tutorial.conveyor = [accent]Конвейеры[] используются для
tutorial.morecopper = Требуется больше меди.\n\nЛибо добудьте её вручную, либо разместите больше буров. tutorial.morecopper = Требуется больше меди.\n\nЛибо добудьте её вручную, либо разместите больше буров.
tutorial.turret = Оборонительные сооружения должны быть созданы, чтобы отразить[LIGHT_GRAY] атаку противника[].Постройте двойную турель рядом с вашей базой. tutorial.turret = Оборонительные сооружения должны быть созданы, чтобы отразить[LIGHT_GRAY] атаку противника[].Постройте двойную турель рядом с вашей базой.
tutorial.drillturret = Двойные турели требуют[accent] патронов из меди[] для стрельбы.\nРазместите бур рядом с турелью, чтобы снабдить её добытой медью. tutorial.drillturret = Двойные турели требуют[accent] патронов из меди[] для стрельбы.\nРазместите бур рядом с турелью, чтобы снабдить её добытой медью.
tutorial.waves = [LIGHT_GRAY]Враг[] приближается.\n\nЗащитите своё ядро от 2-ух волн. Вам может понадобится больше турелей. tutorial.waves = [LIGHT_GRAY]Враг[] приближается.\n\nЗащитите своё ядро от двух волн. Вам может понадобится больше турелей.
tutorial.lead = Осмотритесь! Магическим образом появились новые руды. Добудьте [accent] свинец[].\n\nПеретащите ресурс из своего устройства(юнита) в ядро для переноса ресурсов. tutorial.lead = Осмотритесь! Магическим образом появились новые руды. Добудьте [accent] свинец[].\n\nПеретащите ресурс из своего устройства(юнита) в ядро для переноса ресурсов.
tutorial.smelter = Медь и свинец являются мягкими металлами.\nПревосходный[accent] плотный сплав[] может быть создан в плавильном заводе.\n\nПостройте один плавильный завод. tutorial.smelter = Медь и свинец являются мягкими металлами.\nПревосходный[accent] плотный сплав[] может быть создан в плавильном заводе.\n\nПостройте один плавильный завод.
tutorial.densealloy = Теперь плавильный завод производит плотный сплав.\nСоздайте немного.\nУлучшите производство, если это необходимо. tutorial.densealloy = Теперь плавильный завод производит плотный сплав.\nСоздайте немного.\nУлучшите производство, если это необходимо.
@@ -664,7 +664,7 @@ tutorial.silicondrill = Для производства кремния треб
tutorial.generator = Эта технология требует энергии.\nПостройте [accent] генератор внутреннего сгорания[] для того, чтобы запитать устройство энергией. tutorial.generator = Эта технология требует энергии.\nПостройте [accent] генератор внутреннего сгорания[] для того, чтобы запитать устройство энергией.
tutorial.generatordrill = Генератор внутреннего сгорания нуждается в топливе.\nЗаправьте его углём. tutorial.generatordrill = Генератор внутреннего сгорания нуждается в топливе.\nЗаправьте его углём.
tutorial.node = Энергия требует транспортировки.\nСоздайте [accent] силовой узел[] рядом с генератором внутреннего сгорания для передачи энергии. tutorial.node = Энергия требует транспортировки.\nСоздайте [accent] силовой узел[] рядом с генератором внутреннего сгорания для передачи энергии.
tutorial.nodelink = Энергия может быть передана посредством соприкосновения блоков питания и генераторов или связанных силовых узлов.\n\nСоедините их энергией, нажав на силовой узел и выбрав генератор, а затем кремниевый завод. tutorial.nodelink = Энергия может быть передана посредством соприкосновения блоков питания и генераторов или связанных силовых узлов.\n\nСоедините их, нажав на силовой узел и выбрав генератор, а затем кремниевый завод.
tutorial.silicon = Производство кремния началось. Получите немного.\nРекомендуется улучшить эту систему. tutorial.silicon = Производство кремния началось. Получите немного.\nРекомендуется улучшить эту систему.
tutorial.daggerfactory = Постройте[accent] завод по производству "разведчиков".[]\n\nОн будет производить атакуюших мехов. tutorial.daggerfactory = Постройте[accent] завод по производству "разведчиков".[]\n\nОн будет производить атакуюших мехов.
tutorial.router = Заводы нуждаются в ресурсах для работы.\nСоздайте маршрутизатор для разделения ресурсов конвейера. tutorial.router = Заводы нуждаются в ресурсах для работы.\nСоздайте маршрутизатор для разделения ресурсов конвейера.
@@ -773,8 +773,8 @@ block.bridge-conveyor.description = Улучшенный транспортны
block.alpha-mech-pad.description = Превращает вас в мех [accent] Альфа[]. Требует энергию. block.alpha-mech-pad.description = Превращает вас в мех [accent] Альфа[]. Требует энергию.
block.itemsource.description = Бесконечно выводит предметы. Работает только в песочнице. block.itemsource.description = Бесконечно выводит предметы. Работает только в песочнице.
block.liquidsource.description = Бесконечно выводит жидкости. Работает только в песочнице. block.liquidsource.description = Бесконечно выводит жидкости. Работает только в песочнице.
block.itemvoid.description = Уничтожает любые предметы, которые входят в него, без использования энергии. Работает только в песочнице. block.itemvoid.description = Уничтожает любые предметы, которые входят в него, без использования энергии. Работает только в режиме песочницы.
block.powerinfinite.description = Бесконечность — не предел. Бесконечно выводит энергию. Доступен только в песочнице. block.powerinfinite.description = Бесконечность — не предел. Бесконечно выводит энергию. Доступен только в режиме песочницы.
block.powervoid.description = Энергия просто уходит в пустоту. Присутствует только в песочнице. block.powervoid.description = Энергия просто уходит в пустоту. Присутствует только в песочнице.
liquid.water.description = Намного лучше чем [BLUE]монооксид дигидрогена[].\n\n Для получения воды используйте помпу(насос) на источнике(блоке) или экстрактор воды.\n\n Эту жидкость можно подвести к бурам для ускорения скорости добычи или к турелям для ускорения стрельбы. liquid.water.description = Намного лучше чем [BLUE]монооксид дигидрогена[].\n\n Для получения воды используйте помпу(насос) на источнике(блоке) или экстрактор воды.\n\n Эту жидкость можно подвести к бурам для ускорения скорости добычи или к турелям для ускорения стрельбы.
liquid.lava.description = [accent]Горячо...\nВещество расплавленное из горно-каменных пород. liquid.lava.description = [accent]Горячо...\nВещество расплавленное из горно-каменных пород.

View File

@@ -8,67 +8,69 @@ text.link.trello.description = Planlanan özellikler için resmi Trello Bülteni
text.link.itch.io.description = PC yüklemeleri ve web sürümü ile itch.io sayfası text.link.itch.io.description = PC yüklemeleri ve web sürümü ile itch.io sayfası
text.link.google-play.description = Google Play mağaza sayfası text.link.google-play.description = Google Play mağaza sayfası
text.link.wiki.description = Resmi Mindustry Wikipedi'si text.link.wiki.description = Resmi Mindustry Wikipedi'si
text.linkfail = Bağlantıılamadı! URL, yazı tahtanıza kopyalandı. text.linkfail = Bağlantıılamadı\! URL, yazı tahtanıza kopyalandı.
text.editor.web = Web sürümü editörü desteklemiyor\! Editörü kullanmak için oyunu indirin.
text.web.unsupported = Site versiyonu bunu desteklemiyor\! Oyunu indirip dene.
text.gameover = Çekirdek yok edildi. text.gameover = Çekirdek yok edildi.
text.gameover.pvp = The[accent] {0}[] team is victorious! text.gameover.pvp = [accent] {0}[] takimi kazandi \!
text.sector.gameover = This sector has been lost. Re-deploy? text.sector.gameover = Sektor kaybedildi.
text.sector.retry = Retry text.sector.retry = Tekrar dene
text.highscore = [SARI] Yeni yüksek puan! text.highscore = [SARI] Yeni yüksek puan\!
text.wave.lasted = You lasted until wave [accent]{0}[]. text.wave.lasted = Su dalgaya kadar yasadin: [accent]{0}[].
text.level.highscore = Yüksek Puan: [accent] {0} text.level.highscore = Yüksek Puan\: [accent] {0}
text.level.delete.title = Silmeyi onaylayın text.level.delete.title = Silmeyi onaylayın
text.map.delete = Are you sure you want to delete the map "[accent]{0}[]"? text.map.delete = Su haritayi silmek istedigine emin misin? "[orange]{0}[]"?
text.level.select = Seviye Seç text.level.select = Seviye Seç
text.level.mode = Oyun Modu text.level.mode = Oyun Modu
text.construction.desktop = Desktop controls have been changed.\nTo deselect a block or stop building, [accent]use space[]. text.construction.desktop = Masaustu kontrolleri degisti.\nSecmeyi birakip yapmayi kesmek icin, [accent]bosluga bas[].
text.construction.title = Block Construction Guide text.construction.title = Blok Yapma Ogreticisi
text.construction = You've just selected [accent]block construction mode[].\n\nTo begin placing, simply tap a valid location near your ship.\nOnce you have selected some blocks, press the checkbox to confirm, and your ship will begin constructing them.\n\n- [accent]Remove blocks[] from your selection by tapping them.\n- [accent]Shift the selection[] by holding and dragging any block in the selection.\n- [accent]Place blocks in a line[] by tapping and holding an empty spot, then dragging in a direction.\n- [accent]Cancel construction or selection[] by pressing the X at the bottom left. text.construction = Sen su anda [accent]blok yapma moduna gectin[].\n\nYapmaya baslamak icin, geminin cevresinde uygun bir yere tikla.\nBiraz blok sectikten sonra, onaylamak icin "tik" tusuna bas, ve gemin onlari yapmaya baslayacaktir.\n\n- [accent]Blok kaldirmak[] icin onlari secme yerine gene tikla\n- [accent]Blok secmek icin[] onlara secme yerinde tikla.\n- [accent]Cizgi biciminde koymak icin[] bos bir yere bas, ve bir yere dogru surukle.\n- [accent]Yapma modundan cikmak icin[] alt kosedeki X tusuna bas
text.deconstruction.title = Block Deconstruction Guide text.deconstruction.title = Blok Yikim Ogreticisi
text.deconstruction = You've just selected [accent]block deconstruction mode[].\n\nTo begin breaking, simply tap a block near your ship.\nOnce you have selected some blocks, press the checkbox to confirm, and your ship will begin de-constructing them.\n\n- [accent]Remove blocks[] from your selection by tapping them.\n- [accent]Remove blocks in an area[] by tapping and holding an empty spot, then dragging in a direction.\n- [accent]Cancel deconstruction or selection[] by pressing the X at the bottom left. text.deconstruction = Sen su anda [accent]blok yikim moduna gectin[].\n\nKirmaya baslamak icin, geminin cevresinde bir bloga tikla\nBiraz blok sectikten sonra, "tik" tusuna basarak onayla, ve gemin onlari yikmaya baslayacaktir.\n\n- [accent]Blok kaldirmak[] icin onlari secme yerine gene tikla\n- [accent]Bir alanin icinde blok kirmak icin[] bos bir yere tikla, ve surukle\n- [accent]Yikma modundan cikmak icin[] Kosedeki X tusuna bas
text.showagain = Don't show again next session text.showagain = Bunu gene gosterme
text.coreattack = < Core is under attack! > text.coreattack = < Cekirdek saldiri altinda\! >
text.unlocks = Unlocks text.unlocks = Koleksiyon
text.savegame = Oyunu Kaydet text.savegame = Oyunu Kaydet
text.loadgame = Oyunu yükle text.loadgame = Oyunu yükle
text.joingame = Oyuna katıl text.joingame = Oyuna katıl
text.addplayers = Add/Remove Players text.addplayers = Oyuncu ekle/cikar
text.customgame = Custom Game text.customgame = Ozel oyun
text.sectors = Sectors text.sectors = Sektorler
text.sector = Selected Sector: [LIGHT_GRAY]{0} text.sector = Su sektoru sectin\: [LIGHT_GRAY]{0}
text.sector.time = Time: [LIGHT_GRAY]{0} text.sector.time = Zaman\: [LIGHT_GRAY]{0}
text.sector.deploy = Deploy text.sector.deploy = Basla
text.sector.abandon = Abandon text.sector.abandon = Terk et
text.sector.abandon.confirm = Are you sure you want to abandon all progress at this sector?\nThis cannot be undone! text.sector.abandon.confirm = Buradaki ilerlemeni silmek istedigine emin misin\nBu geri alinamaz\!
text.sector.resume = Resume text.sector.resume = Devam et
text.sector.locked = [scarlet][[Incomplete] text.sector.locked = [scarlet][[Bitirilmedi]
text.sector.unexplored = [accent][[Unexplored] text.sector.unexplored = [accent][[Kesvedilmedş]
text.missions = Missions:[LIGHT_GRAY] {0} text.missions = Gorevler\:[LIGHT_GRAY] {0}
text.mission = Mission:[LIGHT_GRAY] {0} text.mission = Gorev\:[LIGHT_GRAY] {0}
text.mission.main = Main Mission:[LIGHT_GRAY] {0} text.mission.main = Ana gorev\:[LIGHT_GRAY] {0}
text.mission.info = Mission Info text.mission.info = Gorev bilgisi
text.mission.complete = Mission complete! text.mission.complete = Gorev tamamlandi\!
text.mission.complete.body = Sector {0},{1} has been conquered. text.mission.complete.body = Sektor {0},{1} ele gecirildi
text.mission.wave = Survive[accent] {0}/{1} []waves\nWave in {2} text.mission.wave = [accent]{0}[] dalga hayatta kal
text.mission.wave.enemies = Survive[accent] {0}/{1} []waves\n{2} Enemies text.mission.wave.enemies = [accent] {0}/{1} []dalga hayatta kal\n{2} Dusman oldur
text.mission.wave.enemy = Survive[accent] {0}/{1} []waves\n{2} Enemy text.mission.wave.enemy = [accent] {0}/{1} []dalga hayatta kal\n{2} Dusman oldur
text.mission.wave.menu = Survive[accent] {0} []waves text.mission.wave.menu = [accent] {0} []dalga hayatta kal
text.mission.battle = Destroy the enemy base. text.mission.battle = Dusman temelini yok et
text.mission.resource.menu = Obtain {0} x{1} text.mission.resource.menu = Sunlari ele gecir {0} x{1}
text.mission.resource = Obtain {0}:\n[accent]{1}/{2}[] text.mission.resource = Sunlari ele gecir {0}\:\n[accent]{1}/{2}[]
text.mission.block = Create {0} text.mission.block = Su kadar yarat {0}
text.mission.unit = Create {0} Unit text.mission.unit = {0} Kadar unit yarat
text.mission.command = Send Command {0} To Units text.mission.command = {0} Unite komut yolla
text.mission.linknode = Link Power Node text.mission.linknode = Guc nodu bagla
text.mission.display = [accent]Mission:\n[LIGHT_GRAY]{0} text.mission.display = [accent]Gorev\:\n[LIGHT_GRAY]{0}
text.mission.mech = Switch to mech[accent] {0}[] text.mission.mech = Su gemiye degis[accent] {0}[]
text.mission.create = Create[accent] {0}[] text.mission.create = Su kadar yarat[accent] {0}[]
text.none = <none> text.none = <none>
text.close = Close text.close = Kapat
text.quit = Çık text.quit = Çık
text.maps = Maps text.maps = Haritalar
text.continue = Continue text.continue = Devam et
text.nextmission = Next Mission text.nextmission = Siradaki gorev
text.maps.none = [LIGHT_GRAY]No maps found! text.maps.none = [LIGHT_GRAY]Harita bulunamadi\!
text.about.button = Hakkında text.about.button = Hakkında
text.name = Adı: text.name = Adı:
text.filename = File Name: text.filename = File Name:

View File

@@ -26,7 +26,7 @@ TextButtonStyle: {
default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: gray, down: button-down, up: button}, default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: gray, down: button-down, up: button},
right: {over: button-right-over, font: default-font, fontColor: white, disabledFontColor: gray, down: button-right-down, up: button-right}, right: {over: button-right-over, font: default-font, fontColor: white, disabledFontColor: gray, down: button-right-down, up: button-right},
wave: {font: default-font, fontColor: white, disabledFontColor: gray, up: button-edge-4}, wave: {font: default-font, fontColor: white, disabledFontColor: gray, up: button-edge-4},
clear: {over: flat-over, font: default-font, fontColor: white, disabledFontColor: gray, down: pane, up: flat}, clear: {over: flat-over, font: default-font, fontColor: white, disabledFontColor: gray, down: flat-over, up: flat},
discord: {font: default-font, fontColor: white, up: discord-banner}, discord: {font: default-font, fontColor: white, up: discord-banner},
info: {font: default-font, fontColor: white, up: info-banner}, info: {font: default-font, fontColor: white, up: info-banner},
clear-partial: {down: white, up: button-select, over: flat-down, font: default-font, fontColor: white, disabledFontColor: gray }, clear-partial: {down: white, up: button-select, over: flat-down, font: default-font, fontColor: white, disabledFontColor: gray },

View File

@@ -2,3 +2,7 @@ apply plugin: "java"
sourceCompatibility = 1.8 sourceCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets.main.java.srcDirs = ["src/"] sourceSets.main.java.srcDirs = ["src/"]
compileJava{
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}

View File

@@ -16,7 +16,8 @@ import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Mathf;
public class Blocks extends BlockList implements ContentList{ public class Blocks extends BlockList implements ContentList{
public static Block air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone, blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock; public static Block air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone,
blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock;
@Override @Override
@@ -90,6 +91,7 @@ public class Blocks extends BlockList implements ContentList{
}}; }};
lava = new Floor("lava"){{ lava = new Floor("lava"){{
drownTime = 100f;
liquidColor = Color.valueOf("ed5334"); liquidColor = Color.valueOf("ed5334");
speedMultiplier = 0.2f; speedMultiplier = 0.2f;
damageTaken = 0.5f; damageTaken = 0.5f;
@@ -103,6 +105,7 @@ public class Blocks extends BlockList implements ContentList{
}}; }};
tar = new Floor("tar"){{ tar = new Floor("tar"){{
drownTime = 150f;
liquidColor = Color.valueOf("292929"); liquidColor = Color.valueOf("292929");
status = StatusEffects.tarred; status = StatusEffects.tarred;
statusIntensity = 1f; statusIntensity = 1f;

View File

@@ -59,12 +59,12 @@ public class PowerBlocks extends BlockList implements ContentList{
}}; }};
battery = new Battery("battery"){{ battery = new Battery("battery"){{
consumes.powerBuffered(320f, 120f); consumes.powerBuffered(320f, 1f);
}}; }};
batteryLarge = new Battery("battery-large"){{ batteryLarge = new Battery("battery-large"){{
size = 3; size = 3;
consumes.powerBuffered(2000f, 600f); consumes.powerBuffered(2000f, 1f);
}}; }};
powerNode = new PowerNode("power-node"){{ powerNode = new PowerNode("power-node"){{

View File

@@ -1,10 +1,7 @@
package io.anuke.mindustry.core; package io.anuke.mindustry.core;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.TimeUtils;
import io.anuke.mindustry.content.Mechs; import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
@@ -42,9 +39,6 @@ import static io.anuke.mindustry.Vars.*;
* This class is not created in the headless server. * This class is not created in the headless server.
*/ */
public class Control extends Module{ public class Control extends Module{
/** Minimum period of time between the same sound being played.*/
private static final long minSoundPeriod = 100;
public final Saves saves; public final Saves saves;
public final Unlocks unlocks; public final Unlocks unlocks;
@@ -52,7 +46,6 @@ public class Control extends Module{
private boolean hiscore = false; private boolean hiscore = false;
private boolean wasPaused = false; private boolean wasPaused = false;
private InputHandler[] inputs = {}; private InputHandler[] inputs = {};
private ObjectMap<Sound, Long> soundMap = new ObjectMap<>();
private Throwable error; private Throwable error;
public Control(){ public Control(){
@@ -72,17 +65,6 @@ public class Control extends Module{
unlocks.load(); unlocks.load();
Sounds.setFalloff(9000f);
Sounds.setPlayer((sound, volume) -> {
long time = TimeUtils.millis();
long value = soundMap.get(sound, 0L);
if(TimeUtils.timeSinceMillis(value) >= minSoundPeriod){
threads.runGraphics(() -> sound.play(volume));
soundMap.put(sound, time);
}
});
DefaultKeybinds.load(); DefaultKeybinds.load();
Settings.defaultList( Settings.defaultList(

View File

@@ -40,7 +40,6 @@ import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings; import io.anuke.ucore.util.Strings;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
@@ -96,9 +95,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
t.addImageTextButton("$text.editor.import", "icon-load-map", isize, () -> t.addImageTextButton("$text.editor.import", "icon-load-map", isize, () ->
createDialog("$text.editor.import", createDialog("$text.editor.import",
"$text.editor.importmap", "$text.editor.importmap.description", "icon-load-map", (Runnable) loadDialog::show, "$text.editor.importmap", "$text.editor.importmap.description", "icon-load-map", (Runnable) loadDialog::show,
"$text.editor.importfile", "$text.editor.importfile.description", "icon-file", (Runnable) () -> { "$text.editor.importfile", "$text.editor.importfile.description", "icon-file", (Runnable) () ->
Platform.instance.showFileChooser("$text.loadimage", "Map Files", file -> { Platform.instance.showFileChooser("$text.loadimage", "Map Files", file -> ui.loadGraphics(() -> {
ui.loadGraphics(() -> {
try{ try{
DataInputStream stream = new DataInputStream(file.read()); DataInputStream stream = new DataInputStream(file.read());
@@ -111,11 +109,10 @@ public class MapEditorDialog extends Dialog implements Disposable{
ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false))); ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false)));
Log.err(e); Log.err(e);
} }
}); }), true, mapExtension),
}, true, mapExtension);
}, "$text.editor.importimage", "$text.editor.importimage.description", "icon-file-image", (Runnable)() ->
"$text.editor.importimage", "$text.editor.importimage.description", "icon-file-image", (Runnable)() -> { Platform.instance.showFileChooser("$text.loadimage", "Image Files", file ->
Platform.instance.showFileChooser("$text.loadimage", "Image Files", file -> {
ui.loadGraphics(() -> { ui.loadGraphics(() -> {
try{ try{
MapTileData data = MapIO.readLegacyPixmap(new Pixmap(file)); MapTileData data = MapIO.readLegacyPixmap(new Pixmap(file));
@@ -126,12 +123,11 @@ public class MapEditorDialog extends Dialog implements Disposable{
ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false))); ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false)));
Log.err(e); Log.err(e);
} }
}); }), true, "png")
}, true, "png"); ));
}));
t.addImageTextButton("$text.editor.export", "icon-save-map", isize, () -> createDialog("$text.editor.export", t.addImageTextButton("$text.editor.export", "icon-save-map", isize, () -> createDialog("$text.editor.export",
"$text.editor.exportfile", "$text.editor.exportfile.description", "icon-file", (Runnable) () -> { "$text.editor.exportfile", "$text.editor.exportfile.description", "icon-file", (Runnable) () ->
Platform.instance.showFileChooser("$text.saveimage", "Map Files", file -> { Platform.instance.showFileChooser("$text.saveimage", "Map Files", file -> {
file = file.parent().child(file.nameWithoutExtension() + "." + mapExtension); file = file.parent().child(file.nameWithoutExtension() + "." + mapExtension);
FileHandle result = file; FileHandle result = file;
@@ -147,8 +143,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
Log.err(e); Log.err(e);
} }
}); });
}, false, mapExtension); }, false, mapExtension)));
}));
t.row(); t.row();
@@ -171,8 +166,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
} }
}); });
loadDialog = new MapLoadDialog(map -> { loadDialog = new MapLoadDialog(map ->
ui.loadGraphics(() -> { ui.loadGraphics(() -> {
try(DataInputStream stream = new DataInputStream(map.stream.get())){ try(DataInputStream stream = new DataInputStream(map.stream.get())){
MapMeta meta = MapIO.readMapMeta(stream); MapMeta meta = MapIO.readMapMeta(stream);
@@ -180,12 +174,11 @@ public class MapEditorDialog extends Dialog implements Disposable{
editor.beginEdit(data, meta.tags, false); editor.beginEdit(data, meta.tags, false);
view.clearStack(); view.clearStack();
}catch(IOException e){ }catch(Exception e){
ui.showError(Bundles.format("text.editor.errormapload", Strings.parseException(e, false))); ui.showError(Bundles.format("text.editor.errormapload", Strings.parseException(e, false)));
Log.err(e); Log.err(e);
} }
}); }));
});
setFillParent(true); setFillParent(true);
@@ -261,7 +254,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
* 2) icon name * 2) icon name
* 3) listener * 3) listener
*/ */
private FloatingDialog createDialog(String title, Object... arguments){ private void createDialog(String title, Object... arguments){
FloatingDialog dialog = new FloatingDialog(title); FloatingDialog dialog = new FloatingDialog(title);
float h = 90f; float h = 90f;
@@ -278,18 +271,15 @@ public class MapEditorDialog extends Dialog implements Disposable{
listenable.run(); listenable.run();
dialog.hide(); dialog.hide();
menu.hide(); menu.hide();
}).left().get(); }).left().margin(0).get();
button.clearChildren(); button.clearChildren();
button.table("button", t -> { button.addImage(iconname).size(16 * 3).padLeft(10);
t.addImage(iconname).size(16 * 3);
t.update(() -> t.background(button.getClickListener().isOver() ? "button-over" : "button"));
}).padLeft(-10).padBottom(-3).size(h);
button.table(t -> { button.table(t -> {
t.add(name).growX().wrap(); t.add(name).growX().wrap();
t.row(); t.row();
t.add(description).color(Color.GRAY).growX().wrap(); t.add(description).color(Color.GRAY).growX().wrap();
}).growX().padLeft(8); }).growX().pad(10f).padLeft(5);
button.row(); button.row();
@@ -298,8 +288,6 @@ public class MapEditorDialog extends Dialog implements Disposable{
dialog.addCloseButton(); dialog.addCloseButton();
dialog.show(); dialog.show();
return dialog;
} }
@Override @Override
@@ -562,9 +550,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
ImageButton button = new ImageButton("white", "clear-toggle"); ImageButton button = new ImageButton("white", "clear-toggle");
button.clicked(() -> editor.setDrawBlock(block)); button.clicked(() -> editor.setDrawBlock(block));
button.resizeImage(8 * 4f); button.resizeImage(8 * 4f);
button.getImageCell().setActor(stack); button.replaceImage(stack);
button.addChild(stack);
button.getImage().remove();
button.update(() -> button.setChecked(editor.getDrawBlock() == block)); button.update(() -> button.setChecked(editor.getDrawBlock() == block));
group.add(button); group.add(button);
content.add(button).size(50f); content.add(button).size(50f);

View File

@@ -601,9 +601,10 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
float xa = Inputs.getAxis(section, "move_x"); float xa = Inputs.getAxis(section, "move_x");
float ya = Inputs.getAxis(section, "move_y"); float ya = Inputs.getAxis(section, "move_y");
if(!Inputs.keyDown("gridMode")){
movement.y += ya * speed; movement.y += ya * speed;
movement.x += xa * speed; movement.x += xa * speed;
}
Vector2 vec = Graphics.world(control.input(playerIndex).getMouseX(), control.input(playerIndex).getMouseY()); Vector2 vec = Graphics.world(control.input(playerIndex).getMouseX(), control.input(playerIndex).getMouseY());
pointerX = vec.x; pointerX = vec.x;
@@ -787,6 +788,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
placeQueue.clear(); placeQueue.clear();
dead = true; dead = true;
trail.clear(); trail.clear();
target = null;
moveTarget = null;
carrier = null; carrier = null;
health = maxHealth(); health = maxHealth();
boostHeat = drownTime = hitTime = 0f; boostHeat = drownTime = hitTime = 0f;

View File

@@ -173,15 +173,19 @@ public interface BuilderTrait extends Entity{
default void updateBuilding(Unit unit){ default void updateBuilding(Unit unit){
//remove already completed build requests //remove already completed build requests
removal.clear(); removal.clear();
for(BuildRequest request : getPlaceQueue()){ for(BuildRequest req : getPlaceQueue()){
if((request.breaking && world.tile(request.x, request.y).block() == Blocks.air) || removal.add(req);
(!request.breaking && world.tile(request.x, request.y).block() == request.recipe.result)){
removal.add(request);
}
} }
for(BuildRequest req : removal){ getPlaceQueue().clear();
getPlaceQueue().removeValue(req, true);
for(BuildRequest request : removal){
if(!((request.breaking && world.tile(request.x, request.y).block() == Blocks.air) ||
(!request.breaking &&
(world.tile(request.x, request.y).getRotation() == request.rotation || !request.recipe.result.rotate)
&& world.tile(request.x, request.y).block() == request.recipe.result))){
getPlaceQueue().addLast(request);
}
} }
BuildRequest current = getCurrentRequest(); BuildRequest current = getCurrentRequest();

View File

@@ -17,6 +17,8 @@ import io.anuke.ucore.util.Strings;
import io.anuke.ucore.util.ThreadArray; import io.anuke.ucore.util.ThreadArray;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
@@ -186,8 +188,12 @@ public class Saves{
return Strings.formatMillis(current == this ? totalPlaytime : meta.timePlayed); return Strings.formatMillis(current == this ? totalPlaytime : meta.timePlayed);
} }
public long getTimestamp(){
return meta.timestamp;
}
public String getDate(){ public String getDate(){
return meta.date; return SimpleDateFormat.getDateTimeInstance().format(new Date(meta.timestamp));
} }
public Map getMap(){ public Map getMap(){

View File

@@ -65,6 +65,7 @@ public class Unlocks{
save(); save();
} }
@SuppressWarnings("unchecked")
public void load(){ public void load(){
unlocked = Settings.getObject("unlockset", ObjectMap.class, ObjectMap::new); unlocked = Settings.getObject("unlockset", ObjectMap.class, ObjectMap::new);
} }

View File

@@ -25,6 +25,8 @@ public class DefaultKeybinds{
"rotate", new Axis(Input.SCROLL), "rotate", new Axis(Input.SCROLL),
"dash", Input.SHIFT_LEFT, "dash", Input.SHIFT_LEFT,
"drop_unit", Input.SHIFT_LEFT, "drop_unit", Input.SHIFT_LEFT,
"gridMode", Input.CONTROL_LEFT,
"gridModeShift", Input.SHIFT_LEFT,
new Category("view"), new Category("view"),
"zoom_hold", Input.CONTROL_LEFT, "zoom_hold", Input.CONTROL_LEFT,
"zoom", new Axis(Input.SCROLL), "zoom", new Axis(Input.SCROLL),

View File

@@ -4,15 +4,12 @@ import io.anuke.mindustry.game.Difficulty;
import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.GameMode;
import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.maps.Map;
import java.text.SimpleDateFormat;
import java.util.Date;
import static io.anuke.mindustry.Vars.world; import static io.anuke.mindustry.Vars.world;
public class SaveMeta{ public class SaveMeta{
public int version; public int version;
public int build; public int build;
public String date; public long timestamp;
public long timePlayed; public long timePlayed;
public int sector; public int sector;
public GameMode mode; public GameMode mode;
@@ -20,10 +17,10 @@ public class SaveMeta{
public int wave; public int wave;
public Difficulty difficulty; public Difficulty difficulty;
public SaveMeta(int version, long date, long timePlayed, int build, int sector, int mode, String map, int wave, Difficulty difficulty){ public SaveMeta(int version, long timestamp, long timePlayed, int build, int sector, int mode, String map, int wave, Difficulty difficulty){
this.version = version; this.version = version;
this.build = build; this.build = build;
this.date = SimpleDateFormat.getDateTimeInstance().format(new Date(date)); this.timestamp = timestamp;
this.timePlayed = timePlayed; this.timePlayed = timePlayed;
this.sector = sector; this.sector = sector;
this.mode = GameMode.values()[mode]; this.mode = GameMode.values()[mode];

View File

@@ -86,6 +86,10 @@ public class Sectors{
return grid.get(Bits.getLeftShort(position), Bits.getRightShort(position)); return grid.get(Bits.getLeftShort(position), Bits.getRightShort(position));
} }
public Iterable<Sector> getSectors(){
return grid.values();
}
public Difficulty getDifficulty(Sector sector){ public Difficulty getDifficulty(Sector sector){
if(sector.difficulty == 0){ if(sector.difficulty == 0){
return Difficulty.hard; return Difficulty.hard;
@@ -150,6 +154,7 @@ public class Sectors{
save(); save();
} }
@SuppressWarnings("unchecked")
public void load(){ public void load(){
for(Sector sector : grid.values()){ for(Sector sector : grid.values()){
sector.texture.dispose(); sector.texture.dispose();

View File

@@ -261,6 +261,7 @@ public class Administration{
Settings.save(); Settings.save();
} }
@SuppressWarnings("unchecked")
private void load(){ private void load(){
playerInfo = Settings.getObject("player-info", ObjectMap.class, ObjectMap::new); playerInfo = Settings.getObject("player-info", ObjectMap.class, ObjectMap::new);
bannedIPs = Settings.getObject("banned-ips", Array.class, Array::new); bannedIPs = Settings.getObject("banned-ips", Array.class, Array::new);

View File

@@ -25,11 +25,11 @@ import java.io.IOException;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
@SuppressWarnings("unchecked")
public class Net{ public class Net{
private static boolean server; private static boolean server;
private static boolean active; private static boolean active;
private static boolean clientLoaded; private static boolean clientLoaded;
private static String lastIP;
private static Array<Object> packetQueue = new Array<>(); private static Array<Object> packetQueue = new Array<>();
private static ObjectMap<Class<?>, Consumer> clientListeners = new ObjectMap<>(); private static ObjectMap<Class<?>, Consumer> clientListeners = new ObjectMap<>();
private static ObjectMap<Class<?>, BiConsumer<Integer, Object>> serverListeners = new ObjectMap<>(); private static ObjectMap<Class<?>, BiConsumer<Integer, Object>> serverListeners = new ObjectMap<>();
@@ -106,7 +106,6 @@ public class Net{
*/ */
public static void connect(String ip, int port, Runnable success){ public static void connect(String ip, int port, Runnable success){
try{ try{
lastIP = ip + ":" + port;
if(!active){ if(!active){
clientProvider.connect(ip, port, success); clientProvider.connect(ip, port, success);
active = true; active = true;
@@ -119,11 +118,6 @@ public class Net{
} }
} }
/**Returns the last IP connected to.*/
public static String getLastIP() {
return lastIP;
}
/** /**
* Host a server at an address. * Host a server at an address.
*/ */

View File

@@ -11,7 +11,7 @@ public class ItemImage extends Stack{
public ItemImage(TextureRegion region, Supplier<CharSequence> text){ public ItemImage(TextureRegion region, Supplier<CharSequence> text){
Table t = new Table().left().bottom(); Table t = new Table().left().bottom();
t.label(text); t.label(text).name("item-label");
add(new Image(region)); add(new Image(region));
add(t); add(t);
@@ -22,7 +22,7 @@ public class ItemImage extends Stack{
if(stack.amount != 0){ if(stack.amount != 0){
Table t = new Table().left().bottom(); Table t = new Table().left().bottom();
t.add(stack.amount + ""); t.add(stack.amount + "").name("item-label");
add(t); add(t);
} }
} }

View File

@@ -12,21 +12,15 @@ public class MenuButton extends TextButton{
public MenuButton(String icon, String text, String description, Runnable clicked){ public MenuButton(String icon, String text, String description, Runnable clicked){
super("default"); super("default");
float s = 66f;
clicked(clicked); clicked(clicked);
clearChildren(); clearChildren();
margin(0); margin(0);
table(t -> { table(t -> {
t.addImage(icon).size(14 * 3); t.addImage(icon).size(14 * 3).padLeft(6);
t.update(() -> t.setBackground(getClickListener().isVisualPressed() ? "button-down" : getClickListener().isOver() ? "button-over" : "button"));
}).size(s - 5, s);
table(t -> {
t.add(text).wrap().growX().get().setAlignment(Align.center, Align.left); t.add(text).wrap().growX().get().setAlignment(Align.center, Align.left);
if(description != null){ if(description != null){
t.row(); t.row();

View File

@@ -9,20 +9,16 @@ import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.Element; import io.anuke.ucore.scene.Element;
import io.anuke.ucore.scene.event.InputEvent; import io.anuke.ucore.scene.event.InputEvent;
import io.anuke.ucore.scene.event.InputListener; import io.anuke.ucore.scene.event.InputListener;
import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.scene.ui.layout.Container;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
public class Minimap extends Table{ public class Minimap extends Container<Element>{
public Minimap(){ public Minimap(){
super("pane"); super(new Element(){
margin(5);
TextureRegion r = new TextureRegion(); TextureRegion r = new TextureRegion();
Element elem = new Element(){
@Override @Override
public void draw(){ public void draw(){
if(renderer.minimap.getRegion() == null) return; if(renderer.minimap.getRegion() == null) return;
@@ -57,7 +53,12 @@ public class Minimap extends Table{
renderer.fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); renderer.fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
} }
} }
}; });
background("pane");
size(140f);
margin(5f);
addListener(new InputListener(){ addListener(new InputListener(){
public boolean scrolled(InputEvent event, float x, float y, int amount){ public boolean scrolled(InputEvent event, float x, float y, int amount){
@@ -66,7 +67,7 @@ public class Minimap extends Table{
} }
}); });
elem.update(() -> { update(() -> {
Element e = Core.scene.hit(Graphics.mouse().x, Graphics.mouse().y, true); Element e = Core.scene.hit(Graphics.mouse().x, Graphics.mouse().y, true);
if(e != null && e.isDescendantOf(this)){ if(e != null && e.isDescendantOf(this)){
@@ -75,7 +76,5 @@ public class Minimap extends Table{
Core.scene.setScrollFocus(null); Core.scene.setScrollFocus(null);
} }
}); });
add(elem).size(140f, 140f);
} }
} }

View File

@@ -279,9 +279,7 @@ public class JoinDialog extends FloatingDialog{
button.left(); button.left();
button.row(); button.row();
button.add("[lightgray]" + (host.players != 1 ? Bundles.format("text.players", host.players) : button.add("[lightgray]" + (host.players != 1 ? Bundles.format("text.players", host.players) :
Bundles.format("text.players.single", host.players))); Bundles.format("text.players.single", host.players))).padBottom(5);
button.row();
button.add("[lightgray]" + host.address).pad(4).left();
} }
void connect(String ip, int port){ void connect(String ip, int port){
@@ -310,6 +308,7 @@ public class JoinDialog extends FloatingDialog{
return UIUtils.portrait() ? 350f : 500f; return UIUtils.portrait() ? 350f : 500f;
} }
@SuppressWarnings("unchecked")
private void loadServers(){ private void loadServers(){
servers = Settings.getObject("server-list", Array.class, Array::new); servers = Settings.getObject("server-list", Array.class, Array::new);
} }

View File

@@ -159,6 +159,26 @@ public class SectorsDialog extends FloatingDialog{
}); });
clicked(() -> clicked = true); clicked(() -> clicked = true);
this.focus();
}
private void focus(){
Sector focusSector = null;
long newestTimestamp = 0;
for(Sector sector : world.sectors.getSectors()){
if(sector.hasSave()){
long timestamp = sector.getSave().getTimestamp();
if(timestamp > newestTimestamp){
focusSector = sector;
newestTimestamp = timestamp;
}
}
}
if(focusSector != null) {
panX = (focusSector.x + 0.5f) * sectorSize;
panY = (focusSector.y + 0.5f) * sectorSize;
}
} }
@Override @Override

View File

@@ -109,7 +109,7 @@ public class HudFragment extends Fragment{
} }
cont.update(() -> { cont.update(() -> {
if(Inputs.keyTap("toggle_menus") && !ui.chatfrag.chatOpen()){ if(!Inputs.keyDown("gridMode") && Inputs.keyTap("toggle_menus") && !ui.chatfrag.chatOpen()){
toggleMenus(); toggleMenus();
} }
}); });

View File

@@ -3,6 +3,7 @@ package io.anuke.mindustry.ui.fragments;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Interpolation; import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.game.EventType.WorldLoadGraphicsEvent; import io.anuke.mindustry.game.EventType.WorldLoadGraphicsEvent;
@@ -17,6 +18,8 @@ import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.OreBlock; import io.anuke.mindustry.world.blocks.OreBlock;
import io.anuke.ucore.core.Events; import io.anuke.ucore.core.Events;
import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.core.Inputs;
import io.anuke.ucore.input.Input;
import io.anuke.ucore.scene.Group; import io.anuke.ucore.scene.Group;
import io.anuke.ucore.scene.actions.Actions; import io.anuke.ucore.scene.actions.Actions;
import io.anuke.ucore.scene.event.Touchable; import io.anuke.ucore.scene.event.Touchable;
@@ -38,6 +41,19 @@ public class PlacementFragment extends Fragment{
boolean shown = true; boolean shown = true;
boolean lastGround; boolean lastGround;
//TODO make this configurable
final Input[] inputGrid = {
Input.NUM_1, Input.NUM_2, Input.NUM_3, Input.NUM_4,
Input.Q, Input.W, Input.E, Input.R,
Input.A, Input.S, Input.D, Input.F,
Input.Z, Input.X, Input.C, Input.V
}, inputCatGrid = {
Input.NUM_1, Input.NUM_2,
Input.Q, Input.W,
Input.A, Input.S,
Input.Z, Input.X, Input.C, Input.V
};
public PlacementFragment(){ public PlacementFragment(){
Events.on(WorldLoadGraphicsEvent.class, event -> { Events.on(WorldLoadGraphicsEvent.class, event -> {
currentCategory = Category.turret; currentCategory = Category.turret;
@@ -47,6 +63,42 @@ public class PlacementFragment extends Fragment{
}); });
} }
boolean gridUpdate(InputHandler input){
if(!Inputs.keyDown("gridMode") || ui.chatfrag.chatOpen()) return false;
if(Inputs.keyDown("gridModeShift")){ //select category
int i = 0;
for(Input key : inputCatGrid){
if(Inputs.keyDown(key)){
input.recipe = Recipe.getByCategory(Category.values()[i]).first();
currentCategory = input.recipe.category;
}
i++;
}
return true;
}else if(Inputs.keyDown("select")){ //mouse eyedropper select
Tile tile = world.tileWorld(Graphics.mouseWorld().x, Graphics.mouseWorld().y);
if(tile != null){
tile = tile.target();
Recipe tryRecipe = Recipe.getByResult(tile.block());
if(tryRecipe != null && control.unlocks.isUnlocked(tryRecipe)){
input.recipe = tryRecipe;
currentCategory = input.recipe.category;
return true;
}
}
}else{ //select block
int i = 0;
Array<Recipe> recipes = Recipe.getByCategory(currentCategory);
for(Input key : inputGrid){
if(Inputs.keyDown(key))
input.recipe = (i < recipes.size && control.unlocks.isUnlocked(recipes.get(i))) ? recipes.get(i) : null;
i++;
}
}
return false;
}
@Override @Override
public void build(Group parent){ public void build(Group parent){
parent.fill(full -> { parent.fill(full -> {
@@ -111,8 +163,8 @@ public class PlacementFragment extends Fragment{
frame.table("button-edge-2", top -> { frame.table("button-edge-2", top -> {
topTable = top; topTable = top;
top.add(new Table()).growX().update(topTable -> { top.add(new Table()).growX().update(topTable -> {
if((tileDisplayBlock() == null && lastDisplay == getSelected() && !lastGround) || if((tileDisplayBlock() == null && lastDisplay == getSelected() && !lastGround) || (tileDisplayBlock() != null && lastDisplay == tileDisplayBlock() && lastGround))
(tileDisplayBlock() != null && lastDisplay == tileDisplayBlock() && lastGround)) return; return;
topTable.clear(); topTable.clear();
topTable.top().left().margin(5); topTable.top().left().margin(5);
@@ -191,6 +243,9 @@ public class PlacementFragment extends Fragment{
}).touchable(Touchable.enabled); }).touchable(Touchable.enabled);
rebuildCategory.run(); rebuildCategory.run();
frame.update(() -> {
if(gridUpdate(input)) rebuildCategory.run();
});
}); });
}); });
} }

View File

@@ -101,6 +101,7 @@ public class Tile implements PosTrait, TargetTrait{
return -1; return -1;
} }
@SuppressWarnings("unchecked")
public <T extends TileEntity> T entity(){ public <T extends TileEntity> T entity(){
return (T) entity; return (T) entity;
} }

View File

@@ -35,7 +35,6 @@ public class Conveyor extends Block{
private TextureRegion[][] regions = new TextureRegion[7][4]; private TextureRegion[][] regions = new TextureRegion[7][4];
protected float speed = 0f; protected float speed = 0f;
protected float carryCapacity = 8f;
protected Conveyor(String name){ protected Conveyor(String name){
super(name); super(name);
@@ -359,7 +358,7 @@ public class Conveyor extends Block{
public Array<Object> getDebugInfo(Tile tile){ public Array<Object> getDebugInfo(Tile tile){
ConveyorEntity entity = tile.entity(); ConveyorEntity entity = tile.entity();
Array<Object> arr = super.getDebugInfo(tile); Array<Object> arr = super.getDebugInfo(tile);
arr.addAll(Array.with( arr.addAll(Array.<Object>with(
"clogHeat", entity.clogHeat, "clogHeat", entity.clogHeat,
"sleeping", entity.isSleeping() "sleeping", entity.isSleeping()
)); ));

View File

@@ -181,7 +181,10 @@ public class PowerGraph{
public void clear(){ public void clear(){
for(Tile other : all){ for(Tile other : all){
if(other.entity != null && other.entity.power != null){ if(other.entity != null && other.entity.power != null){
if(other.block().consumes.hasSubtypeOf(ConsumePower.class) && !other.block().consumes.getSubtypeOf(ConsumePower.class).isBuffered){
// Reset satisfaction to zero in case of direct consumer. There is no reason to clear power from buffered consumers.
other.entity.power.satisfaction = 0.0f; other.entity.power.satisfaction = 0.0f;
}
other.entity.power.graph = null; other.entity.power.graph = null;
} }
} }

View File

@@ -58,12 +58,11 @@ public class Consumers{
/** /**
* Creates a consumer which stores power and uses it only in case of certain events (e.g. a turret firing). * Creates a consumer which stores power and uses it only in case of certain events (e.g. a turret firing).
* It will take 60 ticks (one second) to fill the buffer, given enough power supplied. * It will take 180 ticks (three second) to fill the buffer, given enough power supplied.
* @param powerCapacity The maximum capacity in power units. * @param powerCapacity The maximum capacity in power units.
*/ */
public ConsumePower powerBuffered(float powerCapacity){ public ConsumePower powerBuffered(float powerCapacity){
// TODO Balance: How long should it take to fill a buffer? The lower this value, the more power will be "stolen" from direct consumers. return powerBuffered(powerCapacity, 1f);
return powerBuffered(powerCapacity, 60f);
} }
/** /**
@@ -131,6 +130,7 @@ public class Consumers{
return false; return false;
} }
@SuppressWarnings("unchecked")
public <T extends Consume> T get(Class<T> type){ public <T extends Consume> T get(Class<T> type){
if(!map.containsKey(type)){ if(!map.containsKey(type)){
throw new IllegalArgumentException("Block does not contain consumer of type '" + type + "'!"); throw new IllegalArgumentException("Block does not contain consumer of type '" + type + "'!");
@@ -138,6 +138,7 @@ public class Consumers{
return (T) map.get(type); return (T) map.get(type);
} }
@SuppressWarnings("unchecked")
public <T extends Consume> T getSubtypeOf(Class<T> type){ public <T extends Consume> T getSubtypeOf(Class<T> type){
for(Consume consume : all()){ for(Consume consume : all()){
if(type.isAssignableFrom(consume.getClass())){ if(type.isAssignableFrom(consume.getClass())){

View File

@@ -90,6 +90,8 @@ public class KryoServer implements ServerProvider{
threads.runDelay(() -> { threads.runDelay(() -> {
try{ try{
Net.handleServerReceived(k.id, object); Net.handleServerReceived(k.id, object);
}catch(ValidateException e){
Log.err("Validate failed: {0} ({1})", e.player.name, e.getMessage());
}catch(Exception e){ }catch(Exception e){
e.printStackTrace(); e.printStackTrace();
} }