Merge branch 'master' into crater

# Conflicts:
#	core/assets/sprites/sprites.atlas
#	core/assets/sprites/sprites.png
#	core/assets/sprites/sprites2.png
#	core/assets/sprites/sprites3.png
This commit is contained in:
Patrick 'Quezler' Mounier
2020-04-23 21:10:48 +02:00
140 changed files with 6579 additions and 6547 deletions
+2
View File
@@ -15,6 +15,8 @@ assignees: ''
**Steps to reproduce**: *How you happened across the issue, and what you were doing at the time.* **Steps to reproduce**: *How you happened across the issue, and what you were doing at the time.*
**Link to mod(s) used, if applicable**: *The mod repositories or zip files that are related to the issue.*
--- ---
*Place an X (no spaces) between the brackets to confirm that you have read the line below.* *Place an X (no spaces) between the brackets to confirm that you have read the line below.*
@@ -5,21 +5,6 @@ import java.lang.annotation.*;
public class Annotations{ public class Annotations{
//region entity interfaces //region entity interfaces
public enum DrawLayer{
floor,
floorOver,
groundShadows,
groundUnder,
ground,
flyingShadows,
flying,
bullets,
effects,
overlays,
names,
weather
}
/** Indicates that a method overrides other methods. */ /** Indicates that a method overrides other methods. */
@Target({ElementType.METHOD}) @Target({ElementType.METHOD})
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@@ -161,6 +161,7 @@ public class EntityProcess extends BaseProcessor{
Log.debug(""); Log.debug("");
} }
/*
//generate special render layer interfaces //generate special render layer interfaces
for(DrawLayer layer : DrawLayer.values()){ for(DrawLayer layer : DrawLayer.values()){
//create the DrawLayer interface that entities need to implement //create the DrawLayer interface that entities need to implement
@@ -171,7 +172,7 @@ public class EntityProcess extends BaseProcessor{
.addModifiers(Modifier.PUBLIC).addAnnotation(EntityInterface.class); .addModifiers(Modifier.PUBLIC).addAnnotation(EntityInterface.class);
inter.addMethod(MethodSpec.methodBuilder("draw" + Strings.capitalize(layer.name())).addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).build()); inter.addMethod(MethodSpec.methodBuilder("draw" + Strings.capitalize(layer.name())).addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).build());
write(inter); write(inter);
} }*/
}else if(round == 2){ //round 2: get component classes and generate interfaces for them }else if(round == 2){ //round 2: get component classes and generate interfaces for them
//parse groups //parse groups
@@ -182,6 +183,7 @@ public class EntityProcess extends BaseProcessor{
groupDefs.add(new GroupDefinition(group.name(), ClassName.bestGuess(packageName + "." + interfaceName(types.first())), types, an.spatial(), an.mapping(), collides)); groupDefs.add(new GroupDefinition(group.name(), ClassName.bestGuess(packageName + "." + interfaceName(types.first())), types, an.spatial(), an.mapping(), collides));
} }
/*
//add special generated groups //add special generated groups
for(DrawLayer layer : DrawLayer.values()){ for(DrawLayer layer : DrawLayer.values()){
String name = "DrawLayer" + Strings.capitalize(layer.name()) + "c"; String name = "DrawLayer" + Strings.capitalize(layer.name()) + "c";
@@ -190,7 +192,7 @@ public class EntityProcess extends BaseProcessor{
//add manual inclusions of entities to be added to this group //add manual inclusions of entities to be added to this group
def.manualInclusions.addAll(allDefs.select(s -> allComponents(s).contains(comp -> comp.interfaces().contains(in -> in.name().equals(name))))); def.manualInclusions.addAll(allDefs.select(s -> allComponents(s).contains(comp -> comp.interfaces().contains(in -> in.name().equals(name)))));
groupDefs.add(def); groupDefs.add(def);
} }*/
ObjectMap<String, Selement> usedNames = new ObjectMap<>(); ObjectMap<String, Selement> usedNames = new ObjectMap<>();
ObjectMap<Selement, ObjectSet<String>> extraNames = new ObjectMap<>(); ObjectMap<Selement, ObjectSet<String>> extraNames = new ObjectMap<>();
@@ -457,12 +459,13 @@ public class EntityProcess extends BaseProcessor{
} }
} }
/*
for(DrawLayer layer : DrawLayer.values()){ for(DrawLayer layer : DrawLayer.values()){
MethodSpec.Builder groupDraw = MethodSpec.methodBuilder("draw" + Strings.capitalize(layer.name())) MethodSpec.Builder groupDraw = MethodSpec.methodBuilder("draw" + Strings.capitalize(layer.name()))
.addModifiers(Modifier.PUBLIC, Modifier.STATIC); .addModifiers(Modifier.PUBLIC, Modifier.STATIC);
groupDraw.addStatement("$L.draw($L::$L)", layer.name(), "DrawLayer" + Strings.capitalize(layer.name()) + "c", "draw" + Strings.capitalize(layer.name())); groupDraw.addStatement("$L.draw($L::$L)", layer.name(), "DrawLayer" + Strings.capitalize(layer.name()) + "c", "draw" + Strings.capitalize(layer.name()));
groupsBuilder.addMethod(groupDraw.build()); groupsBuilder.addMethod(groupDraw.build());
} }*/
groupsBuilder.addMethod(groupResize.build()); groupsBuilder.addMethod(groupResize.build());
groupsBuilder.addMethod(groupUpdate.build()); groupsBuilder.addMethod(groupUpdate.build());
@@ -4,6 +4,7 @@ dagger=0
draug=10 draug=10
mindustry.entities.def.BulletComp=1 mindustry.entities.def.BulletComp=1
mindustry.entities.def.DecalComp=2 mindustry.entities.def.DecalComp=2
mindustry.entities.def.EffectComp=15
mindustry.entities.def.FireComp=3 mindustry.entities.def.FireComp=3
mindustry.entities.def.GroundEffectComp=4 mindustry.entities.def.GroundEffectComp=4
mindustry.entities.def.PlayerComp=5 mindustry.entities.def.PlayerComp=5
@@ -0,0 +1 @@
{fields:[{name:color,type:arc.graphics.Color,size:-1},{name:data,type:java.lang.Object,size:-1},{name:lifetime,type:float,size:4},{name:offsetX,type:float,size:4},{name:offsetY,type:float,size:4},{name:rotation,type:float,size:4},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 414 B

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 402 B

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 271 B

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 297 B

Before

Width:  |  Height:  |  Size: 411 B

After

Width:  |  Height:  |  Size: 411 B

Before

Width:  |  Height:  |  Size: 410 B

After

Width:  |  Height:  |  Size: 410 B

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 271 B

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 303 B

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 289 B

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

+2 -2
View File
@@ -466,7 +466,7 @@ uncover = Descubrir
configure = Configurar carga inicial configure = Configurar carga inicial
bannedblocks = Bloques prohibidos bannedblocks = Bloques prohibidos
addall = Añadir todo addall = Añadir todo
configure.locked = [LIGHT_GRAY]Alcanza la oleada {0}\npara configurar la carga inicial. configure.locked = [LIGHT_GRAY]Para configurar la carga inicial: {0}.
configure.invalid = La cantidad debe estar entre 0 y {0}. configure.invalid = La cantidad debe estar entre 0 y {0}.
zone.unlocked = [LIGHT_GRAY]{0} desbloqueado. zone.unlocked = [LIGHT_GRAY]{0} desbloqueado.
zone.requirement.complete = Oleada {0} alcanzada:\nrequerimientos de la zona {1} cumplidos. zone.requirement.complete = Oleada {0} alcanzada:\nrequerimientos de la zona {1} cumplidos.
@@ -1187,7 +1187,7 @@ block.bridge-conveyor.description = Bloque avanado de transporte. Puede transpor
block.phase-conveyor.description = Bloque de transporte avanzado. Usa energía para transportar objetos a otro transportador de fase conectado a través de varias casillas. block.phase-conveyor.description = Bloque de transporte avanzado. Usa energía para transportar objetos a otro transportador de fase conectado a través de varias casillas.
block.sorter.description = Clasifica objetos. Si un objeto es igual al seleccionado, pasará al frente. Si no, el objeto saldrá por la izquierda y la derecha. block.sorter.description = Clasifica objetos. Si un objeto es igual al seleccionado, pasará al frente. Si no, el objeto saldrá por la izquierda y la derecha.
block.inverted-sorter.description = Procesa elementos como un clasificador estándar, pero en su lugar pasa elementos seleccionados a los lados. block.inverted-sorter.description = Procesa elementos como un clasificador estándar, pero en su lugar pasa elementos seleccionados a los lados.
block.router.description = Acepta objetos de una dirección luego los deja equitativamente en hasta 3 direcciones diferentes. Útil para dividir los materiales de una fuente de recursos a múltiples objetivos. /n/n[scarlet]Nunca usar como entrade de producción porque puede tapar con los objetos de salida.[] block.router.description = Acepta objetos de una dirección luego los deja equitativamente en hasta 3 direcciones diferentes. Útil para dividir los materiales de una fuente de recursos a múltiples objetivos. \n\n[scarlet]Nunca usar como entrada de producción porque puede tapar con los objetos de salida.[]
block.distributor.description = Un enrutador avanzado que distribuye objetos equitativamente en hasta otras 7 direcciones. block.distributor.description = Un enrutador avanzado que distribuye objetos equitativamente en hasta otras 7 direcciones.
block.overflow-gate.description = Un enrutador que solo saca por la izquierda y la derecha si la cinta del frente está llena. block.overflow-gate.description = Un enrutador que solo saca por la izquierda y la derecha si la cinta del frente está llena.
block.underflow-gate.description = El opuesto de la compuerda de desborde. Solo dispensa hacia el frente si los lados están bloqueados. block.underflow-gate.description = El opuesto de la compuerda de desborde. Solo dispensa hacia el frente si los lados están bloqueados.
+103 -103
View File
@@ -1,4 +1,4 @@
credits.text = 제작자 [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[] / [scarlet]한국어 번역자[] - [royal]Potion[] credits.text = 제작자 [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[] / [scarlet]한국어 번역자[] [royal]Potion[] ,[royal]Corby-Yun[]
credits = 제작자 credits = 제작자
contributors = 번역 및 개발 기여자들 contributors = 번역 및 개발 기여자들
discord = Mindustry Discord 에 참여해보세요! discord = Mindustry Discord 에 참여해보세요!
@@ -13,9 +13,9 @@ link.google-play.description = Google Play 스토어 정보
link.f-droid.description = F-Droid 카탈로그 link.f-droid.description = F-Droid 카탈로그
link.wiki.description = 공식 Mindustry 위키 link.wiki.description = 공식 Mindustry 위키
link.feathub.description = 기능 아이디어 건의하기 link.feathub.description = 기능 아이디어 건의하기
linkfail = 링크를 여는 데 실패했습니다!\nURL이 기기의 클립보드에 복사되었습니다. linkfail = 링크를 열지 못했습니다!\nURL이 클립보드에 복사되었습니다.
screenshot = 스크린 샷이 {0} 경로에 저장되었습니다. screenshot = 스크린 샷이 {0} 에 저장되었습니다.
screenshot.invalid = 맵이 너무 커서 스크린 샷을 찍을 메모리가 충분하지 않습니다. screenshot.invalid = 맵이 너무 커서 메모리 부족해 스크린샷을 못했습니다.
gameover = 게임 오버 gameover = 게임 오버
gameover.pvp = [accent]{0}[] 팀이 승리했습니다! gameover.pvp = [accent]{0}[] 팀이 승리했습니다!
highscore = [accent]최고점수 달성! highscore = [accent]최고점수 달성!
@@ -29,22 +29,22 @@ load.system = 시스템
load.mod = 모드 load.mod = 모드
load.scripts = 스크립트 load.scripts = 스크립트
be.update = 새로운 테스트 버전이 출시되었습니다. be.update = 새로운 최신 빌드를 플레이 할 수 있습니다.
be.update.confirm = 다운로드 후 게임을 재시작하시겠습니까? be.update.confirm = 다운로드 후 게임을 재시작하시겠습니까?
be.updating = 업데이트 중... be.updating = 업데이트 중...
be.ignore = 무시 be.ignore = 무시
be.noupdates = 새로운 업데이트가 발견되지 않았습니다. be.noupdates = 새로운 업데이트가 습니다.
be.check = 업데이트 확인 be.check = 업데이트 확인합니다.
schematic = 설계도 schematic = 설계도
schematic.add = 설계도 저장하기 schematic.add = 설계도 저장하기
schematics = 설계도 모음 schematics = 설계도 모음
schematic.replace = A schematic by that name already exists. Replace it? schematic.replace = 이 설계도 이름이 이미 존재합니다. 바꾸겠습니까?
schematic.exists = A schematic by that name already exists. schematic.exists = 이 회로도 이름이 이미 존재합니다.
schematic.import = 설계도 불러오기 schematic.import = 설계도 불러오기
schematic.exportfile = 파일 내보내기 schematic.exportfile = 파일 내보내기
schematic.importfile = 파일 불러오기 schematic.importfile = 파일 불러오기
schematic.browseworkshop = 창작마당 schematic.browseworkshop = 창작마당
schematic.copy = 클립보드에 복사하기 schematic.copy = 클립보드에 복사하기
schematic.copy.import = 클립보드에서 붙여넣기 schematic.copy.import = 클립보드에서 붙여넣기
schematic.shareworkshop = 창작마당에 공유 schematic.shareworkshop = 창작마당에 공유
@@ -52,26 +52,26 @@ schematic.flip = 좌우 뒤집기 : [accent][[{0}][] / 상하 뒤집기 : [accen
schematic.saved = 설계도 저장됨. schematic.saved = 설계도 저장됨.
schematic.delete.confirm = 삭제된 설계도는 복구할 수 없습니다. 정말로 삭제하시겠습니까? schematic.delete.confirm = 삭제된 설계도는 복구할 수 없습니다. 정말로 삭제하시겠습니까?
schematic.rename = 설계도명 변경 schematic.rename = 설계도명 변경
schematic.info = 크기 : {0}x{1}, 블럭 수 : {2} schematic.info = {0}x{1}크기, {2} 블럭.
stat.wave = 버틴 단계 수 : [accent]{0} stat.wave = 패배한 웨이브 : [accent]{0}
stat.enemiesDestroyed = 파괴한 적 수 : [accent]{0} stat.enemiesDestroyed = 부순 적 수 : [accent]{0}
stat.built = 건설한 건물 수 : [accent]{0} stat.built = 지은 건물 수 : [accent]{0}
stat.destroyed = 파괴된 건물 수 : [accent]{0} stat.destroyed = 부서진 건물 수 : [accent]{0}
stat.deconstructed = 파괴한 건물 수 : [accent]{0} stat.deconstructed = 부순 건물 수 : [accent]{0}
stat.delivered = 획득한 자원 : stat.delivered = 얻은 자원 :
stat.playtime = 지역 클리어시간 : [accent] {0} stat.playtime = 플레이 타임 : [accent] {0}
stat.rank = 최종 점수 : [accent]{0} stat.rank = 최종 점수 : [accent]{0}
launcheditems = [accent]창고 launcheditems = [accent]보유 자원
launchinfo = [출격되지 않음][[출격]파랑색으로 표시된 자원들을 획득합니다. launchinfo = [출격되지 않음][[출격]파랑색으로 표시된 자원들을 얻습니다.
map.delete = 정말로 "[accent]{0}[]" 맵을 삭제하시겠습니까? map.delete = 정말로 "[accent]{0}[]" 맵을 삭제하시겠습니까?
level.highscore = 최고 점수 : [accent]{0} level.highscore = 최고 점수 : [accent]{0}
level.select = 맵 선택 level.select = 맵 선택
level.mode = 게임 모드 : level.mode = 게임 모드 :
showagain = 다음 세션에 이 메세지를 표시하지 않습니다 showagain = 다음 세션에 다시 이 메세지를 표시하지 않습니다.
coreattack = < 코어가 공격받고 있습니다! > coreattack = < 코어가 공격받고 있습니다! >
nearpoint = [[ [scarlet]적 생성 구역에서 나가세요[] ]\n적 생성구역 내 건물 및 유닛 파괴 nearpoint = [[ [scarlet]낙하 지점 에서 나가세요[] ]\n적 낙하낙하 지점 내 건물 및 유닛 파괴
database = 코어 기록보관소 database = 코어 기록보관소
savegame = 게임 저장 savegame = 게임 저장
loadgame = 게임 불러오기 loadgame = 게임 불러오기
@@ -97,37 +97,37 @@ uploadingcontent = 컨텐츠 업로드
uploadingpreviewfile = 미리보기 파일 업로드 uploadingpreviewfile = 미리보기 파일 업로드
committingchanges = 바뀐 점 적용 committingchanges = 바뀐 점 적용
done = 완료 done = 완료
feature.unsupported = 당신의 기기는 이 기능을 지원하지 않습니다. feature.unsupported = 기기는 이 기능을 지원하지 않습니다.
mods.alphainfo = 현재의 모드는 첫 번째 시도이며, 그리고[scarlet] 버그가 매우 많음을 명심하십시오[].\n만약 버그를 발견할경우 Mindustry 깃허브 또는 디스코드로 제보해주세요. mods.alphainfo = 현재의 모드는 시험적 기능이며, [scarlet] 버그가 많을 수도 있습니다.[].\n만약 버그를 발견할경우 Mindustry 깃허브 또는 디스코드로 제보해주세요.
mods.alpha = [accent](시험적 기능) mods.alpha = [accent](시험적 기능)
mods = 모드 mods = 모드
mods.none = [LIGHT_GRAY]추가한 모드가 없습니다! mods.none = [LIGHT_GRAY]모드가 없습니다!
mods.guide = 모드 가이드 mods.guide = 모드 제작 가이드
mods.report = 문제 신고 mods.report = 문제 신고
mods.openfolder = 모드 폴더 열기 mods.openfolder = 모드 폴더 열기
mod.display = [gray]모드 :[orange] {0} mod.display = [gray]모드 :[orange] {0}
mod.enabled = [blue]활성화 mod.enabled = [blue]활성화
mod.disabled = [scarlet]적용 안됨 mod.disabled = [scarlet]적용 안됨
mod.disable = [lightgray]비활성화 mod.disable = [lightgray]비활성화
mod.delete.error = 모드를 삭제할 수 없습니다. 아마도 해당 모드가 사용중인 것 같습니다. mod.delete.error = 모드를 삭제할 수 없습니다. 게임 밖에서 모드 파일을 사용 중일 수 있습니다.
mod.requiresversion = [scarlet]게임의 버전이 낮아 모드를 활성화할 수 없습니다!\n[scarlet]요구되는 게임 버전 : [accent]{0} mod.requiresversion = [scarlet]필요한 게임 버전 : [accent]{0}
mod.missingdependencies = [scarlet]필요한 모드 : {0} mod.missingdependencies = [scarlet]필요한 모드 : {0}
mod.erroredcontent = [scarlet]컨텐츠 오류 mod.erroredcontent = [scarlet]컨텐츠 오류
mod.errors = 모드 설정을 불러오는 중 오류가 발생하였습니다. mod.errors = 내용을 불러오는 중 오류가 발생하였습니다.
mod.noerrorplay = [scarlet]모드에 오류가 존재합니다.[] 해당 오류가 발생하는 모드를 비활성화하거나 모드의 오류를 고친 후 플레이가 가능합니다. mod.noerrorplay = [scarlet]모드에 오류가 존재합니다.[] 해당 오류가 발생하는 모드를 비활성화하거나 모드의 오류를 고친 후 플레이가 가능합니다.
mod.nowdisabled = [scarlet]모드 '{0}'는 다음의 모드에 의존합니다 : [accent] {1}\n[lightgray]이 모드를 먼저 다운로드해야합니다.\n이 모드는 자동으로 비활성화됩니다. mod.nowdisabled = [scarlet]모드 '{0}'는 다음의 모드에 의존합니다 : [accent] {1}\n[lightgray]이 모드를 먼저 다운로드해야합니다.\n이 모드는 자동으로 비활성화됩니다.
mod.enable = 활성화 mod.enable = 활성화
mod.requiresrestart = 모드 변경사항을 적용하기 위해 게임을 종료합니다. mod.requiresrestart = 모드 변경사항을 적용하기 위해 게임을 종료합니다.
mod.reloadrequired = [scarlet]새로고침 예정됨 mod.reloadrequired = [scarlet]새로고침 예정됨
mod.import = 모드 추가 mod.import = 모드 추가
mod.import.github = 깃허브 모드 추가 mod.import.github = 깃허브에서 모드 불러오기
mod.item.remove = 이것은 모드[accent] '{0}'[]의 자원입니다. 이 자원을 삭제하려면, 이 모드를 제거해야합니다. mod.item.remove = 이것은 모드[accent] '{0}'[]의 자원입니다. 이 자원을 삭제하려면, 이 모드를 제거해야합니다.
mod.remove.confirm = 이 모드를 삭제하시겠습니까? mod.remove.confirm = 이 모드를 삭제하시겠습니까?
mod.author = [LIGHT_GRAY]제작자 : [] {0} mod.author = [LIGHT_GRAY]제작자 : [] {0}
mod.missing = 이 세이브파일에는 설치하지 않은 모드 혹은 현재 버전에 속해있지 않은 데이터가 포함되어 있습니다. 이 파일을 불러올 경우 세이브파일의 데이터가 손상될 수 있습니다. 정말로 이 파일을 불러오시겠습니까?\n[lightgray]모드 :\n{0} mod.missing = 이 세이브에는 설치하지 않은 모드 현재 버전에 없는 데이터가 포함되어 있습니다. 세이브가 손상될 수 있습니다. 불러오시겠습니까?\n[lightgray]모드 :\n{0}
mod.preview.missing = 창작마당에 당신의 모드를 업로드하기 전에 미리보기 이미지를 먼저 추가해야합니다.\n[accent] preview.png[]라는 이름으로 미리보기 이미지를 당신의 모드 폴더안에 준비한 후 다시 시도해주세요. mod.preview.missing = 창작마당에 모드를 업로드하기 전에 미리보기 이미지를 추가해야합니다.\n[accent] 모드 폴더안에 preview.png[]이름의 미리보기 이미지를 준비한 후 다시 시도해주세요.
mod.folder.missing = 창작마당에는 폴더 형태의 모드만 게시할 수 있습니다.\n모드를 폴더 형태로 바꾸려면 파일을 폴더에 압축 해제하고 이전 압축파일을 제거한 후, 게임을 재시작하거나 모드를 다시 로드하십시오. mod.folder.missing = 창작마당에는 폴더 형태의 모드만 게시할 수 있습니다.\n모드를 폴더 형태로 바꾸려면 모드 파일을 모드 폴더에 압축 고 이전 모드 파일을 제 후, 게임을 재시작하거나 모드를 다시 로드하십시오.
mod.scripts.unsupported = 당신의 기기는 자바스크립트를 지원하지 않습니다. 모드의 일부 기능이 작동하지 않을 수 있습니다. mod.scripts.unsupported = 당신의 기기는 자바스크립트를 지원하지 않습니다. 모드의 일부 기능이 작동하지 않을 수 있습니다.
about.button = 정보 about.button = 정보
@@ -140,18 +140,18 @@ techtree = 연구 기록
research.list = [LIGHT_GRAY]연구 : research.list = [LIGHT_GRAY]연구 :
research = 연구 research = 연구
researched = [LIGHT_GRAY]{0}연구 완료. researched = [LIGHT_GRAY]{0}연구 완료.
players = 현재 {0}명 접속 중 players = {0}명 접속 중
players.single = 현재 {0}명만 있음. players.single = {0}명만 있음.
players.search = search players.search = 플레이어 검색
players.notfound = [gray]no players found players.notfound = [gray]플레이어를 찾을수 없습니다.
server.closing = [accent]서버 닫는 중... server.closing = [accent]서버 닫는 중...
server.kicked.kick = 서버에서 추방되었습니다! server.kicked.kick = 서버에서 추방되었습니다!
server.kicked.whitelist = 당신은 이 서버의 화이트리스트에 등록되어있지 않습니다. server.kicked.whitelist = 당신은 이 서버의 화이트리스트에 등록되어있지 않습니다.
server.kicked.serverClose = 서버 종료됨. server.kicked.serverClose = 서버 닫힘.
server.kicked.vote = 당신은 투표로 추방되었습니다. 그러니 좀 적당히 하지 그랬어요? server.kicked.vote = 당신은 투표로 추방되었습니다. 잘가요.
server.kicked.clientOutdated = 오래된 버전의 게임입니다! 게임을 업데이트하세요! server.kicked.clientOutdated = 오래된 버전의 게임입니다! 게임을 업데이트하세요!
server.kicked.serverOutdated = 오래된 버전의 서버입니다! 서버 호스트 관리자에게 문의하세요! server.kicked.serverOutdated = 오래된 버전의 서버입니다! 서버 호스트 관리자에게 문의하세요!
server.kicked.banned = 서버 규칙 위반으로 인해, 이제 당신은 영원히 이 서버를 플레이 하실 수 없습니다. server.kicked.banned = 이 서버에서 벤 되었습니다.
server.kicked.typeMismatch = 클라이언트와 호환되지 않는 서버입니다. 디스코드에서 #mods에 들러보는 건 어떨까요? server.kicked.typeMismatch = 클라이언트와 호환되지 않는 서버입니다. 디스코드에서 #mods에 들러보는 건 어떨까요?
server.kicked.playerLimit = 서버가 꽉 찼습니다. 빈 공간이 생길 때까지 기다려주세요. server.kicked.playerLimit = 서버가 꽉 찼습니다. 빈 공간이 생길 때까지 기다려주세요.
server.kicked.recentKick = 방금 추방되었습니다.\n잠시 기다린 후에 접속해주세요. server.kicked.recentKick = 방금 추방되었습니다.\n잠시 기다린 후에 접속해주세요.
@@ -159,7 +159,7 @@ server.kicked.nameInUse = 이 닉네임은 이미 이 서버에서 사용중입
server.kicked.nameEmpty = 당신의 닉네임이 비어있습니다. server.kicked.nameEmpty = 당신의 닉네임이 비어있습니다.
server.kicked.idInUse = 이미 서버에 접속중입니다! 다중 계정은 허용되지 않습니다. server.kicked.idInUse = 이미 서버에 접속중입니다! 다중 계정은 허용되지 않습니다.
server.kicked.customClient = 이 서버는 직접 빌드한 버전을 지원하지 않습니다. 공식 버전을 사용하세요. server.kicked.customClient = 이 서버는 직접 빌드한 버전을 지원하지 않습니다. 공식 버전을 사용하세요.
server.kicked.gameover = 코어가 파괴되었습니다... server.kicked.gameover = 게임 오버!
server.kicked.serverRestarting = 서버가 재시작합니다. server.kicked.serverRestarting = 서버가 재시작합니다.
server.versions = 클라이언트 버전 : [accent] {0}[]\n서버 버전 : [accent] {1}[] server.versions = 클라이언트 버전 : [accent] {0}[]\n서버 버전 : [accent] {1}[]
host.info = [accent]호스트[] 버튼은 현재 네트워크의 [scarlet]6567[] 포트를 사용합니다.\n[LIGHT_GRAY]같은 Wi-Fi 또는 로컬 네트워크[] 에서 서버 목록을 볼 수 있습니다.\n\n만약 플레이어들이 이 IP를 통해 어디에서나 연결할 수 있게 하고 싶다면, 공유기 설정에서 [accent]포트 포워딩[]을 하시거나 VPN을 사용하셔야 합니다.\n\n[LIGHT_GRAY]참고: LAN 게임 연결에 문제가 있는 사람이 있다면, 방화벽 설정에서 Mindustry 가 로컬 네트워크에 액세스하도록 허용했는지 확인해주세요. host.info = [accent]호스트[] 버튼은 현재 네트워크의 [scarlet]6567[] 포트를 사용합니다.\n[LIGHT_GRAY]같은 Wi-Fi 또는 로컬 네트워크[] 에서 서버 목록을 볼 수 있습니다.\n\n만약 플레이어들이 이 IP를 통해 어디에서나 연결할 수 있게 하고 싶다면, 공유기 설정에서 [accent]포트 포워딩[]을 하시거나 VPN을 사용하셔야 합니다.\n\n[LIGHT_GRAY]참고: LAN 게임 연결에 문제가 있는 사람이 있다면, 방화벽 설정에서 Mindustry 가 로컬 네트워크에 액세스하도록 허용했는지 확인해주세요.
@@ -243,7 +243,7 @@ on = 활성화
off = 비활성화 off = 비활성화
save.autosave = 자동저장 : {0} save.autosave = 자동저장 : {0}
save.map = 맵 : {0} save.map = 맵 : {0}
save.wave = {0} 단계 save.wave = {0} 웨이브
save.mode = 게임모드 : {0} save.mode = 게임모드 : {0}
save.date = 마지막 저장일 : {0} save.date = 마지막 저장일 : {0}
save.playtime = 플레이타임 : {0} save.playtime = 플레이타임 : {0}
@@ -276,9 +276,9 @@ cancelbuilding = [accent][[{0}][] 를 눌러 설계도 초기화
selectschematic = [accent][[{0}][] 를 눌러 선택+복사 selectschematic = [accent][[{0}][] 를 눌러 선택+복사
pausebuilding = [accent][[{0}][] 를 눌러 설계모드 진입 pausebuilding = [accent][[{0}][] 를 눌러 설계모드 진입
resumebuilding = [scarlet][[{0}][] 를 눌러 건설 시작 resumebuilding = [scarlet][[{0}][] 를 눌러 건설 시작
wave = [accent] {0} 단계 wave = [accent] {0} 웨이브
wave.waiting = [green]{0}초[]후 다음 단계 시작 wave.waiting = [green]{0}초[]후 다음 웨이브 시작
wave.waveInProgress = [LIGHT_GRAY]단계 진행중 wave.waveInProgress = [LIGHT_GRAY]웨이브 진행중
waiting = [LIGHT_GRAY]대기중... waiting = [LIGHT_GRAY]대기중...
waiting.players = 다른 플레이어를 기다리는 중.. waiting.players = 다른 플레이어를 기다리는 중..
wave.enemies = [LIGHT_GRAY]적 유닛 {0}마리 남았음 wave.enemies = [LIGHT_GRAY]적 유닛 {0}마리 남았음
@@ -315,18 +315,18 @@ editor.mapinfo = 맵 정보
editor.author = 제작자 : editor.author = 제작자 :
editor.description = 설명 : editor.description = 설명 :
editor.nodescription = 맵을 업로드하려면 최소 4자 이상의 설명이 있어야합니다. editor.nodescription = 맵을 업로드하려면 최소 4자 이상의 설명이 있어야합니다.
editor.waves = 단계 : editor.waves = 웨이브 :
editor.rules = 규칙 : editor.rules = 규칙 :
editor.generation = 맵 생성 설정 : editor.generation = 맵 생성 설정 :
editor.ingame = 인게임 편집 editor.ingame = 인게임 편집
editor.publish.workshop = 창작마당 업로드 editor.publish.workshop = 창작마당 업로드
editor.newmap = 신규 맵 editor.newmap = 신규 맵
workshop = Workshop workshop = Workshop
waves.title = 단계 waves.title = 웨이브
waves.remove = 삭제 waves.remove = 삭제
waves.never = 여기까지 유닛생성 waves.never = 여기까지 유닛생성
waves.every = waves.every =
waves.waves = 단계마다 waves.waves = 웨이브마다
waves.perspawn = 생성 waves.perspawn = 생성
waves.to = 부터 waves.to = 부터
waves.boss = 이 유닛을 보스로 설정 waves.boss = 이 유닛을 보스로 설정
@@ -334,9 +334,9 @@ waves.preview = 미리보기
waves.edit = 편집 waves.edit = 편집
waves.copy = 클립보드로 복사 waves.copy = 클립보드로 복사
waves.load = 클립보드에서 불러오기 waves.load = 클립보드에서 불러오기
waves.invalid = 클립보드의 잘못된 단계 데이터 waves.invalid = 클립보드의 잘못된 웨이브 데이터
waves.copied = 단계 코드 복사됨 waves.copied = 웨이브 코드 복사됨
waves.none = 단계가 설정되지 않았습니다.\n비어있을 시 자동으로 기본 적 단계로 설정됩니다. waves.none = 웨이브가 설정되지 않았습니다.\n비어있을 시 자동으로 기본 적 웨이브로 설정됩니다.
editor.default = [LIGHT_GRAY]<기본값> editor.default = [LIGHT_GRAY]<기본값>
details = 설명 details = 설명
edit = 편집 edit = 편집
@@ -451,17 +451,17 @@ abandon = 지역 포기
abandon.text = 이 구역의 모든 자원이 적에게 빼앗길 것입니다. abandon.text = 이 구역의 모든 자원이 적에게 빼앗길 것입니다.
locked = 잠김 locked = 잠김
complete = [LIGHT_GRAY]지역 해금 조건 : complete = [LIGHT_GRAY]지역 해금 조건 :
requirement.wave = {1}지역에서 {0}단계 달성 requirement.wave = {1}지역에서 {0}웨이브 달성
requirement.core = {0}지역에서 적 코어를 파괴 requirement.core = {0}지역에서 적 코어를 파괴
requirement.unlock = {0}지역 해금 requirement.unlock = {0}지역 해금
resume = 현재 진행 중인 지역\n[LIGHT_GRAY]{0} resume = 현재 진행 중인 지역\n[LIGHT_GRAY]{0}
bestwave = [LIGHT_GRAY]달성한 최고 단계 : {0} bestwave = [LIGHT_GRAY]달성한 최고 웨이브 : {0}
launch = < 출격 > launch = < 출격 >
launch.title = 출격 성공 launch.title = 출격 성공
launch.next = [LIGHT_GRAY]다음 출격 기회는 {0} 단계에서 나타납니다. launch.next = [LIGHT_GRAY]다음 출격 기회는 {0} 웨이브에서 나타납니다.
launch.unable2 = [scarlet]출격할 수 없습니다.[] launch.unable2 = [scarlet]출격할 수 없습니다.[]
launch.confirm = 출격하게 되면 코어에 저장된 모든 자원이 창고로 들어갑니다.\n또한 출격한 지역에는 아무것도 남지 않습니다. launch.confirm = 출격하게 되면 코어에 저장된 모든 자원이 창고로 들어갑니다.\n또한 출격한 지역에는 아무것도 남지 않습니다.
launch.skip.confirm = 만약 지금 출격하지 않고 스킵하신다면, 다음 출격 단계까지 기다려야 합니다. launch.skip.confirm = 만약 지금 출격하지 않고 스킵하신다면, 다음 출격 웨이브까지 기다려야 합니다.
uncover = 지역 개방 uncover = 지역 개방
configure = 코어 시작자원 설정 configure = 코어 시작자원 설정
bannedblocks = 금지된 블럭들 bannedblocks = 금지된 블럭들
@@ -469,7 +469,7 @@ addall = 모두 추가
configure.locked = [lightgray]{0}시 시작자원 설정이 해금됩니다. configure.locked = [lightgray]{0}시 시작자원 설정이 해금됩니다.
configure.invalid = 해당 값은 0 과 {0} 사이여야 합니다. configure.invalid = 해당 값은 0 과 {0} 사이여야 합니다.
zone.unlocked = [LIGHT_GRAY]지역 {0}이 잠금 해제되었습니다! zone.unlocked = [LIGHT_GRAY]지역 {0}이 잠금 해제되었습니다!
zone.requirement.complete = {0} 단계 달성 성공! \n{1} 지역 요구사항이 충족되었습니다! zone.requirement.complete = {0} 웨이브 달성 성공! \n{1} 지역 요구사항이 충족되었습니다!
zone.config.unlocked = 시작자원 설정 해금! : [lightgray]\n{0} zone.config.unlocked = 시작자원 설정 해금! : [lightgray]\n{0}
zone.resources = 감지된 자원 목록 : zone.resources = 감지된 자원 목록 :
zone.objective = [lightgray]지역 임무 : [accent]{0} zone.objective = [lightgray]지역 임무 : [accent]{0}
@@ -508,7 +508,7 @@ zone.groundZero.description = 이 장소는 다시 시작하기에 최적의 환
zone.frozenForest.description = 이 지역도 산과 가까운 지역입니다 포자들이 흩뿌려져 있으며 극한의 추위도 포자를 막을 수 있을 것 같지 않습니다.\n화력 발전소를 짓고 전력을 확보하여 채광 드론을 사용하는 법을 배우십시오. zone.frozenForest.description = 이 지역도 산과 가까운 지역입니다 포자들이 흩뿌려져 있으며 극한의 추위도 포자를 막을 수 있을 것 같지 않습니다.\n화력 발전소를 짓고 전력을 확보하여 채광 드론을 사용하는 법을 배우십시오.
zone.desertWastes.description = 이 황무지는 끝을 알 수 없을 정도로 광활하고 십자가 형태의 버려진 구조물이 존재합니다.\n석탄이 존재하며 이를 화력발전에 쓰거나 흑연 정제에 쓰십시오.\n\n[lightgray]이 지역에서의 착륙장소는 확실하지 않습니다. zone.desertWastes.description = 이 황무지는 끝을 알 수 없을 정도로 광활하고 십자가 형태의 버려진 구조물이 존재합니다.\n석탄이 존재하며 이를 화력발전에 쓰거나 흑연 정제에 쓰십시오.\n\n[lightgray]이 지역에서의 착륙장소는 확실하지 않습니다.
zone.saltFlats.description = 이 소금 사막은 매우 척박하여 자원이 거의 없습니다.\n하지만 자원이 희소한 이곳에서도 적들의 요새가 발견되었습니다. 그들을 사막의 모래로 만들어버리십시오. zone.saltFlats.description = 이 소금 사막은 매우 척박하여 자원이 거의 없습니다.\n하지만 자원이 희소한 이곳에서도 적들의 요새가 발견되었습니다. 그들을 사막의 모래로 만들어버리십시오.
zone.craters.description = 물이 가득한 이 크레이터에는 옛 전쟁의 유물들이 쌓여있습니다.\n이곳을 다시 점령해 강화유리를 제작하고 물을 끌어올려 포탑과 드릴에 공급하여 더 좋은 효율로 방어선을 강화하십시오. zone.craters.description = 물이 가득한 이 크레이터에는 옛 전쟁의 유물들이 쌓여있습니다.\n이곳을 다시 점령해 금속유리를 제작하고 물을 끌어올려 포탑과 드릴에 공급하여 더 좋은 효율로 방어선을 강화하십시오.
zone.ruinousShores.description = 이 지역은 과거 해안방어기지로 사용되었습니다.\n그러나 지금은 기본구조물만 남아있으니 이 지역을 어서 신속히 수리하여 외부로 세력을 확장한 뒤, 잃어버린 기술을 다시 회수하십시오. zone.ruinousShores.description = 이 지역은 과거 해안방어기지로 사용되었습니다.\n그러나 지금은 기본구조물만 남아있으니 이 지역을 어서 신속히 수리하여 외부로 세력을 확장한 뒤, 잃어버린 기술을 다시 회수하십시오.
zone.stainedMountains.description = 더 안쪽에는 포자에 오염된 산맥이 있지만, 이 곳은 포자에 오염되지 않았습니다.\n이 지역에서 티타늄을 채굴하고 이것을 어떻게 사용하는지 배우십시오.\n\n적들은 이곳에서 더 강력합니다. 더 강한 유닛들이 나올 때까지 시간을 낭비하지 마십시오. zone.stainedMountains.description = 더 안쪽에는 포자에 오염된 산맥이 있지만, 이 곳은 포자에 오염되지 않았습니다.\n이 지역에서 티타늄을 채굴하고 이것을 어떻게 사용하는지 배우십시오.\n\n적들은 이곳에서 더 강력합니다. 더 강한 유닛들이 나올 때까지 시간을 낭비하지 마십시오.
zone.overgrowth.description = 이 곳은 포자들의 근원과 가까이에 있는 과성장 지대입니다. 적이 이 곳에 전초기지를 설립했습니다. 디거를 생산해 적의 코어를 박살 내고 우리가 잃어버린 것들을 되돌려받으십시오! zone.overgrowth.description = 이 곳은 포자들의 근원과 가까이에 있는 과성장 지대입니다. 적이 이 곳에 전초기지를 설립했습니다. 디거를 생산해 적의 코어를 박살 내고 우리가 잃어버린 것들을 되돌려받으십시오!
@@ -593,7 +593,7 @@ bar.power = 전력
bar.progress = 생산 진행도 bar.progress = 생산 진행도
bar.spawned = 최대 {1}기 중 {0}기 생산됨 bar.spawned = 최대 {1}기 중 {0}기 생산됨
bar.input = 입력 bar.input = 입력
bar.output = Output bar.output = 출력
bullet.damage = [lightgray]피해량 : [stat]{0}[] bullet.damage = [lightgray]피해량 : [stat]{0}[]
bullet.splashdamage = [lightgray]범위 피해량 : [stat]{0}[] / [lightgray]피해 범위 : [stat]{1}[lightgray] 타일 bullet.splashdamage = [lightgray]범위 피해량 : [stat]{0}[] / [lightgray]피해 범위 : [stat]{1}[lightgray] 타일
@@ -652,8 +652,8 @@ setting.difficulty.normal = 보통
setting.difficulty.hard = 어려움 setting.difficulty.hard = 어려움
setting.difficulty.insane = 미침 setting.difficulty.insane = 미침
setting.difficulty.name = 난이도 : setting.difficulty.name = 난이도 :
setting.screenshake.name = 화면 흔들 setting.screenshake.name = 화면 흔들
setting.effects.name = 화면 효과 setting.effects.name = 효과 보임
setting.destroyedblocks.name = 부서진 블럭 표시 setting.destroyedblocks.name = 부서진 블럭 표시
setting.conveyorpathfinding.name = 교차기 자동 설치 setting.conveyorpathfinding.name = 교차기 자동 설치
setting.coreselect.name = Schematic Cores 켜기 setting.coreselect.name = Schematic Cores 켜기
@@ -687,7 +687,7 @@ public.confirm = 게임을 공개하시겠습니까?\n[lightgray]설정 - 게임
public.beta = [accent]!정보![] 베타 버전은 공개 게임 서버를 열지 못합니다. public.beta = [accent]!정보![] 베타 버전은 공개 게임 서버를 열지 못합니다.
uiscale.reset = UI 스케일이 변경되었습니다.\n"확인"버튼을 눌러 스케일을 확인하세요.\n[scarlet][accent] {0}[]초 후에 예전 설정으로 되돌리고 게임을 종료합니다... uiscale.reset = UI 스케일이 변경되었습니다.\n"확인"버튼을 눌러 스케일을 확인하세요.\n[scarlet][accent] {0}[]초 후에 예전 설정으로 되돌리고 게임을 종료합니다...
uiscale.cancel = 취소 & 나가기 uiscale.cancel = 취소 & 나가기
setting.bloom.name = 화려한 이펙트 setting.bloom.name = 빛발산 켜기
keybind.title = 조작키 설정 keybind.title = 조작키 설정
keybinds.mobile = [scarlet]대부분의 키들은 모바일에서 작동하지 않습니다. 기본적인 것들만 지원됩니다. keybinds.mobile = [scarlet]대부분의 키들은 모바일에서 작동하지 않습니다. 기본적인 것들만 지원됩니다.
category.general.name = 일반 category.general.name = 일반
@@ -751,9 +751,9 @@ keybind.drop_unit.name = 유닛 처치 시 자원획득
keybind.zoom_minimap.name = 미니맵 확대 keybind.zoom_minimap.name = 미니맵 확대
mode.help.title = 게임모드 도움말 mode.help.title = 게임모드 도움말
mode.survival.name = 생존 mode.survival.name = 생존
mode.survival.description = 이것은 일반 모드입니다. 제한된 자원을 가지고 자동으로 다음 단계가 시작됩니다. mode.survival.description = 이것은 일반 모드입니다. 제한된 자원을 가지고 자동으로 다음 웨이브가 시작됩니다.
mode.sandbox.name = 샌드박스 mode.sandbox.name = 샌드박스
mode.sandbox.description = 무한한 자원을 가지고 자유롭게 다음 단계를 시작할 수 있습니다. mode.sandbox.description = 무한한 자원을 가지고 자유롭게 다음 웨이브를 시작할 수 있습니다.
mode.editor.name = 편집기 mode.editor.name = 편집기
mode.pvp.name = PvP mode.pvp.name = PvP
mode.pvp.description = 실제 플레이어와 PvP를 합니다. 맵에 적어도 2개의 다른 색상 코어가 있어야 합니다. mode.pvp.description = 실제 플레이어와 PvP를 합니다. 맵에 적어도 2개의 다른 색상 코어가 있어야 합니다.
@@ -763,8 +763,8 @@ mode.custom = 사용자 정의 규칙
rules.infiniteresources = 무한 자원 rules.infiniteresources = 무한 자원
rules.reactorexplosions = 원자로 폭발 허가 여부 rules.reactorexplosions = 원자로 폭발 허가 여부
rules.wavetimer = 단계 대기시간 rules.wavetimer = 웨이브 대기시간
rules.waves = 단계 활성화 rules.waves = 웨이브 활성화
rules.attack = 공격 모드 rules.attack = 공격 모드
rules.enemyCheat = 무한한 적 자원 rules.enemyCheat = 무한한 적 자원
rules.unitdrops = 유닛 처치시 자원 약탈 rules.unitdrops = 유닛 처치시 자원 약탈
@@ -776,15 +776,15 @@ rules.playerdamagemultiplier = 플레이어 공격력 배수
rules.unitdamagemultiplier = 유닛 공격력 배수 rules.unitdamagemultiplier = 유닛 공격력 배수
rules.enemycorebuildradius = 적 코어 건설 금지구역 범위 : [LIGHT_GRAY] (타일) rules.enemycorebuildradius = 적 코어 건설 금지구역 범위 : [LIGHT_GRAY] (타일)
rules.respawntime = 플레이어 부활 대기 시간 : [LIGHT_GRAY] (초) rules.respawntime = 플레이어 부활 대기 시간 : [LIGHT_GRAY] (초)
rules.wavespacing = 단계 간격 : [LIGHT_GRAY] (초) rules.wavespacing = 웨이브 간격 : [LIGHT_GRAY] (초)
rules.buildcostmultiplier = 건설 소모 배수 rules.buildcostmultiplier = 건설 소모 배수
rules.buildspeedmultiplier = 건설 속도 배수 rules.buildspeedmultiplier = 건설 속도 배수
rules.deconstructrefundmultiplier = Deconstruct Refund Multiplier rules.deconstructrefundmultiplier = Deconstruct Refund Multiplier
rules.waitForWaveToEnd = 단계가 끝날때까지 기다리는 중 rules.waitForWaveToEnd = 웨이브가 끝날때까지 기다리는 중
rules.dropzoneradius = 소환 충격파 범위 : [LIGHT_GRAY] (타일) rules.dropzoneradius = 소환 충격파 범위 : [LIGHT_GRAY] (타일)
rules.respawns = 단계당 최대 플레이어 부활 횟수 rules.respawns = 웨이브당 최대 플레이어 부활 횟수
rules.limitedRespawns = 플레이어 부활 제한 rules.limitedRespawns = 플레이어 부활 제한
rules.title.waves = 단계 rules.title.waves = 웨이브
rules.title.respawns = 플레이어 부활 rules.title.respawns = 플레이어 부활
rules.title.resourcesbuilding = 자원 & 건축 rules.title.resourcesbuilding = 자원 & 건축
rules.title.player = 플레이어들 rules.title.player = 플레이어들
@@ -812,9 +812,9 @@ item.phase-fabric.name = 메타
item.surge-alloy.name = 설금 item.surge-alloy.name = 설금
item.spore-pod.name = 포자 포드 item.spore-pod.name = 포자 포드
item.sand.name = 모래 item.sand.name = 모래
item.blast-compound.name = 폭발물 item.blast-compound.name = 복합폭약
item.pyratite.name = 파이라타이트 item.pyratite.name = 라타이트
item.metaglass.name = 강화유리 item.metaglass.name = 금속유리
item.scrap.name = 고철 item.scrap.name = 고철
liquid.water.name = liquid.water.name =
liquid.slag.name = 광재 liquid.slag.name = 광재
@@ -822,7 +822,7 @@ liquid.oil.name = 석유
liquid.cryofluid.name = 냉각수 liquid.cryofluid.name = 냉각수
mech.alpha-mech.name = 알파 mech.alpha-mech.name = 알파
mech.alpha-mech.weapon = 중무장 소총 mech.alpha-mech.weapon = 중무장 소총
mech.alpha-mech.ability = 자가 mech.alpha-mech.ability = 자가
mech.delta-mech.name = 델타 mech.delta-mech.name = 델타
mech.delta-mech.weapon = 전격 충전기 mech.delta-mech.weapon = 전격 충전기
mech.delta-mech.ability = 충전 mech.delta-mech.ability = 충전
@@ -971,7 +971,7 @@ block.separator.name = 원심 분리기
block.coal-centrifuge.name = 석탄 원심분리기 block.coal-centrifuge.name = 석탄 원심분리기
block.power-node.name = 전력 노드 block.power-node.name = 전력 노드
block.power-node-large.name = 대형 전력 노드 block.power-node-large.name = 대형 전력 노드
block.surge-tower.name = 설금 타워 block.surge-tower.name = 설금 전력 타워
block.diode.name = 배터리 다이오드 block.diode.name = 배터리 다이오드
block.battery.name = 배터리 block.battery.name = 배터리
block.battery-large.name = 대형 배터리 block.battery-large.name = 대형 배터리
@@ -1001,19 +1001,19 @@ block.power-void.name = 방전장치
block.power-source.name = 전력 공급기 block.power-source.name = 전력 공급기
block.unloader.name = 언로더 block.unloader.name = 언로더
block.vault.name = 창고 block.vault.name = 창고
block.wave.name = 파도 block.wave.name = 웨이브
block.swarmer.name = block.swarmer.name = 워머
block.salvo.name = 살보 block.salvo.name = 살보
block.ripple.name = 립플 block.ripple.name = 립플
block.phase-conveyor.name = 메타 컨베이어 block.phase-conveyor.name = 메타 컨베이어
block.bridge-conveyor.name = 터널 컨베이어 block.bridge-conveyor.name = 터널 컨베이어
block.plastanium-compressor.name = 플라스터늄 압축기 block.plastanium-compressor.name = 플라스터늄 압축기
block.pyratite-mixer.name = 파이라타이트 혼합기 block.pyratite-mixer.name = 라타이트 혼합기
block.blast-mixer.name = 폭발물 혼합기 block.blast-mixer.name = 복합폭약 혼합기
block.solar-panel.name = 태양 전지판 block.solar-panel.name = 태양 전지판
block.solar-panel-large.name = 대형 태양 전지판 block.solar-panel-large.name = 대형 태양 전지판
block.oil-extractor.name = 석유 추출기 block.oil-extractor.name = 석유 추출기
block.command-center.name = 지휘소 block.command-center.name = 드론 명령센터
block.draug-factory.name = 광부 드론 공장 block.draug-factory.name = 광부 드론 공장
block.spirit-factory.name = 수리 드론 공장 block.spirit-factory.name = 수리 드론 공장
block.phantom-factory.name = 건설 드론 공장 block.phantom-factory.name = 건설 드론 공장
@@ -1024,12 +1024,12 @@ block.crawler-factory.name = 크롤러 공장
block.titan-factory.name = 타이탄 공장 block.titan-factory.name = 타이탄 공장
block.fortress-factory.name = 포트리스 공장 block.fortress-factory.name = 포트리스 공장
block.revenant-factory.name = 망령 전함 공장 block.revenant-factory.name = 망령 전함 공장
block.repair-point.name = 수리 지점 block.repair-point.name = 드론 수리 지점
block.pulse-conduit.name = 펄스 파이프 block.pulse-conduit.name = 펄스 파이프
block.plated-conduit.name = 도금된 파이프 block.plated-conduit.name = 도금된 파이프
block.phase-conduit.name = 메타 파이프 block.phase-conduit.name = 메타 파이프
block.liquid-router.name = 액체 분배기 block.liquid-router.name = 액체 분배기
block.liquid-tank.name = 탱크 block.liquid-tank.name = 액체 탱크
block.liquid-junction.name = 액체 교차기 block.liquid-junction.name = 액체 교차기
block.bridge-conduit.name = 다리 파이프 block.bridge-conduit.name = 다리 파이프
block.rotary-pump.name = 동력 펌프 block.rotary-pump.name = 동력 펌프
@@ -1039,8 +1039,8 @@ block.blast-drill.name = 압축 공기분사 드릴
block.thermal-pump.name = 화력 펌프 block.thermal-pump.name = 화력 펌프
block.thermal-generator.name = 열발전기 block.thermal-generator.name = 열발전기
block.alloy-smelter.name = 설금 제련소 block.alloy-smelter.name = 설금 제련소
block.mender.name = 소형 수리 프로젝터 block.mender.name = 수리 프로젝터
block.mend-projector.name = 수리 프로젝터 block.mend-projector.name = 대형 수리 프로젝터
block.surge-wall.name = 설금 벽 block.surge-wall.name = 설금 벽
block.surge-wall-large.name = 큰 설금 벽 block.surge-wall-large.name = 큰 설금 벽
block.cyclone.name = 사이클론 block.cyclone.name = 사이클론
@@ -1095,9 +1095,9 @@ tutorial.breaking = 설계를 방해하는 블록을 제거하기 위해서 [acc
tutorial.breaking.mobile = 설계를 방해하는 블록을 제거하기 위해서 [accent]망치 버튼을 눌러 제거모드[]로 변경하신 후, 첫번째 지점을 누른 후 드래그하여 범위를 지정한뒤 V버튼을 클릭해 블럭을 제거하세요.\n\n[accent]코어 근처의 조각벽 3개[]를 제거하세요. tutorial.breaking.mobile = 설계를 방해하는 블록을 제거하기 위해서 [accent]망치 버튼을 눌러 제거모드[]로 변경하신 후, 첫번째 지점을 누른 후 드래그하여 범위를 지정한뒤 V버튼을 클릭해 블럭을 제거하세요.\n\n[accent]코어 근처의 조각벽 3개[]를 제거하세요.
tutorial.withdraw = [accent]코어나 창고, 공장[]같은 자원을 넣을 수 있는 일부 블럭에서는 직접 자원을 빼낼 수도 있습니다.\n[accent]코어를 클릭 후 자원을 눌러서 자원을 빼내세요. tutorial.withdraw = [accent]코어나 창고, 공장[]같은 자원을 넣을 수 있는 일부 블럭에서는 직접 자원을 빼낼 수도 있습니다.\n[accent]코어를 클릭 후 자원을 눌러서 자원을 빼내세요.
tutorial.deposit = 자원을 다시 블록에 넣을 수도 있습니다.\n\n[accent]당신의 기체에서 코어로 드래그[]하여 자원을 되돌려 넣으세요. tutorial.deposit = 자원을 다시 블록에 넣을 수도 있습니다.\n\n[accent]당신의 기체에서 코어로 드래그[]하여 자원을 되돌려 넣으세요.
tutorial.waves = [LIGHT_GRAY]적[]이 접근합니다.\n당신의 기체는 적을 클릭하여 공격할 수 있습니다. 또한, 구리를 더 캐내고 포탑을 더 지어서 방어를 강화하세요.\n\n[accent]2단계 동안 코어를 보호하세요.[] tutorial.waves = [LIGHT_GRAY]적[]이 접근합니다.\n당신의 기체는 적을 클릭하여 공격할 수 있습니다. 또한, 구리를 더 캐내고 포탑을 더 지어서 방어를 강화하세요.\n\n[accent]2웨이브 동안 코어를 보호하세요.[]
tutorial.waves.mobile = [LIGHT_GRAY]적[]이 접근합니다.\n당신의 기체는 적을 자동조준하지만, 원하는 적을 클릭하여 공격하고 싶은 대상을 바꿀 수 있습니다.\n구리를 더 캐내고 포탑을 더 지어서 방어를 강화하세요.\n\n[accent]2단계동안 코어를 방어하세요.[] tutorial.waves.mobile = [LIGHT_GRAY]적[]이 접근합니다.\n당신의 기체는 적을 자동조준하지만, 원하는 적을 클릭하여 공격하고 싶은 대상을 바꿀 수 있습니다.\n구리를 더 캐내고 포탑을 더 지어서 방어를 강화하세요.\n\n[accent]2웨이브 동안 코어를 방어하세요.[]
tutorial.launch = 특정 단계에 도달하면 [accent]출격[]이 가능합니다.\n[accent]출격[]을 하게되면 해당 지역의 코어에 들어있는 자원들을 캠페인의 자원 창고로 보내지만, 해당 지역의 [accent]모든 것들[]은 날라가게 되니 주의하세요. tutorial.launch = 특정 웨이브에 도달하면 [accent]출격[]이 가능합니다.\n[accent]출격[]을 하게되면 해당 지역의 코어에 들어있는 자원들을 캠페인의 자원 창고로 보내지만, 해당 지역의 [accent]모든 것들[]은 날라가게 되니 주의하세요.
item.copper.description = 모든 종류의 블록에서 광범위하게 사용되는 자원입니다. item.copper.description = 모든 종류의 블록에서 광범위하게 사용되는 자원입니다.
item.lead.description = 쉽게 구할 수 있으며, 전자 및 액체 수송 블록에서 광범위하게 사용되는 자원입니다. item.lead.description = 쉽게 구할 수 있으며, 전자 및 액체 수송 블록에서 광범위하게 사용되는 자원입니다.
@@ -1113,7 +1113,7 @@ item.plastanium.description = 고급 항공기 및 분열 탄약에 사용되는
item.phase-fabric.description = 최첨단 전자 제품과 자기수리 기술에 사용되는 거의 무중력에 가까운 물질입니다.\n\n[royal]메타 가속하면 범위가 늘어나는 건물들이 있습니다. item.phase-fabric.description = 최첨단 전자 제품과 자기수리 기술에 사용되는 거의 무중력에 가까운 물질입니다.\n\n[royal]메타 가속하면 범위가 늘어나는 건물들이 있습니다.
item.surge-alloy.description = 순간적으로 전압이 증가하는 전기 특성을 가진 고급 합금입니다. item.surge-alloy.description = 순간적으로 전압이 증가하는 전기 특성을 가진 고급 합금입니다.
item.spore-pod.description = 석유를 만들거나 탄약과 합성해 연료로 전환하는데 사용됩니다. item.spore-pod.description = 석유를 만들거나 탄약과 합성해 연료로 전환하는데 사용됩니다.
item.blast-compound.description = 터렛 및 건설의 재료로 사용되는 휘발성 폭발물.\n연료로도 사용할 수 있지만, 별로 추천하지는 않습니다. item.blast-compound.description = 터렛 및 건설의 재료로 사용되는 휘발성 복합폭약.\n연료로도 사용할 수 있지만, 별로 추천하지는 않습니다.
item.pyratite.description = 인화성을 가진 재료로, 주로 터렛의 탄약으로 사용됩니다. item.pyratite.description = 인화성을 가진 재료로, 주로 터렛의 탄약으로 사용됩니다.
liquid.water.description = 여러 포탑을 가속하는 데 사용할 수 있고, 파도와 멜트다운의 탄약으로도 사용되며 여러 공장에서도 사용되는 무구한 가능성을 가진 액체입니다. liquid.water.description = 여러 포탑을 가속하는 데 사용할 수 있고, 파도와 멜트다운의 탄약으로도 사용되며 여러 공장에서도 사용되는 무구한 가능성을 가진 액체입니다.
liquid.slag.description = 다양한 종류의 금속들이 함께 섞여 녹아있습니다. 원심분리기를 이용해 다른 광물들로 분리하거나 탄약으로 사용해 적 부대를 향해 살포할 수 있습니다. liquid.slag.description = 다양한 종류의 금속들이 함께 섞여 녹아있습니다. 원심분리기를 이용해 다른 광물들로 분리하거나 탄약으로 사용해 적 부대를 향해 살포할 수 있습니다.
@@ -1137,18 +1137,18 @@ unit.fortress.description = 중무장 포병 지상 유닛.\n높은 공격력을
unit.eruptor.description = 지상 유닛. 광재를 넣은 파도와 같은 무기를 장착했습니다. unit.eruptor.description = 지상 유닛. 광재를 넣은 파도와 같은 무기를 장착했습니다.
unit.wraith.description = 적 핵심 건물 및 유닛을 집중적으로 공격하는 방식을 사용하는 전투기 입니다. unit.wraith.description = 적 핵심 건물 및 유닛을 집중적으로 공격하는 방식을 사용하는 전투기 입니다.
unit.ghoul.description = 무겁고 튼튼한 지상 폭격기 입니다.\n주로 적 건물로 이동하여 엄청난 폭격을 가합니다. unit.ghoul.description = 무겁고 튼튼한 지상 폭격기 입니다.\n주로 적 건물로 이동하여 엄청난 폭격을 가합니다.
unit.revenant.description = 플레이어가 생산가능한 최종 공중 전투기. 폭발물을 쓰는 스 포탑과 같은 무기를 사용합니다. unit.revenant.description = 플레이어가 생산가능한 최종 공중 전투기. 복합폭약을 쓰는 스워머 포탑과 같은 무기를 사용합니다.
block.message.description = 글을 작성할 수 있습니다. 이것을 이용하여 같은 팀과 소통을 해보세요. block.message.description = 글을 작성할 수 있습니다. 이것을 이용하여 같은 팀과 소통을 해보세요.
block.graphite-press.description = 석탄 덩어리를 흑연으로 압축합니다. block.graphite-press.description = 석탄들을 흑연으로 압축합니다.
block.multi-press.description = 흑연 압축기의 상위 버전입니다. 물과 전력을 이용해 석탄을 빠르고 효율적으로 압축합니다. block.multi-press.description = 흑연 압축기의 상위 버전입니다. 물과 전력을 이용해 석탄을 빠르고 효율적으로 압축합니다.
block.silicon-smelter.description = 석탄과 모래를 사용해 실리콘을 생산합니다. block.silicon-smelter.description = 석탄과 모래를 사용해 실리콘을 생산합니다.
block.kiln.description = 모래와 납을 사용해 강화유리를 만듭니다. 소량의 전력이 필요합니다. block.kiln.description = 모래와 납을 사용해 금속유리를 만듭니다. 소량의 전력이 필요합니다.
block.plastanium-compressor.description = 석유와 티타늄으로 플라스터늄을 생산합니다. block.plastanium-compressor.description = 석유와 티타늄으로 플라스터늄을 생산합니다.
block.phase-weaver.description = 토륨과 많은 양의 모래로 메타를 합성합니다. block.phase-weaver.description = 토륨과 많은 양의 모래로 메타를 합성합니다.
block.alloy-smelter.description = 티타늄, 납, 실리콘, 구리로 서지 합금을 생산합니다. block.alloy-smelter.description = 티타늄, 납, 실리콘, 구리로 금을 생산합니다.
block.cryofluidmixer.description = 물과 티타늄을 냉각에 훨씬 더 효과적인 냉각수로 결합시킵니다. block.cryofluidmixer.description = 물과 티타늄을 물보다 냉각이 좋은 냉각수로 결합시킵니다.
block.blast-mixer.description = 포자를 사용하여 파이라타이트를 폭발성 화합물로 변환시킵니다. block.blast-mixer.description = 포자를 사용하여 라타이트를 폭발성 화합물로 변환시킵니다.
block.pyratite-mixer.description = 석탄, 납, 모래를 가연성이 높은 파이라타이트로 만듭니다. block.pyratite-mixer.description = 석탄, 납, 모래를 가연성이 높은 라타이트로 만듭니다.
block.melter.description = 고철을 녹여 파도의 탄약 혹은 원심 분리기에 사용할 수 있는 액체인 광재로 만듭니다. block.melter.description = 고철을 녹여 파도의 탄약 혹은 원심 분리기에 사용할 수 있는 액체인 광재로 만듭니다.
block.separator.description = 광재를 각종 자원으로 재활용 할 수 있게 해 주는 건물입니다. block.separator.description = 광재를 각종 자원으로 재활용 할 수 있게 해 주는 건물입니다.
block.spore-press.description = 포자를 압축해 기름을 추출합니다. block.spore-press.description = 포자를 압축해 기름을 추출합니다.
@@ -1174,11 +1174,11 @@ block.phase-wall-large.description = 메타 벽 4개를 뭉친 블럭입니다.
block.surge-wall.description = 공격을 받으면 낮은 확률로 공격자에게 전격 공격을 합니다. block.surge-wall.description = 공격을 받으면 낮은 확률로 공격자에게 전격 공격을 합니다.
block.surge-wall-large.description = 설금 벽 4개를 뭉친 블럭입니다. block.surge-wall-large.description = 설금 벽 4개를 뭉친 블럭입니다.
block.door.description = 눌러서 열고 닫을 수 있는 문.\n만약 문이 열리면, 적들은 총을 쏘며 문을 통과할 수 있습니다. block.door.description = 눌러서 열고 닫을 수 있는 문.\n만약 문이 열리면, 적들은 총을 쏘며 문을 통과할 수 있습니다.
block.door-large.description = 4개를 뭉친 블럭입니다. block.door-large.description = 4칸의 대형문 입니다.
block.mender.description = 주변 블록들을 주기적으로 치료합니다. block.mender.description = 주변 블록들을 주기적으로 치료합니다.
block.mend-projector.description = 주변 블록들을 멘더보다 더 넓은 범위, 더 많은 회복량, 더 빠른 속도로 수리합니다. block.mend-projector.description = 수리 프로젝터보다 더 넓은 범위, 더 많은 회복량, 더 빠른 속도를 가졌습니다.
block.overdrive-projector.description = 드릴과 컨베이어와 같은 인근 건물의 속도를 높여줍니다. block.overdrive-projector.description = 드릴과 컨베이어와 같은 인근 건물의 속도를 높여줍니다.
block.force-projector.description = 육각형 보호막을 만들고, 내구도가 다 닳기 전까지 보호막 내로 들어오는 모든 공격을 방어합니다. block.force-projector.description = 육각형 보호막을 만들고, 보호막의 내구도가 다 닳기 전까지 보호막 내로 들어오는 모든 공격을 방어합니다.
block.shock-mine.description = 지뢰를 밟는 적에게 피해를 줍니다. 적에게는 거의 보이지 않습니다. 일단 설치 완료된 후에는 적 유닛이 공격하지 않습니다. 그러나 지뢰가 있는 곳은 피해가니 주의하세요. block.shock-mine.description = 지뢰를 밟는 적에게 피해를 줍니다. 적에게는 거의 보이지 않습니다. 일단 설치 완료된 후에는 적 유닛이 공격하지 않습니다. 그러나 지뢰가 있는 곳은 피해가니 주의하세요.
block.conveyor.description = 기본 자원 수송 레일. 자원을 배치된 방향을 따라 이동시켜 자동으로 건물에 넣어줍니다. block.conveyor.description = 기본 자원 수송 레일. 자원을 배치된 방향을 따라 이동시켜 자동으로 건물에 넣어줍니다.
block.titanium-conveyor.description = 고급 자원 수송 레일. 기본 컨베이어보다 자원을 더 빨리 이동시킵니다. block.titanium-conveyor.description = 고급 자원 수송 레일. 기본 컨베이어보다 자원을 더 빨리 이동시킵니다.
@@ -1199,7 +1199,7 @@ block.conduit.description = 기본 파이프\n액체를 배치된 방향으로
block.pulse-conduit.description = 고급 파이프\n기본 파이프보다 액체 운송 속도가 빠릅니다. block.pulse-conduit.description = 고급 파이프\n기본 파이프보다 액체 운송 속도가 빠릅니다.
block.plated-conduit.description = 펄스 파이프와 같은 속도로 액체를 운송시키지만, 체력이 더 많습니다. 양 옆으로는 파이프 의외의 대상에서 액체를 받지 않습니다. \n파이프 끝 부분이 블럭에 연결되지 않고 노출되었을 때 누수되는 액체의 양이 더 적습니다. block.plated-conduit.description = 펄스 파이프와 같은 속도로 액체를 운송시키지만, 체력이 더 많습니다. 양 옆으로는 파이프 의외의 대상에서 액체를 받지 않습니다. \n파이프 끝 부분이 블럭에 연결되지 않고 노출되었을 때 누수되는 액체의 양이 더 적습니다.
block.liquid-router.description = 액체를 다른 방향으로 분배할 수 있게 하는 블럭입니다. block.liquid-router.description = 액체를 다른 방향으로 분배할 수 있게 하는 블럭입니다.
block.liquid-tank.description = 액체를 저장할 수 있는 탱크 입니다. block.liquid-tank.description = 액체를 저장할 수 있는 액체 탱크 입니다.
block.liquid-junction.description = 교차기와 같은 기능을 하나 자원 대신에 액체를 교차시킵니다. block.liquid-junction.description = 교차기와 같은 기능을 하나 자원 대신에 액체를 교차시킵니다.
block.bridge-conduit.description = 액체 수송블록\n다리와 다리 사이를 연결하여 액체가 지나갈 수 있게 해 줍니다.\n\n주로 중간에 파이프 설치를 막는 장애물이 있을 때 사용합니다. block.bridge-conduit.description = 액체 수송블록\n다리와 다리 사이를 연결하여 액체가 지나갈 수 있게 해 줍니다.\n\n주로 중간에 파이프 설치를 막는 장애물이 있을 때 사용합니다.
block.phase-conduit.description = 고급 액체 수송블록\n전기를 사용하여 같은 줄의 먼 거리에 있는 다른 위상 파이프로 액체를 전달합니다. block.phase-conduit.description = 고급 액체 수송블록\n전기를 사용하여 같은 줄의 먼 거리에 있는 다른 위상 파이프로 액체를 전달합니다.
@@ -1212,19 +1212,19 @@ block.battery-large.description = 일반 배터리보다 훨씬 많은 량의
block.combustion-generator.description = 인화성 물질을 태워 소량의 전력을 생산합니다. block.combustion-generator.description = 인화성 물질을 태워 소량의 전력을 생산합니다.
block.thermal-generator.description = 열이 있는 타일 위에 건설하면 전력을 생산합니다.\n\n[ROYAL]용암 웅덩이 혹은 열기지대에서 무한정 열을 발산합니다. block.thermal-generator.description = 열이 있는 타일 위에 건설하면 전력을 생산합니다.\n\n[ROYAL]용암 웅덩이 혹은 열기지대에서 무한정 열을 발산합니다.
block.turbine-generator.description = 화력 발전기보다 효율적이지만, 액체가 추가적으로 필요합니다.\n\n[ROYAL]일반 타일에서 물추출기 1개로 2개가 가동가능합니다. block.turbine-generator.description = 화력 발전기보다 효율적이지만, 액체가 추가적으로 필요합니다.\n\n[ROYAL]일반 타일에서 물추출기 1개로 2개가 가동가능합니다.
block.differential-generator.description = 냉각수와 파이라타이트의 온도 차를 이용해 안정적으로 원자로에 버금가는 양의 전기를 생산합니다. block.differential-generator.description = 냉각수와 라타이트의 온도 차를 이용해 안정적으로 원자로에 버금가는 양의 전기를 생산합니다.
block.rtg-generator.description = 방사성동위원소 열전기 발전기\n토륨 또는 메타를 사용하며, 냉각이 필요 없는 발전을 하지만 토륨 원자로에 비해 발전량이 매우 적습니다. block.rtg-generator.description = 방사성동위원소 열전기 발전기\n토륨 또는 메타를 사용하며, 냉각이 필요 없는 발전을 하지만 토륨 원자로에 비해 발전량이 매우 적습니다.
block.solar-panel.description = 태양광으로 극소량의 전기을 생산합니다. block.solar-panel.description = 태양광으로 극소량의 전기을 생산합니다.
block.solar-panel-large.description = 일반 태양 전지판보다 훨씬 발전량이 많지만, 건축비도 훨씬 비쌉니다. block.solar-panel-large.description = 일반 태양 전지판보다 훨씬 발전량이 많지만, 건축비도 훨씬 비쌉니다.
block.thorium-reactor.description = 토륨을 이용해 막대한 양의 전기를 생산합니다. 지속적인 냉각이 필요하며 냉각제의 양이 부족하면 크게 폭발합니다.\n\n[royal]폭발로 인한 피해를 버틸 수 있는 건물은 없습니다. block.thorium-reactor.description = 토륨을 이용해 막대한 양의 전기를 생산합니다. 지속적인 냉각이 필요하며 냉각제의 양이 부족하면 크게 폭발합니다.\n\n[royal]폭발로 인한 피해를 버틸 수 있는 건물은 없습니다.
block.impact-reactor.description = 최첨단 발전기\n폭발물과 냉각수를 이용해 최고의 효율로 매우 많은 양의 전기를 생산할 수 있습니다. 발전을 시작하는 데 전기가 필요하며 발전기를 가동하는 데 시간이 많이 걸립니다.\n[royal]오버드라이브 프로젝터로 10000이상의 전기를 생산할 수 있으며, 가동중에 전기가 끊기면 가동을 다시 해야되기 때문에 창고, 물탱크, 배터리 등을 주위에 설치하고 나서 가동하는 것을 추천드립니다. block.impact-reactor.description = 최첨단 발전기\n복합폭약과 냉각수를 이용해 최고의 효율로 매우 많은 양의 전기를 생산할 수 있습니다. 발전을 시작하는 데 전기가 필요하며 발전기를 가동하는 데 시간이 많이 걸립니다.\n[royal]오버드라이브 프로젝터로 10000이상의 전기를 생산할 수 있으며, 가동중에 전기가 끊기면 가동을 다시 해야되기 때문에 창고, 물탱크, 배터리 등을 주위에 설치하고 나서 가동하는 것을 추천드립니다.
block.mechanical-drill.description = 싸구려 드릴. 적절한 타일 위에 설치되었을 때 매우 느린 속도로 채광합니다.\n\n[ROYAL]구리와 납은 채광 드론으로 대체가 가능합니다. block.mechanical-drill.description = 싸구려 드릴. 적절한 타일 위에 설치되었을 때 매우 느린 속도로 채광합니다.\n\n[ROYAL]구리와 납은 채광 드론으로 대체가 가능합니다.
block.pneumatic-drill.description = 기압을 이용하여 보다 빠르게 단단한 물질을 채광할 수 있는 향상된 드릴.\n\n[ROYAL]전기를 사용하지 않는 드릴이라도 물과 오버드라이브를 이용하여 가속할 수 있습니다. block.pneumatic-drill.description = 티타늄을 채광할 수 있는 향상된 드릴입니다. \n\n[ROYAL]전기를 사용하지 않는 드릴이라도 물과 오버드라이브를 이용하여 가속할 수 있습니다.
block.laser-drill.description = 토륨을 채광할 수 있는 고급 드릴입니다. 전력과 물을 공급하여 빠른 속도로 채광할 수 있습니다.\n\n[ROYAL]드릴 아래에 배치된 광물타일의 비율에 따라 채광량이 달라집니다. block.laser-drill.description = 토륨을 채광할 수 있는 고급 드릴입니다. 전력과 물을 공급하여 빠른 속도로 채광할 수 있습니다.\n\n[ROYAL]드릴 아래에 배치된 광물타일의 비율에 따라 채광량이 달라집니다.
block.blast-drill.description = 최상위 드릴입니다. 많은 양의 전력이 필요합니다.\n\n[ROYAL]물추출기 하나면 충분합니다. block.blast-drill.description = 최상위 드릴입니다. 많은 양의 전력이 필요합니다.\n\n[ROYAL]물추출기 하나면 충분합니다.
block.water-extractor.description = 땅에서 물을 추출합니다. 근처에 호수가 없을 때 사용하세요.\n\n[ROYAL]물추출기의 효율이 달라지는 타일이 있습니다. block.water-extractor.description = 땅에서 물을 추출합니다. 근처에 호수가 없을 때 사용하세요.\n\n[ROYAL]물추출기의 효율이 달라지는 타일이 있습니다.
block.cultivator.description = 소량의 포자를 산업용으로 사용가능한 포자로 배양하는 건물입니다. block.cultivator.description = 소량의 포자를 산업용으로 사용가능한 포자로 배양하는 건물입니다.
block.oil-extractor.description = 대량의 전력과 물을 사용하여 모래에서 석유를 추출합니다. 근처에 직접적인 석유 공급원이 없을 때 사용하세요.\n\n[royal]모래 또는 고철을 이용하여 창조경제가 가능합니다. block.oil-extractor.description = 대량의 전력과 물을 사용하여 모래에서 석유를 추출합니다. 근처에 직접적인 석유 공급원이 없을 때 사용하세요.
block.core-shard.description = 코어의 1단계 형태입니다.\n이것이 파괴되면 플레이하고 있는 지역과의 연결이 끊어지니 적의 공격에 파괴되지 않도록 주의하세요.\n[ROYAL]연결이 끊긴다는 말은 게임오버와 일맥상통합니다. block.core-shard.description = 코어의 1단계 형태입니다.\n이것이 파괴되면 플레이하고 있는 지역과의 연결이 끊어지니 적의 공격에 파괴되지 않도록 주의하세요.\n[ROYAL]연결이 끊긴다는 말은 게임오버와 일맥상통합니다.
block.core-foundation.description = 코어의 2단계 형태입니다.\n첫 번째 코어보다 더 튼튼하고 더 많은 자원을 저장할 수 있습니다.\n\n[ROYAL]크기도 좀 더 큽니다. block.core-foundation.description = 코어의 2단계 형태입니다.\n첫 번째 코어보다 더 튼튼하고 더 많은 자원을 저장할 수 있습니다.\n\n[ROYAL]크기도 좀 더 큽니다.
block.core-nucleus.description = 코어의 3단계이자 마지막 형태입니다.\n최고로 튼튼하며 막대한 양의 자원들을 저장할 수 있습니다. block.core-nucleus.description = 코어의 3단계이자 마지막 형태입니다.\n최고로 튼튼하며 막대한 양의 자원들을 저장할 수 있습니다.
@@ -1253,7 +1253,7 @@ block.spirit-factory.description = 블록을 수리하는 수리 드론을 생
block.phantom-factory.description = 건설을 도와주는 빌더 드론을 생산합니다.\n\n[ROYAL]당신의 환영입니다. block.phantom-factory.description = 건설을 도와주는 빌더 드론을 생산합니다.\n\n[ROYAL]당신의 환영입니다.
block.wraith-factory.description = 빠른 뺑소니 요격기 유닛을 생산합니다.\n\n[ROYAL]체력 자체는 무척 적습니다. block.wraith-factory.description = 빠른 뺑소니 요격기 유닛을 생산합니다.\n\n[ROYAL]체력 자체는 무척 적습니다.
block.ghoul-factory.description = 중탄두 폭격기를 생산합니다.\n\n[ROYAL]적 위를 유령처럼 맴돕니다. block.ghoul-factory.description = 중탄두 폭격기를 생산합니다.\n\n[ROYAL]적 위를 유령처럼 맴돕니다.
block.revenant-factory.description = 중량의 폭발물 스웜 포대를 가진 전함을 생산합니다.\n\n[ROYAL] block.revenant-factory.description = 중량의 복합폭약 스워머 포대를 가진 전함을 생산합니다.\n\n[ROYAL]
block.dagger-factory.description = 기본 지상 유닛을 생산합니다.\n\n[ROYAL]대거지만 단검으로 공격하진 않습니다. block.dagger-factory.description = 기본 지상 유닛을 생산합니다.\n\n[ROYAL]대거지만 단검으로 공격하진 않습니다.
block.crawler-factory.description = 자폭하는 지상 유닛을 생산합니다.\n\n[ROYAL]레일만으로도 막을 수 있습니다. block.crawler-factory.description = 자폭하는 지상 유닛을 생산합니다.\n\n[ROYAL]레일만으로도 막을 수 있습니다.
block.titan-factory.description = 화염방사기를 장착한 지상유닛를 생산합니다.\n\n[ROYAL]유닛 상대로 강력한 공격력을 보여줍니다. block.titan-factory.description = 화염방사기를 장착한 지상유닛를 생산합니다.\n\n[ROYAL]유닛 상대로 강력한 공격력을 보여줍니다.
+3 -3
View File
@@ -15,7 +15,7 @@ link.wiki.description = Wiki oficial do Mindustry
link.feathub.description = Sugira novos conteúdos link.feathub.description = Sugira novos conteúdos
linkfail = Falha ao abrir o link\nO Url foi copiado para a área de transferência. linkfail = Falha ao abrir o link\nO Url foi copiado para a área de transferência.
screenshot = Screenshot salvo para {0} screenshot = Screenshot salvo para {0}
screenshot.invalid = Mapa grande demais, você pode estar potencialmente sem memória suficiente para captura de tela. screenshot.invalid = Este mapa é grande demais, você pode estar potencialmente sem memória suficiente para captura de tela.
gameover = O núcleo foi destruído. gameover = O núcleo foi destruído.
gameover.pvp = O time[accent] {0}[] ganhou! gameover.pvp = O time[accent] {0}[] ganhou!
highscore = [YELLOW]Novo recorde! highscore = [YELLOW]Novo recorde!
@@ -99,7 +99,7 @@ committingchanges = Enviando mudanças
done = Feito done = Feito
feature.unsupported = Seu dispositivo não suporta essa função. feature.unsupported = Seu dispositivo não suporta essa função.
mods.alphainfo = Mantenha em mente que os mods estão em alpha, e[scarlet] talvez sejam bem bugados[].\nReporte quaisquer problemas no Discord ou GitHub do Mindustry. mods.alphainfo = Tenha em mente que os mods estão em alpha, e[scarlet] talvez eles contenham erros e instabilidades[].\nReporte quaisquer problemas no Discord ou GitHub do Mindustry.
mods.alpha = [accent](Alpha) mods.alpha = [accent](Alpha)
mods = Mods mods = Mods
mods.none = [LIGHT_GRAY]Nenhum mod encontrado! mods.none = [LIGHT_GRAY]Nenhum mod encontrado!
@@ -136,7 +136,7 @@ noname = Escolha[accent] um nome[] primeiro.
filename = Nome do arquivo: filename = Nome do arquivo:
unlocked = Novo bloco desbloqueado! unlocked = Novo bloco desbloqueado!
completed = [accent]Completado completed = [accent]Completado
techtree = Árvore de tecnologia techtree = Árvore Tecnológica
research.list = [LIGHT_GRAY]Pesquise: research.list = [LIGHT_GRAY]Pesquise:
research = Pesquisar research = Pesquisar
researched = [LIGHT_GRAY]{0} Pesquisado. researched = [LIGHT_GRAY]{0} Pesquisado.
+7 -7
View File
@@ -936,7 +936,7 @@ block.titanium-wall-large.name = 大型钛墙
block.plastanium-wall.name = 塑钢墙 block.plastanium-wall.name = 塑钢墙
block.plastanium-wall-large.name = 大型塑钢墙 block.plastanium-wall-large.name = 大型塑钢墙
block.phase-wall.name = 相织布墙 block.phase-wall.name = 相织布墙
block.phase-wall-large.name = 大型相织 block.phase-wall-large.name = 大型相织
block.thorium-wall.name = 钍墙 block.thorium-wall.name = 钍墙
block.thorium-wall-large.name = 大型钍墙 block.thorium-wall-large.name = 大型钍墙
block.door.name = block.door.name =
@@ -961,7 +961,7 @@ block.illuminator.description = 小型、紧凑、可配置的光源。需要能
block.overflow-gate.name = 溢流门 block.overflow-gate.name = 溢流门
block.underflow-gate.name = 反向溢流门 block.underflow-gate.name = 反向溢流门
block.silicon-smelter.name = 硅冶炼厂 block.silicon-smelter.name = 硅冶炼厂
block.phase-weaver.name = 相织编织器 block.phase-weaver.name = 相织编织器
block.pulverizer.name = 粉碎机 block.pulverizer.name = 粉碎机
block.cryofluidmixer.name = 冷冻液混合器 block.cryofluidmixer.name = 冷冻液混合器
block.melter.name = 熔炉 block.melter.name = 熔炉
@@ -971,7 +971,7 @@ block.separator.name = 分离机
block.coal-centrifuge.name = 煤炭离心机 block.coal-centrifuge.name = 煤炭离心机
block.power-node.name = 能量节点 block.power-node.name = 能量节点
block.power-node-large.name = 大型能量节点 block.power-node-large.name = 大型能量节点
block.surge-tower.name = 巨浪 block.surge-tower.name = 波动能量
block.diode.name = 二极管 block.diode.name = 二极管
block.battery.name = 电池 block.battery.name = 电池
block.battery-large.name = 大型电池 block.battery-large.name = 大型电池
@@ -1005,7 +1005,7 @@ block.wave.name = 波浪
block.swarmer.name = 蜂群 block.swarmer.name = 蜂群
block.salvo.name = 齐射炮 block.salvo.name = 齐射炮
block.ripple.name = 浪涌 block.ripple.name = 浪涌
block.phase-conveyor.name = 相织传送带桥 block.phase-conveyor.name = 相织传送带桥
block.bridge-conveyor.name = 传送带桥 block.bridge-conveyor.name = 传送带桥
block.plastanium-compressor.name = 塑钢压缩机 block.plastanium-compressor.name = 塑钢压缩机
block.pyratite-mixer.name = 硫混合器 block.pyratite-mixer.name = 硫混合器
@@ -1015,7 +1015,7 @@ block.solar-panel-large.name = 大型太阳能板
block.oil-extractor.name = 石油钻井 block.oil-extractor.name = 石油钻井
block.command-center.name = 指挥中心 block.command-center.name = 指挥中心
block.draug-factory.name = 德鲁格采矿机工厂 block.draug-factory.name = 德鲁格采矿机工厂
block.spirit-factory.name = 修理机工厂 block.spirit-factory.name = 魂修理机工厂
block.phantom-factory.name = 幻影建造机工厂 block.phantom-factory.name = 幻影建造机工厂
block.wraith-factory.name = 死灵战机工厂 block.wraith-factory.name = 死灵战机工厂
block.ghoul-factory.name = 食尸鬼轰炸机工厂 block.ghoul-factory.name = 食尸鬼轰炸机工厂
@@ -1027,7 +1027,7 @@ block.revenant-factory.name = 亡魂战机工厂
block.repair-point.name = 维修点 block.repair-point.name = 维修点
block.pulse-conduit.name = 脉冲导管 block.pulse-conduit.name = 脉冲导管
block.plated-conduit.name = 电镀导管 block.plated-conduit.name = 电镀导管
block.phase-conduit.name = 相织导管桥 block.phase-conduit.name = 相织导管桥
block.liquid-router.name = 液体路由器 block.liquid-router.name = 液体路由器
block.liquid-tank.name = 储液罐 block.liquid-tank.name = 储液罐
block.liquid-junction.name = 液体交叉器 block.liquid-junction.name = 液体交叉器
@@ -1062,7 +1062,7 @@ team.orange.name = 橙
team.derelict.name = team.derelict.name =
team.green.name = 绿 team.green.name = 绿
team.purple.name = team.purple.name =
unit.spirit.name = 修理机 unit.spirit.name = 魂修理机
unit.draug.name = 德鲁格采矿机 unit.draug.name = 德鲁格采矿机
unit.phantom.name = 幻影建造机 unit.phantom.name = 幻影建造机
unit.dagger.name = 尖刀 unit.dagger.name = 尖刀
Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

After

Width:  |  Height:  |  Size: 717 B

File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 KiB

After

Width:  |  Height:  |  Size: 762 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 KiB

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 821 KiB

After

Width:  |  Height:  |  Size: 828 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 226 KiB

+1 -1
View File
@@ -45,7 +45,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
return (Float.isNaN(result) || Float.isInfinite(result)) ? 1f : Mathf.clamp(result, 0.0001f, 60f / 10f); return (Float.isNaN(result) || Float.isInfinite(result)) ? 1f : Mathf.clamp(result, 0.0001f, 60f / 10f);
}); });
batch = new SpriteBatch(); batch = new SortedSpriteBatch();
assets = new AssetManager(); assets = new AssetManager();
assets.setLoader(Texture.class, "." + mapExtension, new MapPreviewLoader()); assets.setLoader(Texture.class, "." + mapExtension, new MapPreviewLoader());
+1 -1
View File
@@ -988,7 +988,7 @@ public class Blocks implements ContentList{
consumes.power(1.75f); consumes.power(1.75f);
}}; }};
massConveyor = new MassConveyor("mass-conveyor"){{ massConveyor = new PayloadConveyor("mass-conveyor"){{
requirements(Category.distribution, ItemStack.with(Items.copper, 1)); requirements(Category.distribution, ItemStack.with(Items.copper, 1));
}}; }};
+4 -4
View File
@@ -193,7 +193,7 @@ public class Control implements ApplicationListener, Loadable{
public void loadAsync(){ public void loadAsync(){
Draw.scl = 1f / Core.atlas.find("scale_marker").getWidth(); Draw.scl = 1f / Core.atlas.find("scale_marker").getWidth();
Core.input.setCatch(KeyCode.BACK, true); Core.input.setCatch(KeyCode.back, true);
data.load(); data.load();
@@ -400,9 +400,9 @@ public class Control implements ApplicationListener, Loadable{
}).pad(10f).expand().center(); }).pad(10f).expand().center();
dialog.buttons.defaults().size(200f, 60f); dialog.buttons.defaults().size(200f, 60f);
dialog.buttons.addButton("$uiscale.cancel", exit); dialog.buttons.button("$uiscale.cancel", exit);
dialog.buttons.addButton("$ok", () -> { dialog.buttons.button("$ok", () -> {
Core.settings.put("uiscalechanged", false); Core.settings.put("uiscalechanged", false);
settings.save(); settings.save();
dialog.hide(); dialog.hide();
@@ -494,7 +494,7 @@ public class Control implements ApplicationListener, Loadable{
Time.update(); Time.update();
} }
if(!scene.hasDialog() && !scene.root.getChildren().isEmpty() && !(scene.root.getChildren().peek() instanceof Dialog) && Core.input.keyTap(KeyCode.BACK)){ if(!scene.hasDialog() && !scene.root.getChildren().isEmpty() && !(scene.root.getChildren().peek() instanceof Dialog) && Core.input.keyTap(KeyCode.back)){
platform.hide(); platform.hide();
} }
} }
+34 -71
View File
@@ -25,7 +25,7 @@ public class Renderer implements ApplicationListener{
public final LightRenderer lights = new LightRenderer(); public final LightRenderer lights = new LightRenderer();
public final Pixelator pixelator = new Pixelator(); public final Pixelator pixelator = new Pixelator();
public FrameBuffer effectBuffer = new FrameBuffer(2, 2); public FrameBuffer effectBuffer = new FrameBuffer();
private Bloom bloom; private Bloom bloom;
private FxProcessor fx = new FxProcessor(); private FxProcessor fx = new FxProcessor();
private Color clearColor = new Color(0f, 0f, 0f, 1f); private Color clearColor = new Color(0f, 0f, 0f, 1f);
@@ -181,91 +181,56 @@ public class Renderer implements ApplicationListener{
graphics.clear(clearColor); graphics.clear(clearColor);
if(!graphics.isHidden() && (Core.settings.getBool("animatedwater") || Core.settings.getBool("animatedshields")) && (effectBuffer.getWidth() != graphics.getWidth() || effectBuffer.getHeight() != graphics.getHeight())){ //TODO 'animated water' is a bad name for this setting
if(Core.settings.getBool("animatedwater") || Core.settings.getBool("animatedshields")){
effectBuffer.resize(graphics.getWidth(), graphics.getHeight()); effectBuffer.resize(graphics.getWidth(), graphics.getHeight());
} }
Draw.proj(camera); Draw.proj(camera);
beginFx();
drawBackground();
blocks.floor.checkChanges(); blocks.floor.checkChanges();
blocks.floor.drawFloor();
Groups.drawFloor();
Groups.drawFloorOver();
blocks.processBlocks(); blocks.processBlocks();
blocks.drawShadows();
Draw.color();
blocks.floor.beginDraw(); Draw.sort(true);
blocks.floor.drawLayer(CacheLayer.walls);
blocks.floor.endDraw();
blocks.drawBlocks(Layer.block); //TODO fx
if(state.rules.drawFog){
blocks.drawFog();
}
blocks.drawDestroyed(); Draw.draw(Layer.background, this::drawBackground);
Draw.draw(Layer.floor, blocks.floor::drawFloor);
Draw.draw(Layer.block - 1, blocks::drawShadows);
Draw.draw(Layer.block, () -> {
blocks.floor.beginDraw();
blocks.floor.drawLayer(CacheLayer.walls);
blocks.floor.endDraw();
});
Draw.shader(Shaders.blockbuild, true); Draw.drawRange(Layer.blockBuilding, () -> Draw.shader(Shaders.blockbuild, false), Draw::shader);
blocks.drawBlocks(Layer.placement);
Draw.shader();
blocks.drawBlocks(Layer.overlay);
Groups.drawGroundShadows();
Groups.drawGroundUnder();
Groups.drawGround();
blocks.drawBlocks(Layer.turret);
blocks.drawBlocks(Layer.power);
blocks.drawBlocks(Layer.lights);
overlays.drawBottom();
Groups.drawFlyingShadows();
Groups.drawFlying();
Draw.flush();
if(bloom != null){
bloom.capture();
}
Groups.drawBullets();
Groups.drawEffects();
Draw.flush();
if(bloom != null){
bloom.render();
}
Groups.drawOverlays();
overlays.drawTop();
Groups.drawWeather();
endFx();
if(!pixelator.enabled()){
Groups.drawNames();
}
if(state.rules.lighting){ if(state.rules.lighting){
lights.draw(); Draw.draw(Layer.light, lights::draw);
} }
drawLanding(); if(state.rules.drawDarkness){
Draw.draw(Layer.darkness, blocks::drawDarkness);
}
Draw.color(); if(bloom != null){
Draw.draw(Layer.bullet - 0.001f, bloom::capture);
Draw.draw(Layer.effect + 0.001f, bloom::render);
}
Draw.draw(Layer.plans, overlays::drawBottom);
Draw.draw(Layer.overlayUI, overlays::drawTop);
Draw.draw(Layer.space, this::drawLanding);
blocks.drawBlocks();
Groups.draw.draw(Drawc::draw);
Draw.reset();
Draw.flush(); Draw.flush();
Draw.sort(false);
} }
private void drawBackground(){ private void drawBackground(){
@@ -322,8 +287,6 @@ public class Renderer implements ApplicationListener{
} }
public void takeMapScreenshot(){ public void takeMapScreenshot(){
Groups.drawGroundShadows();
int w = world.width() * tilesize, h = world.height() * tilesize; int w = world.width() * tilesize, h = world.height() * tilesize;
int memory = w * h * 4 / 1024 / 1024; int memory = w * h * 4 / 1024 / 1024;
+35 -30
View File
@@ -129,7 +129,7 @@ public class UI implements ApplicationListener, Loadable{
Core.scene.act(); Core.scene.act();
Core.scene.draw(); Core.scene.draw();
if(Core.input.keyTap(KeyCode.MOUSE_LEFT) && Core.scene.getKeyboardFocus() instanceof TextField){ if(Core.input.keyTap(KeyCode.mouseLeft) && Core.scene.getKeyboardFocus() instanceof TextField){
Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true); Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
if(!(e instanceof TextField)){ if(!(e instanceof TextField)){
Core.scene.setKeyboardFocus(null); Core.scene.setKeyboardFocus(null);
@@ -249,23 +249,23 @@ public class UI implements ApplicationListener, Loadable{
new Dialog(titleText){{ new Dialog(titleText){{
cont.margin(30).add(dtext).padRight(6f); cont.margin(30).add(dtext).padRight(6f);
TextFieldFilter filter = inumeric ? TextFieldFilter.digitsOnly : (f, c) -> true; TextFieldFilter filter = inumeric ? TextFieldFilter.digitsOnly : (f, c) -> true;
TextField field = cont.addField(def, t -> {}).size(330f, 50f).get(); TextField field = cont.field(def, t -> {}).size(330f, 50f).get();
field.setFilter((f, c) -> field.getText().length() < textLength && filter.acceptChar(f, c)); field.setFilter((f, c) -> field.getText().length() < textLength && filter.acceptChar(f, c));
buttons.defaults().size(120, 54).pad(4); buttons.defaults().size(120, 54).pad(4);
buttons.addButton("$ok", () -> { buttons.button("$ok", () -> {
confirmed.get(field.getText()); confirmed.get(field.getText());
hide(); hide();
}).disabled(b -> field.getText().isEmpty()); }).disabled(b -> field.getText().isEmpty());
buttons.addButton("$cancel", this::hide); buttons.button("$cancel", this::hide);
keyDown(KeyCode.ENTER, () -> { keyDown(KeyCode.enter, () -> {
String text = field.getText(); String text = field.getText();
if(!text.isEmpty()){ if(!text.isEmpty()){
confirmed.get(text); confirmed.get(text);
hide(); hide();
} }
}); });
keyDown(KeyCode.ESCAPE, this::hide); keyDown(KeyCode.escape, this::hide);
keyDown(KeyCode.BACK, this::hide); keyDown(KeyCode.back, this::hide);
show(); show();
Core.scene.setKeyboardFocus(field); Core.scene.setKeyboardFocus(field);
field.setCursorPosition(def.length()); field.setCursorPosition(def.length());
@@ -328,6 +328,7 @@ public class UI implements ApplicationListener, Loadable{
Vec2 v = Core.camera.project(worldx, worldy); Vec2 v = Core.camera.project(worldx, worldy);
t.setPosition(v.x, v.y, Align.center); t.setPosition(v.x, v.y, Align.center);
}); });
table.act(0f);
//make sure it's at the back //make sure it's at the back
Core.scene.root.addChildAt(0, table); Core.scene.root.addChildAt(0, table);
} }
@@ -336,7 +337,7 @@ public class UI implements ApplicationListener, Loadable{
new Dialog(""){{ new Dialog(""){{
getCell(cont).growX(); getCell(cont).growX();
cont.margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center); cont.margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
buttons.addButton("$ok", this::hide).size(110, 50).pad(4); buttons.button("$ok", this::hide).size(110, 50).pad(4);
}}.show(); }}.show();
} }
@@ -346,11 +347,11 @@ public class UI implements ApplicationListener, Loadable{
cont.margin(15f); cont.margin(15f);
cont.add("$error.title"); cont.add("$error.title");
cont.row(); cont.row();
cont.addImage().width(300f).pad(2).height(4f).color(Color.scarlet); cont.image().width(300f).pad(2).height(4f).color(Color.scarlet);
cont.row(); cont.row();
cont.add(text).pad(2f).growX().wrap().get().setAlignment(Align.center); cont.add(text).pad(2f).growX().wrap().get().setAlignment(Align.center);
cont.row(); cont.row();
cont.addButton("$ok", this::hide).size(120, 50).pad(4); cont.button("$ok", this::hide).size(120, 50).pad(4);
}}.show(); }}.show();
} }
@@ -367,15 +368,15 @@ public class UI implements ApplicationListener, Loadable{
cont.margin(15); cont.margin(15);
cont.add("$error.title").colspan(2); cont.add("$error.title").colspan(2);
cont.row(); cont.row();
cont.addImage().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet); cont.image().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet);
cont.row(); cont.row();
cont.add((text.startsWith("$") ? Core.bundle.get(text.substring(1)) : text) + (message == null ? "" : "\n[lightgray](" + message + ")")).colspan(2).wrap().growX().center().get().setAlignment(Align.center); cont.add((text.startsWith("$") ? Core.bundle.get(text.substring(1)) : text) + (message == null ? "" : "\n[lightgray](" + message + ")")).colspan(2).wrap().growX().center().get().setAlignment(Align.center);
cont.row(); cont.row();
Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(Strings.parseException(exc, true)).color(Color.lightGray).left()), true); Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(Strings.parseException(exc, true)).color(Color.lightGray).left()), true);
cont.addButton("$details", Styles.togglet, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().right(); cont.button("$details", Styles.togglet, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().right();
cont.addButton("$ok", this::hide).size(110, 50).fillX().left(); cont.button("$ok", this::hide).size(110, 50).fillX().left();
cont.row(); cont.row();
cont.add(col).colspan(2).pad(2); cont.add(col).colspan(2).pad(2);
}}.show(); }}.show();
@@ -389,7 +390,7 @@ public class UI implements ApplicationListener, Loadable{
cont.margin(15); cont.margin(15);
cont.add("$error.title").colspan(2); cont.add("$error.title").colspan(2);
cont.row(); cont.row();
cont.addImage().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet); cont.image().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet);
cont.row(); cont.row();
cont.add(text).colspan(2).wrap().growX().center().get().setAlignment(Align.center); cont.add(text).colspan(2).wrap().growX().center().get().setAlignment(Align.center);
cont.row(); cont.row();
@@ -401,14 +402,14 @@ public class UI implements ApplicationListener, Loadable{
Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(details).color(Color.lightGray).left()), true); Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(details).color(Color.lightGray).left()), true);
cont.add(btext).right(); cont.add(btext).right();
cont.addButton("$details", Styles.togglet, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().left(); cont.button("$details", Styles.togglet, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().left();
cont.row(); cont.row();
cont.add(col).colspan(2).pad(2); cont.add(col).colspan(2).pad(2);
cont.row(); cont.row();
} }
//}).colspan(2); //}).colspan(2);
cont.addButton("$ok", this::hide).size(300, 50).fillX().colspan(2); cont.button("$ok", this::hide).size(300, 50).fillX().colspan(2);
}}.show(); }}.show();
} }
@@ -419,18 +420,18 @@ public class UI implements ApplicationListener, Loadable{
public void showText(String titleText, String text, int align){ public void showText(String titleText, String text, int align){
new Dialog(titleText){{ new Dialog(titleText){{
cont.row(); cont.row();
cont.addImage().width(400f).pad(2).colspan(2).height(4f).color(Pal.accent); cont.image().width(400f).pad(2).colspan(2).height(4f).color(Pal.accent);
cont.row(); cont.row();
cont.add(text).width(400f).wrap().get().setAlignment(align, align); cont.add(text).width(400f).wrap().get().setAlignment(align, align);
cont.row(); cont.row();
buttons.addButton("$ok", this::hide).size(110, 50).pad(4); buttons.button("$ok", this::hide).size(110, 50).pad(4);
}}.show(); }}.show();
} }
public void showInfoText(String titleText, String text){ public void showInfoText(String titleText, String text){
new Dialog(titleText){{ new Dialog(titleText){{
cont.margin(15).add(text).width(400f).wrap().left().get().setAlignment(Align.left, Align.left); cont.margin(15).add(text).width(400f).wrap().left().get().setAlignment(Align.left, Align.left);
buttons.addButton("$ok", this::hide).size(110, 50).pad(4); buttons.button("$ok", this::hide).size(110, 50).pad(4);
}}.show(); }}.show();
} }
@@ -438,8 +439,8 @@ public class UI implements ApplicationListener, Loadable{
new Dialog(titleText){{ new Dialog(titleText){{
cont.margin(10).add(text); cont.margin(10).add(text);
titleTable.row(); titleTable.row();
titleTable.addImage().color(Pal.accent).height(3f).growX().pad(2f); titleTable.image().color(Pal.accent).height(3f).growX().pad(2f);
buttons.addButton("$ok", this::hide).size(110, 50).pad(4); buttons.button("$ok", this::hide).size(110, 50).pad(4);
}}.show(); }}.show();
} }
@@ -452,8 +453,8 @@ public class UI implements ApplicationListener, Loadable{
dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center); dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
dialog.buttons.defaults().size(200f, 54f).pad(2f); dialog.buttons.defaults().size(200f, 54f).pad(2f);
dialog.setFillParent(false); dialog.setFillParent(false);
dialog.buttons.addButton("$cancel", dialog::hide); dialog.buttons.button("$cancel", dialog::hide);
dialog.buttons.addButton("$ok", () -> { dialog.buttons.button("$ok", () -> {
dialog.hide(); dialog.hide();
confirmed.run(); confirmed.run();
}); });
@@ -464,8 +465,12 @@ public class UI implements ApplicationListener, Loadable{
} }
}); });
} }
dialog.keyDown(KeyCode.ESCAPE, dialog::hide); dialog.keyDown(KeyCode.enter, () -> {
dialog.keyDown(KeyCode.BACK, dialog::hide); dialog.hide();
confirmed.run();
});
dialog.keyDown(KeyCode.escape, dialog::hide);
dialog.keyDown(KeyCode.back, dialog::hide);
dialog.show(); dialog.show();
} }
@@ -474,16 +479,16 @@ public class UI implements ApplicationListener, Loadable{
dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center); dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
dialog.buttons.defaults().size(200f, 54f).pad(2f); dialog.buttons.defaults().size(200f, 54f).pad(2f);
dialog.setFillParent(false); dialog.setFillParent(false);
dialog.buttons.addButton(no, () -> { dialog.buttons.button(no, () -> {
dialog.hide(); dialog.hide();
denied.run(); denied.run();
}); });
dialog.buttons.addButton(yes, () -> { dialog.buttons.button(yes, () -> {
dialog.hide(); dialog.hide();
confirmed.run(); confirmed.run();
}); });
dialog.keyDown(KeyCode.ESCAPE, dialog::hide); dialog.keyDown(KeyCode.escape, dialog::hide);
dialog.keyDown(KeyCode.BACK, dialog::hide); dialog.keyDown(KeyCode.back, dialog::hide);
dialog.show(); dialog.show();
} }
@@ -492,7 +497,7 @@ public class UI implements ApplicationListener, Loadable{
dialog.cont.add(text).width(500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center); dialog.cont.add(text).width(500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
dialog.buttons.defaults().size(200f, 54f).pad(2f); dialog.buttons.defaults().size(200f, 54f).pad(2f);
dialog.setFillParent(false); dialog.setFillParent(false);
dialog.buttons.addButton("$ok", () -> { dialog.buttons.button("$ok", () -> {
dialog.hide(); dialog.hide();
confirmed.run(); confirmed.run();
}); });
+28 -28
View File
@@ -66,28 +66,28 @@ public class MapEditorDialog extends Dialog implements Disposable{
menu.cont.table(t -> { menu.cont.table(t -> {
t.defaults().size(swidth, 60f).padBottom(5).padRight(5).padLeft(5); t.defaults().size(swidth, 60f).padBottom(5).padRight(5).padLeft(5);
t.addImageTextButton("$editor.savemap", Icon.save, this::save); t.button("$editor.savemap", Icon.save, this::save);
t.addImageTextButton("$editor.mapinfo", Icon.pencil, () -> { t.button("$editor.mapinfo", Icon.pencil, () -> {
infoDialog.show(); infoDialog.show();
menu.hide(); menu.hide();
}); });
t.row(); t.row();
t.addImageTextButton("$editor.generate", Icon.terrain, () -> { t.button("$editor.generate", Icon.terrain, () -> {
generateDialog.show(generateDialog::applyToEditor); generateDialog.show(generateDialog::applyToEditor);
menu.hide(); menu.hide();
}); });
t.addImageTextButton("$editor.resize", Icon.resize, () -> { t.button("$editor.resize", Icon.resize, () -> {
resizeDialog.show(); resizeDialog.show();
menu.hide(); menu.hide();
}); });
t.row(); t.row();
t.addImageTextButton("$editor.import", Icon.download, () -> createDialog("$editor.import", t.button("$editor.import", Icon.download, () -> createDialog("$editor.import",
"$editor.importmap", "$editor.importmap.description", Icon.download, (Runnable)loadDialog::show, "$editor.importmap", "$editor.importmap.description", Icon.download, (Runnable)loadDialog::show,
"$editor.importfile", "$editor.importfile.description", Icon.file, (Runnable)() -> "$editor.importfile", "$editor.importfile.description", Icon.file, (Runnable)() ->
platform.showFileChooser(true, mapExtension, file -> ui.loadAnd(() -> { platform.showFileChooser(true, mapExtension, file -> ui.loadAnd(() -> {
@@ -114,7 +114,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
}))) })))
); );
t.addImageTextButton("$editor.export", Icon.upload, () -> createDialog("$editor.export", t.button("$editor.export", Icon.upload, () -> createDialog("$editor.export",
"$editor.exportfile", "$editor.exportfile.description", Icon.file, "$editor.exportfile", "$editor.exportfile.description", Icon.file,
(Runnable)() -> platform.export(editor.getTags().get("name", "unknown"), mapExtension, file -> MapIO.writeMap(file, editor.createMap(file))), (Runnable)() -> platform.export(editor.getTags().get("name", "unknown"), mapExtension, file -> MapIO.writeMap(file, editor.createMap(file))),
"$editor.exportimage", "$editor.exportimage.description", Icon.fileImage, "$editor.exportimage", "$editor.exportimage.description", Icon.fileImage,
@@ -128,7 +128,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
menu.cont.row(); menu.cont.row();
if(steam){ if(steam){
menu.cont.addImageTextButton("$editor.publish.workshop", Icon.link, () -> { menu.cont.button("$editor.publish.workshop", Icon.link, () -> {
Map builtin = maps.all().find(m -> m.name().equals(editor.getTags().get("name", "").trim())); Map builtin = maps.all().find(m -> m.name().equals(editor.getTags().get("name", "").trim()));
if(editor.getTags().containsKey("steamid") && builtin != null && !builtin.custom){ if(editor.getTags().containsKey("steamid") && builtin != null && !builtin.custom){
@@ -161,11 +161,11 @@ public class MapEditorDialog extends Dialog implements Disposable{
menu.cont.row(); menu.cont.row();
} }
menu.cont.addImageTextButton("$editor.ingame", Icon.right, this::playtest).padTop(!steam ? -3 : 1).size(swidth * 2f + 10, 60f); menu.cont.button("$editor.ingame", Icon.right, this::playtest).padTop(!steam ? -3 : 1).size(swidth * 2f + 10, 60f);
menu.cont.row(); menu.cont.row();
menu.cont.addImageTextButton("$quit", Icon.exit, () -> { menu.cont.button("$quit", Icon.exit, () -> {
tryExit(); tryExit();
menu.hide(); menu.hide();
}).size(swidth * 2f + 10, 60f); }).size(swidth * 2f + 10, 60f);
@@ -321,14 +321,14 @@ public class MapEditorDialog extends Dialog implements Disposable{
Drawable iconname = (Drawable)arguments[i + 2]; Drawable iconname = (Drawable)arguments[i + 2];
Runnable listenable = (Runnable)arguments[i + 3]; Runnable listenable = (Runnable)arguments[i + 3];
TextButton button = dialog.cont.addButton(name, () -> { TextButton button = dialog.cont.button(name, () -> {
listenable.run(); listenable.run();
dialog.hide(); dialog.hide();
menu.hide(); menu.hide();
}).left().margin(0).get(); }).left().margin(0).get();
button.clearChildren(); button.clearChildren();
button.addImage(iconname).padLeft(10); button.image(iconname).padLeft(10);
button.table(t -> { button.table(t -> {
t.add(name).growX().wrap(); t.add(name).growX().wrap();
t.row(); t.row();
@@ -419,7 +419,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
button.clicked(l -> { button.clicked(l -> {
if(!mobile){ if(!mobile){
//desktop: rightclick //desktop: rightclick
l.setButton(KeyCode.MOUSE_RIGHT); l.setButton(KeyCode.mouseRight);
} }
}, e -> { }, e -> {
//need to double tap //need to double tap
@@ -438,7 +438,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
int mode = i; int mode = i;
String name = tool.altModes[i]; String name = tool.altModes[i];
table.addButton(b -> { table.button(b -> {
b.left(); b.left();
b.marginLeft(6); b.marginLeft(6);
b.setStyle(Styles.clearTogglet); b.setStyle(Styles.clearTogglet);
@@ -481,16 +481,16 @@ public class MapEditorDialog extends Dialog implements Disposable{
tools.defaults().size(size, size); tools.defaults().size(size, size);
tools.addImageButton(Icon.menu, Styles.cleari, menu::show); tools.button(Icon.menu, Styles.cleari, menu::show);
ImageButton grid = tools.addImageButton(Icon.grid, Styles.clearTogglei, () -> view.setGrid(!view.isGrid())).get(); ImageButton grid = tools.button(Icon.grid, Styles.clearTogglei, () -> view.setGrid(!view.isGrid())).get();
addTool.get(EditorTool.zoom); addTool.get(EditorTool.zoom);
tools.row(); tools.row();
ImageButton undo = tools.addImageButton(Icon.undo, Styles.cleari, editor::undo).get(); ImageButton undo = tools.button(Icon.undo, Styles.cleari, editor::undo).get();
ImageButton redo = tools.addImageButton(Icon.redo, Styles.cleari, editor::redo).get(); ImageButton redo = tools.button(Icon.redo, Styles.cleari, editor::redo).get();
addTool.get(EditorTool.pick); addTool.get(EditorTool.pick);
@@ -512,7 +512,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
addTool.get(EditorTool.fill); addTool.get(EditorTool.fill);
addTool.get(EditorTool.spray); addTool.get(EditorTool.spray);
ImageButton rotate = tools.addImageButton(Icon.right, Styles.cleari, () -> editor.rotation = (editor.rotation + 1) % 4).get(); ImageButton rotate = tools.button(Icon.right, Styles.cleari, () -> editor.rotation = (editor.rotation + 1) % 4).get();
rotate.getImage().update(() -> { rotate.getImage().update(() -> {
rotate.getImage().setRotation(editor.rotation * 90); rotate.getImage().setRotation(editor.rotation * 90);
rotate.getImage().setOrigin(Align.center); rotate.getImage().setOrigin(Align.center);
@@ -576,14 +576,14 @@ public class MapEditorDialog extends Dialog implements Disposable{
if(Core.input.ctrl()){ if(Core.input.ctrl()){
//alt mode select //alt mode select
for(int i = 0; i < view.getTool().altModes.length + 1; i++){ for(int i = 0; i < view.getTool().altModes.length + 1; i++){
if(Core.input.keyTap(KeyCode.valueOf("NUM_" + (i + 1)))){ if(Core.input.keyTap(KeyCode.valueOf("num" + (i + 1)))){
view.getTool().mode = i - 1; view.getTool().mode = i - 1;
} }
} }
}else{ }else{
//tool select //tool select
for(int i = 0; i < EditorTool.values().length; i++){ for(int i = 0; i < EditorTool.values().length; i++){
if(Core.input.keyTap(KeyCode.valueOf("NUM_" + (i + 1)))){ if(Core.input.keyTap(KeyCode.valueOf("num" + (i + 1)))){
view.setTool(EditorTool.values()[i]); view.setTool(EditorTool.values()[i]);
break; break;
} }
@@ -591,28 +591,28 @@ public class MapEditorDialog extends Dialog implements Disposable{
} }
if(Core.input.keyTap(KeyCode.ESCAPE)){ if(Core.input.keyTap(KeyCode.escape)){
if(!menu.isShown()){ if(!menu.isShown()){
menu.show(); menu.show();
} }
} }
if(Core.input.keyTap(KeyCode.R)){ if(Core.input.keyTap(KeyCode.r)){
editor.rotation = Mathf.mod(editor.rotation + 1, 4); editor.rotation = Mathf.mod(editor.rotation + 1, 4);
} }
if(Core.input.keyTap(KeyCode.E)){ if(Core.input.keyTap(KeyCode.e)){
editor.rotation = Mathf.mod(editor.rotation - 1, 4); editor.rotation = Mathf.mod(editor.rotation - 1, 4);
} }
//ctrl keys (undo, redo, save) //ctrl keys (undo, redo, save)
if(Core.input.ctrl()){ if(Core.input.ctrl()){
if(Core.input.keyTap(KeyCode.Z)){ if(Core.input.keyTap(KeyCode.z)){
editor.undo(); editor.undo();
} }
//more undocumented features, fantastic //more undocumented features, fantastic
if(Core.input.keyTap(KeyCode.T)){ if(Core.input.keyTap(KeyCode.t)){
//clears all 'decoration' from the map //clears all 'decoration' from the map
for(int x = 0; x < editor.width(); x++){ for(int x = 0; x < editor.width(); x++){
@@ -633,15 +633,15 @@ public class MapEditorDialog extends Dialog implements Disposable{
editor.flushOp(); editor.flushOp();
} }
if(Core.input.keyTap(KeyCode.Y)){ if(Core.input.keyTap(KeyCode.y)){
editor.redo(); editor.redo();
} }
if(Core.input.keyTap(KeyCode.S)){ if(Core.input.keyTap(KeyCode.s)){
save(); save();
} }
if(Core.input.keyTap(KeyCode.G)){ if(Core.input.keyTap(KeyCode.g)){
view.setGrid(!view.isGrid()); view.setGrid(!view.isGrid());
} }
} }
@@ -66,27 +66,27 @@ public class MapGenerateDialog extends FloatingDialog{
shown(this::setup); shown(this::setup);
addCloseButton(); addCloseButton();
if(applied){ if(applied){
buttons.addButton("$editor.apply", () -> { buttons.button("$editor.apply", () -> {
ui.loadAnd(() -> { ui.loadAnd(() -> {
apply(); apply();
hide(); hide();
}); });
}).size(160f, 64f); }).size(160f, 64f);
}else{ }else{
buttons.addButton("$settings.reset", () -> { buttons.button("$settings.reset", () -> {
filters.set(maps.readFilters("")); filters.set(maps.readFilters(""));
rebuildFilters(); rebuildFilters();
update(); update();
}).size(160f, 64f); }).size(160f, 64f);
} }
buttons.addButton("$editor.randomize", () -> { buttons.button("$editor.randomize", () -> {
for(GenerateFilter filter : filters){ for(GenerateFilter filter : filters){
filter.randomize(); filter.randomize();
} }
update(); update();
}).size(160f, 64f); }).size(160f, 64f);
buttons.addImageTextButton("$add", Icon.add, this::showAdd).height(64f).width(140f); buttons.button("$add", Icon.add, this::showAdd).height(64f).width(140f);
if(!applied){ if(!applied){
hidden(this::apply); hidden(this::apply);
@@ -234,24 +234,24 @@ public class MapGenerateDialog extends FloatingDialog{
t.table(b -> { t.table(b -> {
ImageButtonStyle style = Styles.cleari; ImageButtonStyle style = Styles.cleari;
b.defaults().size(50f); b.defaults().size(50f);
b.addImageButton(Icon.refresh, style, () -> { b.button(Icon.refresh, style, () -> {
filter.randomize(); filter.randomize();
update(); update();
}); });
b.addImageButton(Icon.upOpen, style, () -> { b.button(Icon.upOpen, style, () -> {
int idx = filters.indexOf(filter); int idx = filters.indexOf(filter);
filters.swap(idx, Math.max(0, idx - 1)); filters.swap(idx, Math.max(0, idx - 1));
rebuildFilters(); rebuildFilters();
update(); update();
}); });
b.addImageButton(Icon.downOpen, style, () -> { b.button(Icon.downOpen, style, () -> {
int idx = filters.indexOf(filter); int idx = filters.indexOf(filter);
filters.swap(idx, Math.min(filters.size - 1, idx + 1)); filters.swap(idx, Math.min(filters.size - 1, idx + 1));
rebuildFilters(); rebuildFilters();
update(); update();
}); });
b.addImageButton(Icon.trash, style, () -> { b.button(Icon.trash, style, () -> {
filters.remove(filter); filters.remove(filter);
rebuildFilters(); rebuildFilters();
update(); update();
@@ -293,7 +293,7 @@ public class MapGenerateDialog extends FloatingDialog{
if((!applied && filter.isBuffered()) || (filter.isPost() && applied)) continue; if((!applied && filter.isBuffered()) || (filter.isPost() && applied)) continue;
selection.cont.addButton(filter.name(), () -> { selection.cont.button(filter.name(), () -> {
filters.add(filter); filters.add(filter);
rebuildFilters(); rebuildFilters();
update(); update();
@@ -302,7 +302,7 @@ public class MapGenerateDialog extends FloatingDialog{
if(++i % 2 == 0) selection.cont.row(); if(++i % 2 == 0) selection.cont.row();
} }
selection.cont.addButton("$filter.defaultores", () -> { selection.cont.button("$filter.defaultores", () -> {
maps.addDefaultOres(filters); maps.addDefaultOres(filters);
rebuildFilters(); rebuildFilters();
update(); update();
+6 -6
View File
@@ -35,7 +35,7 @@ public class MapInfoDialog extends FloatingDialog{
t.add("$editor.mapname").padRight(8).left(); t.add("$editor.mapname").padRight(8).left();
t.defaults().padTop(15); t.defaults().padTop(15);
TextField name = t.addField(tags.get("name", ""), text -> { TextField name = t.field(tags.get("name", ""), text -> {
tags.put("name", text); tags.put("name", text);
}).size(400, 55f).get(); }).size(400, 55f).get();
name.setMessageText("$unknown"); name.setMessageText("$unknown");
@@ -43,14 +43,14 @@ public class MapInfoDialog extends FloatingDialog{
t.row(); t.row();
t.add("$editor.description").padRight(8).left(); t.add("$editor.description").padRight(8).left();
TextArea description = t.addArea(tags.get("description", ""), Styles.areaField, text -> { TextArea description = t.area(tags.get("description", ""), Styles.areaField, text -> {
tags.put("description", text); tags.put("description", text);
}).size(400f, 140f).get(); }).size(400f, 140f).get();
t.row(); t.row();
t.add("$editor.author").padRight(8).left(); t.add("$editor.author").padRight(8).left();
TextField author = t.addField(tags.get("author", Core.settings.getString("mapAuthor", "")), text -> { TextField author = t.field(tags.get("author", Core.settings.getString("mapAuthor", "")), text -> {
tags.put("author", text); tags.put("author", text);
Core.settings.put("mapAuthor", text); Core.settings.put("mapAuthor", text);
Core.settings.save(); Core.settings.save();
@@ -59,21 +59,21 @@ public class MapInfoDialog extends FloatingDialog{
t.row(); t.row();
t.add("$editor.rules").padRight(8).left(); t.add("$editor.rules").padRight(8).left();
t.addButton("$edit", () -> { t.button("$edit", () -> {
ruleInfo.show(Vars.state.rules, () -> Vars.state.rules = new Rules()); ruleInfo.show(Vars.state.rules, () -> Vars.state.rules = new Rules());
hide(); hide();
}).left().width(200f); }).left().width(200f);
t.row(); t.row();
t.add("$editor.waves").padRight(8).left(); t.add("$editor.waves").padRight(8).left();
t.addButton("$edit", () -> { t.button("$edit", () -> {
waveInfo.show(); waveInfo.show();
hide(); hide();
}).left().width(200f); }).left().width(200f);
t.row(); t.row();
t.add("$editor.generation").padRight(8).left(); t.add("$editor.generation").padRight(8).left();
t.addButton("$edit", () -> { t.button("$edit", () -> {
generate.show(Vars.maps.readFilters(editor.getTags().get("genfilters", "")), generate.show(Vars.maps.readFilters(editor.getTags().get("genfilters", "")),
filters -> editor.getTags().put("genfilters", JsonIO.write(filters))); filters -> editor.getTags().put("genfilters", JsonIO.write(filters)));
hide(); hide();
+1 -1
View File
@@ -28,7 +28,7 @@ public class MapLoadDialog extends FloatingDialog{
}); });
buttons.defaults().size(200f, 50f); buttons.defaults().size(200f, 50f);
buttons.addButton("$cancel", this::hide); buttons.button("$cancel", this::hide);
buttons.add(button); buttons.add(button);
} }
@@ -22,7 +22,7 @@ public class MapResizeDialog extends FloatingDialog{
for(boolean w : Mathf.booleans){ for(boolean w : Mathf.booleans){
table.add(w ? "$width" : "$height").padRight(8f); table.add(w ? "$width" : "$height").padRight(8f);
table.defaults().height(60f).padTop(8); table.defaults().height(60f).padTop(8);
table.addButton("<", () -> { table.button("<", () -> {
if(w) if(w)
width = move(width, -1); width = move(width, -1);
else else
@@ -31,7 +31,7 @@ public class MapResizeDialog extends FloatingDialog{
table.table(Tex.button, t -> t.label(() -> (w ? width : height) + "")).width(200); table.table(Tex.button, t -> t.label(() -> (w ? width : height) + "")).width(200);
table.addButton(">", () -> { table.button(">", () -> {
if(w) if(w)
width = move(width, 1); width = move(width, 1);
else else
@@ -45,8 +45,8 @@ public class MapResizeDialog extends FloatingDialog{
}); });
buttons.defaults().size(200f, 50f); buttons.defaults().size(200f, 50f);
buttons.addButton("$cancel", this::hide); buttons.button("$cancel", this::hide);
buttons.addButton("$ok", () -> { buttons.button("$ok", () -> {
cons.get(width, height); cons.get(width, height);
hide(); hide();
}); });
+1 -1
View File
@@ -38,7 +38,7 @@ public class MapSaveDialog extends FloatingDialog{
}); });
buttons.defaults().size(200f, 50f).pad(2f); buttons.defaults().size(200f, 50f).pad(2f);
buttons.addButton("$cancel", this::hide); buttons.button("$cancel", this::hide);
TextButton button = new TextButton("$save"); TextButton button = new TextButton("$save");
button.clicked(() -> { button.clicked(() -> {
+8 -8
View File
@@ -72,11 +72,11 @@ public class MapView extends Element implements GestureListener{
return false; return false;
} }
if(!mobile && button != KeyCode.MOUSE_LEFT && button != KeyCode.MOUSE_MIDDLE){ if(!mobile && button != KeyCode.mouseLeft && button != KeyCode.mouseMiddle){
return true; return true;
} }
if(button == KeyCode.MOUSE_MIDDLE){ if(button == KeyCode.mouseMiddle){
lastTool = tool; lastTool = tool;
tool = EditorTool.zoom; tool = EditorTool.zoom;
} }
@@ -102,7 +102,7 @@ public class MapView extends Element implements GestureListener{
@Override @Override
public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){ public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){
if(!mobile && button != KeyCode.MOUSE_LEFT && button != KeyCode.MOUSE_MIDDLE){ if(!mobile && button != KeyCode.mouseLeft && button != KeyCode.mouseMiddle){
return; return;
} }
@@ -117,7 +117,7 @@ public class MapView extends Element implements GestureListener{
editor.flushOp(); editor.flushOp();
if(button == KeyCode.MOUSE_MIDDLE && lastTool != null){ if(button == KeyCode.mouseMiddle && lastTool != null){
tool = lastTool; tool = lastTool;
lastTool = null; lastTool = null;
} }
@@ -172,26 +172,26 @@ public class MapView extends Element implements GestureListener{
public void act(float delta){ public void act(float delta){
super.act(delta); super.act(delta);
if(Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField) && !Core.input.keyDown(KeyCode.CONTROL_LEFT)){ if(Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField) && !Core.input.keyDown(KeyCode.controlLeft)){
float ax = Core.input.axis(Binding.move_x); float ax = Core.input.axis(Binding.move_x);
float ay = Core.input.axis(Binding.move_y); float ay = Core.input.axis(Binding.move_y);
offsetx -= ax * 15f / zoom; offsetx -= ax * 15f / zoom;
offsety -= ay * 15f / zoom; offsety -= ay * 15f / zoom;
} }
if(Core.input.keyTap(KeyCode.SHIFT_LEFT)){ if(Core.input.keyTap(KeyCode.shiftLeft)){
lastTool = tool; lastTool = tool;
tool = EditorTool.pick; tool = EditorTool.pick;
} }
if(Core.input.keyRelease(KeyCode.SHIFT_LEFT) && lastTool != null){ if(Core.input.keyRelease(KeyCode.shiftLeft) && lastTool != null){
tool = lastTool; tool = lastTool;
lastTool = null; lastTool = null;
} }
if(Core.scene.getScrollFocus() != this) return; if(Core.scene.getScrollFocus() != this) return;
zoom += Core.input.axis(KeyCode.SCROLL) / 10f * zoom; zoom += Core.input.axis(KeyCode.scroll) / 10f * zoom;
clampZoom(); clampZoom();
} }
+20 -20
View File
@@ -42,24 +42,24 @@ public class WaveInfoDialog extends FloatingDialog{
}); });
keyDown(key -> { keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){ if(key == KeyCode.escape || key == KeyCode.back){
Core.app.post(this::hide); Core.app.post(this::hide);
} }
}); });
addCloseButton(); addCloseButton();
buttons.addButton("$waves.edit", () -> { buttons.button("$waves.edit", () -> {
FloatingDialog dialog = new FloatingDialog("$waves.edit"); FloatingDialog dialog = new FloatingDialog("$waves.edit");
dialog.addCloseButton(); dialog.addCloseButton();
dialog.setFillParent(false); dialog.setFillParent(false);
dialog.cont.defaults().size(210f, 64f); dialog.cont.defaults().size(210f, 64f);
dialog.cont.addButton("$waves.copy", () -> { dialog.cont.button("$waves.copy", () -> {
ui.showInfoFade("$waves.copied"); ui.showInfoFade("$waves.copied");
Core.app.setClipboardText(maps.writeWaves(groups)); Core.app.setClipboardText(maps.writeWaves(groups));
dialog.hide(); dialog.hide();
}).disabled(b -> groups == null); }).disabled(b -> groups == null);
dialog.cont.row(); dialog.cont.row();
dialog.cont.addButton("$waves.load", () -> { dialog.cont.button("$waves.load", () -> {
try{ try{
groups = maps.readWaves(Core.app.getClipboardText()); groups = maps.readWaves(Core.app.getClipboardText());
buildGroups(); buildGroups();
@@ -70,7 +70,7 @@ public class WaveInfoDialog extends FloatingDialog{
dialog.hide(); dialog.hide();
}).disabled(b -> Core.app.getClipboardText() == null || Core.app.getClipboardText().isEmpty()); }).disabled(b -> Core.app.getClipboardText() == null || Core.app.getClipboardText().isEmpty());
dialog.cont.row(); dialog.cont.row();
dialog.cont.addButton("$settings.reset", () -> ui.showConfirm("$confirm", "$settings.clear.confirm", () -> { dialog.cont.button("$settings.reset", () -> ui.showConfirm("$confirm", "$settings.clear.confirm", () -> {
groups = JsonIO.copy(defaultWaves.get()); groups = JsonIO.copy(defaultWaves.get());
buildGroups(); buildGroups();
dialog.hide(); dialog.hide();
@@ -86,7 +86,7 @@ public class WaveInfoDialog extends FloatingDialog{
cont.stack(new Table(Tex.clear, main -> { cont.stack(new Table(Tex.clear, main -> {
main.pane(t -> table = t).growX().growY().padRight(8f).get().setScrollingDisabled(true, false); main.pane(t -> table = t).growX().growY().padRight(8f).get().setScrollingDisabled(true, false);
main.row(); main.row();
main.addButton("$add", () -> { main.button("$add", () -> {
if(groups == null) groups = new Array<>(); if(groups == null) groups = new Array<>();
groups.add(new SpawnGroup(lastType)); groups.add(new SpawnGroup(lastType));
buildGroups(); buildGroups();
@@ -101,7 +101,7 @@ public class WaveInfoDialog extends FloatingDialog{
cont.table(Tex.clear, m -> { cont.table(Tex.clear, m -> {
m.add("$waves.preview").color(Color.lightGray).growX().center().get().setAlignment(Align.center, Align.center); m.add("$waves.preview").color(Color.lightGray).growX().center().get().setAlignment(Align.center, Align.center);
m.row(); m.row();
m.addButton("-", () -> { m.button("-", () -> {
}).update(t -> { }).update(t -> {
if(t.getClickListener().isPressed()){ if(t.getClickListener().isPressed()){
updateTimer += Time.delta(); updateTimer += Time.delta();
@@ -115,7 +115,7 @@ public class WaveInfoDialog extends FloatingDialog{
m.row(); m.row();
m.pane(t -> preview = t).grow().get().setScrollingDisabled(true, true); m.pane(t -> preview = t).grow().get().setScrollingDisabled(true, true);
m.row(); m.row();
m.addButton("+", () -> { m.button("+", () -> {
}).update(t -> { }).update(t -> {
if(t.getClickListener().isPressed()){ if(t.getClickListener().isPressed()){
updateTimer += Time.delta(); updateTimer += Time.delta();
@@ -140,22 +140,22 @@ public class WaveInfoDialog extends FloatingDialog{
for(SpawnGroup group : groups){ for(SpawnGroup group : groups){
table.table(Tex.button, t -> { table.table(Tex.button, t -> {
t.margin(0).defaults().pad(3).padLeft(5f).growX().left(); t.margin(0).defaults().pad(3).padLeft(5f).growX().left();
t.addButton(b -> { t.button(b -> {
b.left(); b.left();
b.addImage(group.type.icon(mindustry.ui.Cicon.medium)).size(32f).padRight(3); b.image(group.type.icon(mindustry.ui.Cicon.medium)).size(32f).padRight(3);
b.add(group.type.localizedName).color(Pal.accent); b.add(group.type.localizedName).color(Pal.accent);
}, () -> showUpdate(group)).pad(-6f).padBottom(0f); }, () -> showUpdate(group)).pad(-6f).padBottom(0f);
t.row(); t.row();
t.table(spawns -> { t.table(spawns -> {
spawns.addField("" + (group.begin + 1), TextFieldFilter.digitsOnly, text -> { spawns.field("" + (group.begin + 1), TextFieldFilter.digitsOnly, text -> {
if(Strings.canParsePostiveInt(text)){ if(Strings.canParsePostiveInt(text)){
group.begin = Strings.parseInt(text) - 1; group.begin = Strings.parseInt(text) - 1;
updateWaves(); updateWaves();
} }
}).width(100f); }).width(100f);
spawns.add("$waves.to").padLeft(4).padRight(4); spawns.add("$waves.to").padLeft(4).padRight(4);
spawns.addField(group.end == never ? "" : (group.end + 1) + "", TextFieldFilter.digitsOnly, text -> { spawns.field(group.end == never ? "" : (group.end + 1) + "", TextFieldFilter.digitsOnly, text -> {
if(Strings.canParsePostiveInt(text)){ if(Strings.canParsePostiveInt(text)){
group.end = Strings.parseInt(text) - 1; group.end = Strings.parseInt(text) - 1;
updateWaves(); updateWaves();
@@ -168,7 +168,7 @@ public class WaveInfoDialog extends FloatingDialog{
t.row(); t.row();
t.table(p -> { t.table(p -> {
p.add("$waves.every").padRight(4); p.add("$waves.every").padRight(4);
p.addField(group.spacing + "", TextFieldFilter.digitsOnly, text -> { p.field(group.spacing + "", TextFieldFilter.digitsOnly, text -> {
if(Strings.canParsePostiveInt(text) && Strings.parseInt(text) > 0){ if(Strings.canParsePostiveInt(text) && Strings.parseInt(text) > 0){
group.spacing = Strings.parseInt(text); group.spacing = Strings.parseInt(text);
updateWaves(); updateWaves();
@@ -179,7 +179,7 @@ public class WaveInfoDialog extends FloatingDialog{
t.row(); t.row();
t.table(a -> { t.table(a -> {
a.addField(group.unitAmount + "", TextFieldFilter.digitsOnly, text -> { a.field(group.unitAmount + "", TextFieldFilter.digitsOnly, text -> {
if(Strings.canParsePostiveInt(text)){ if(Strings.canParsePostiveInt(text)){
group.unitAmount = Strings.parseInt(text); group.unitAmount = Strings.parseInt(text);
updateWaves(); updateWaves();
@@ -187,7 +187,7 @@ public class WaveInfoDialog extends FloatingDialog{
}).width(80f); }).width(80f);
a.add(" + "); a.add(" + ");
a.addField(Strings.fixed(Math.max((Mathf.zero(group.unitScaling) ? 0 : 1f / group.unitScaling), 0), 2), TextFieldFilter.floatsOnly, text -> { a.field(Strings.fixed(Math.max((Mathf.zero(group.unitScaling) ? 0 : 1f / group.unitScaling), 0), 2), TextFieldFilter.floatsOnly, text -> {
if(Strings.canParsePositiveFloat(text)){ if(Strings.canParsePositiveFloat(text)){
group.unitScaling = 1f / Strings.parseFloat(text); group.unitScaling = 1f / Strings.parseFloat(text);
updateWaves(); updateWaves();
@@ -197,10 +197,10 @@ public class WaveInfoDialog extends FloatingDialog{
}); });
t.row(); t.row();
t.addCheck("$waves.boss", b -> group.effect = (b ? StatusEffects.boss : null)).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)); t.check("$waves.boss", b -> group.effect = (b ? StatusEffects.boss : null)).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss));
t.row(); t.row();
t.addButton("$waves.remove", () -> { t.button("$waves.remove", () -> {
groups.remove(group); groups.remove(group);
table.getCell(t).pad(0f); table.getCell(t).pad(0f);
t.remove(); t.remove();
@@ -222,9 +222,9 @@ public class WaveInfoDialog extends FloatingDialog{
dialog.cont.pane(p -> { dialog.cont.pane(p -> {
int i = 0; int i = 0;
for(UnitType type : content.units()){ for(UnitType type : content.units()){
p.addButton(t -> { p.button(t -> {
t.left(); t.left();
t.addImage(type.icon(mindustry.ui.Cicon.medium)).size(40f).padRight(2f); t.image(type.icon(mindustry.ui.Cicon.medium)).size(40f).padRight(2f);
t.add(type.localizedName); t.add(type.localizedName);
}, () -> { }, () -> {
lastType = type; lastType = type;
@@ -257,7 +257,7 @@ public class WaveInfoDialog extends FloatingDialog{
for(int j = 0; j < spawned.length; j++){ for(int j = 0; j < spawned.length; j++){
if(spawned[j] > 0){ if(spawned[j] > 0){
UnitType type = content.getByID(ContentType.unit, j); UnitType type = content.getByID(ContentType.unit, j);
table.addImage(type.icon(Cicon.medium)).size(8f * 4f).padRight(4); table.image(type.icon(Cicon.medium)).size(8f * 4f).padRight(4);
table.add(spawned[j] + "x").color(Color.lightGray).padRight(6); table.add(spawned[j] + "x").color(Color.lightGray).padRight(6);
table.row(); table.row();
} }
+5
View File
@@ -34,4 +34,9 @@ class AllDefs{
class sync{ class sync{
} }
@GroupDef(Drawc.class)
class draw{
}
} }
+1 -1
View File
@@ -42,7 +42,7 @@ public class Effects{
Rect pos = Tmp.r2.setSize(effect.size).setCenter(x, y); Rect pos = Tmp.r2.setSize(effect.size).setCenter(x, y);
if(view.overlaps(pos)){ if(view.overlaps(pos)){
Effectc entity = effect.ground ? GroundEffectEntity.create() : StandardEffectEntity.create(); Effectc entity = EffectEntity.create();
entity.effect(effect); entity.effect(effect);
entity.rotation(rotation); entity.rotation(rotation);
entity.data(data); entity.data(data);
@@ -23,7 +23,7 @@ import java.util.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
@Component @Component
abstract class BuilderComp implements Unitc, DrawLayerFlyingc{ abstract class BuilderComp implements Unitc{
static final Vec2[] vecs = new Vec2[]{new Vec2(), new Vec2(), new Vec2(), new Vec2()}; static final Vec2[] vecs = new Vec2[]{new Vec2(), new Vec2(), new Vec2(), new Vec2()};
@Import float x, y, rotation; @Import float x, y, rotation;
@@ -197,8 +197,12 @@ abstract class BuilderComp implements Unitc, DrawLayerFlyingc{
} }
@Override @Override
public void drawFlying(){ public void draw(){
if(!isBuilding()) return; if(!isBuilding()) return;
//TODO check correctness
Draw.z(Layer.flyingUnit);
BuildRequest request = buildRequest(); BuildRequest request = buildRequest();
Tile tile = world.tile(request.x, request.y); Tile tile = world.tile(request.x, request.y);
@@ -1,5 +1,6 @@
package mindustry.entities.def; package mindustry.entities.def;
import arc.graphics.g2d.*;
import arc.math.*; import arc.math.*;
import arc.util.*; import arc.util.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
@@ -11,7 +12,7 @@ import static mindustry.Vars.*;
@EntityDef(value = {Bulletc.class}, pooled = true) @EntityDef(value = {Bulletc.class}, pooled = true)
@Component @Component
abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Drawc, Shielderc, Ownerc, Velc, Bulletc, Timerc, DrawLayerBulletsc{ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Drawc, Shielderc, Ownerc, Velc, Bulletc, Timerc{
Object data; Object data;
BulletType type; BulletType type;
float damage; float damage;
@@ -109,6 +110,8 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
@Override @Override
public void draw(){ public void draw(){
Draw.z(Layer.bullet);
type.draw(this); type.draw(this);
//TODO refactor //TODO refactor
renderer.lights.add(x(), y(), 16f, Pal.powerLight, 0.3f); renderer.lights.add(x(), y(), 16f, Pal.powerLight, 0.3f);
@@ -8,14 +8,14 @@ import mindustry.gen.*;
@EntityDef(value = {Decalc.class}, pooled = true) @EntityDef(value = {Decalc.class}, pooled = true)
@Component @Component
abstract class DecalComp implements Drawc, Timedc, Rotc, Posc, DrawLayerFloorc{ abstract class DecalComp implements Drawc, Timedc, Rotc, Posc{
@Import float x, y, rotation; @Import float x, y, rotation;
Color color = new Color(1, 1, 1, 1); Color color = new Color(1, 1, 1, 1);
TextureRegion region; TextureRegion region;
@Override @Override
public void drawFloor(){ public void draw(){
Draw.color(color); Draw.color(color);
Draw.alpha(1f - Mathf.curve(fin(), 0.98f)); Draw.alpha(1f - Mathf.curve(fin(), 0.98f));
Draw.rect(region, x, y, rotation); Draw.rect(region, x, y, rotation);
@@ -6,4 +6,8 @@ import mindustry.gen.*;
@Component @Component
abstract class DrawComp implements Posc{ abstract class DrawComp implements Posc{
abstract float clipSize(); abstract float clipSize();
void draw(){
}
} }
@@ -1,17 +1,22 @@
package mindustry.entities.def; package mindustry.entities.def;
import arc.graphics.*; import arc.graphics.*;
import arc.graphics.g2d.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.entities.*; import mindustry.entities.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*;
@EntityDef(value = {Effectc.class, Childc.class}, pooled = true)
@Component @Component
abstract class EffectComp implements Posc, Drawc, Timedc, Rotc, Childc{ abstract class EffectComp implements Posc, Drawc, Timedc, Rotc, Childc{
Color color = new Color(Color.white); Color color = new Color(Color.white);
Effect effect; Effect effect;
Object data; Object data;
void draw(){ @Override
public void draw(){
Draw.z(Layer.effect);
effect.render(id(), color, time(), rotation(), x(), y(), data); effect.render(id(), color, time(), rotation(), x(), y(), data);
} }
@@ -1,14 +0,0 @@
package mindustry.entities.def;
import mindustry.annotations.Annotations.*;
import mindustry.gen.*;
@EntityDef(value = {GroundEffectc.class, Childc.class}, pooled = true)
@Component
abstract class GroundEffectComp implements Effectc, DrawLayerFloorOverc{
@Override
public void drawFloorOver(){
draw();
}
}
@@ -6,7 +6,7 @@ import mindustry.annotations.Annotations.*;
import mindustry.gen.*; import mindustry.gen.*;
@Component @Component
abstract class LegsComp implements Posc, Flyingc, Hitboxc, DrawLayerGroundUnderc, Unitc, Legsc, ElevationMovec{ abstract class LegsComp implements Posc, Flyingc, Hitboxc, Unitc, Legsc, ElevationMovec{
@Import float x, y; @Import float x, y;
float baseRotation; float baseRotation;
@@ -18,9 +18,4 @@ abstract class LegsComp implements Posc, Flyingc, Hitboxc, DrawLayerGroundUnderc
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed)); baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
walkTime += Time.delta()*len/1f; walkTime += Time.delta()*len/1f;
} }
@Override
public void drawGroundUnder(){
type().drawLegs(this);
}
} }
@@ -17,7 +17,7 @@ import mindustry.world.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
@Component @Component
abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, DrawLayerGroundc{ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
@Import float x, y, rotation; @Import float x, y, rotation;
transient float mineTimer; transient float mineTimer;
@@ -80,7 +80,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, DrawLayerGroundc{
} }
@Override @Override
public void drawGround(){ public void draw(){
if(!mining()) return; if(!mining()) return;
float focusLen = 4f + Mathf.absin(Time.time(), 1.1f, 0.5f); float focusLen = 4f + Mathf.absin(Time.time(), 1.1f, 0.5f);
float swingScl = 12f, swingMag = tilesize / 8f; float swingScl = 12f, swingMag = tilesize / 8f;
@@ -13,6 +13,7 @@ import mindustry.core.*;
import mindustry.entities.units.*; import mindustry.entities.units.*;
import mindustry.game.*; import mindustry.game.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.net.Administration.*; import mindustry.net.Administration.*;
import mindustry.net.*; import mindustry.net.*;
import mindustry.net.Packets.*; import mindustry.net.Packets.*;
@@ -23,7 +24,7 @@ import static mindustry.Vars.*;
@EntityDef(value = {Playerc.class}, serialize = false) @EntityDef(value = {Playerc.class}, serialize = false)
@Component @Component
abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc{ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Drawc{
@NonNull @ReadOnly Unitc unit = Nulls.unit; @NonNull @ReadOnly Unitc unit = Nulls.unit;
@ReadOnly Team team = Team.sharded; @ReadOnly Team team = Team.sharded;
@@ -58,6 +59,12 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc{
} }
} }
@Override
public float clipSize(){
return 20;
}
@Override
public void update(){ public void update(){
if(unit.dead()){ if(unit.dead()){
clearUnit(); clearUnit();
@@ -130,7 +137,10 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc{
con.kick(reason); con.kick(reason);
} }
void drawName(){ @Override
public void draw(){
Draw.z(Layer.playerName);
BitmapFont font = Fonts.def; BitmapFont font = Fonts.def;
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new); GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
final float nameHeight = 11; final float nameHeight = 11;
@@ -10,6 +10,7 @@ import mindustry.annotations.Annotations.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.entities.*; import mindustry.entities.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.world.*; import mindustry.world.*;
@@ -18,7 +19,7 @@ import static mindustry.entities.Puddles.maxLiquid;
@EntityDef(value = {Puddlec.class}, pooled = true) @EntityDef(value = {Puddlec.class}, pooled = true)
@Component @Component
abstract class PuddleComp implements Posc, DrawLayerFloorOverc, Puddlec{ abstract class PuddleComp implements Posc, Puddlec{
private static final int maxGeneration = 2; private static final int maxGeneration = 2;
private static final Color tmp = new Color(); private static final Color tmp = new Color();
private static final Rect rect = new Rect(); private static final Rect rect = new Rect();
@@ -89,7 +90,9 @@ abstract class PuddleComp implements Posc, DrawLayerFloorOverc, Puddlec{
} }
@Override @Override
public void drawFloorOver(){ public void draw(){
Draw.z(Layer.debris - 1);
seeds = id(); seeds = id();
boolean onLiquid = tile.floor().isLiquid; boolean onLiquid = tile.floor().isLiquid;
float f = Mathf.clamp(amount / (maxLiquid / 1.5f)); float f = Mathf.clamp(amount / (maxLiquid / 1.5f));
@@ -1,14 +0,0 @@
package mindustry.entities.def;
import mindustry.annotations.Annotations.*;
import mindustry.gen.*;
@EntityDef(value = {StandardEffectc.class, Childc.class}, pooled = true)
@Component
abstract class StandardEffectComp implements Effectc, DrawLayerEffectsc{
@Override
public void drawEffects(){
draw();
}
}
@@ -615,12 +615,6 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
} }
} }
public void drawLayer(){
}
public void drawLayer2(){
}
public void drawCracks(){ public void drawCracks(){
if(!damaged() || block.size > Block.maxCrackSize) return; if(!damaged() || block.size > Block.maxCrackSize) return;
int id = pos(); int id = pos();
@@ -824,7 +818,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
l.clearChildren(); l.clearChildren();
for(Item item : content.items()){ for(Item item : content.items()){
if(items.flownBits() != null && items.flownBits().get(item.id)){ if(items.flownBits() != null && items.flownBits().get(item.id)){
l.addImage(item.icon(Cicon.small)).padRight(3f); l.image(item.icon(Cicon.small)).padRight(3f);
l.label(() -> items.getFlowRate(item) < 0 ? "..." : Strings.fixed(items.getFlowRate(item), 1) + ps).color(Color.lightGray); l.label(() -> items.getFlowRate(item) < 0 ? "..." : Strings.fixed(items.getFlowRate(item), 1) + ps).color(Color.lightGray);
l.row(); l.row();
} }
@@ -845,7 +839,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
table.row(); table.row();
table.table(l -> { table.table(l -> {
l.left(); l.left();
l.addImage(() -> liquids.current().icon(Cicon.small)).padRight(3f); l.image(() -> liquids.current().icon(Cicon.small)).padRight(3f);
l.label(() -> liquids.getFlowRate() < 0 ? "..." : Strings.fixed(liquids.getFlowRate(), 2) + ps).color(Color.lightGray); l.label(() -> liquids.getFlowRate() < 0 ? "..." : Strings.fixed(liquids.getFlowRate(), 2) + ps).color(Color.lightGray);
}); });
} }
+2 -28
View File
@@ -18,8 +18,7 @@ import mindustry.world.blocks.environment.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
@Component @Component
abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitboxc, Rotc, Massc, Unitc, Weaponsc, Drawc, Boundedc, abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitboxc, Rotc, Massc, Unitc, Weaponsc, Drawc, Boundedc, Syncc{
DrawLayerGroundc, DrawLayerFlyingc, DrawLayerGroundShadowsc, DrawLayerFlyingShadowsc, Syncc{
@Import float x, y, rotation, elevation; @Import float x, y, rotation, elevation;
private UnitController controller; private UnitController controller;
@@ -172,32 +171,7 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox
@Override @Override
public void draw(){ public void draw(){
type.drawEngine(this); type.draw(this);
type.drawBody(this);
type.drawWeapons(this);
if(type.drawCell) type.drawCell(this);
if(type.drawItems) type.drawItems(this);
type.drawLight(this);
}
@Override
public void drawFlyingShadows(){
if(isFlying()) type.drawShadow(this);
}
@Override
public void drawGroundShadows(){
type.drawOcclusion(this);
}
@Override
public void drawFlying(){
if(isFlying()) draw();
}
@Override
public void drawGround(){
if(isGrounded()) draw();
} }
@Override @Override
+1 -1
View File
@@ -81,7 +81,7 @@ public class Rules{
public boolean canGameOver = true; public boolean canGameOver = true;
/** Whether to draw shadows of blocks at map edges and static blocks. /** Whether to draw shadows of blocks at map edges and static blocks.
* Do not change unless you know exactly what you are doing.*/ * Do not change unless you know exactly what you are doing.*/
public boolean drawFog = true; public boolean drawDarkness = true;
/** Starting items put in cores */ /** Starting items put in cores */
public Array<ItemStack> loadout = Array.with(ItemStack.with(Items.copper, 100)); public Array<ItemStack> loadout = Array.with(ItemStack.with(Items.copper, 100));
/** Blocks that cannot be placed. */ /** Blocks that cannot be placed. */
+20 -1
View File
@@ -51,7 +51,9 @@ public class Schematics implements Loadable{
private OptimizedByteArrayOutputStream out = new OptimizedByteArrayOutputStream(1024); private OptimizedByteArrayOutputStream out = new OptimizedByteArrayOutputStream(1024);
private Array<Schematic> all = new Array<>(); private Array<Schematic> all = new Array<>();
private OrderedMap<Schematic, FrameBuffer> previews = new OrderedMap<>(); private OrderedMap<Schematic, FrameBuffer> previews = new OrderedMap<>();
private ObjectSet<Schematic> errored = new ObjectSet<>();
private FrameBuffer shadowBuffer; private FrameBuffer shadowBuffer;
private Texture errorTexture;
private long lastClearTime; private long lastClearTime;
public Schematics(){ public Schematics(){
@@ -59,6 +61,9 @@ public class Schematics implements Loadable{
previews.each((schem, m) -> m.dispose()); previews.each((schem, m) -> m.dispose());
previews.clear(); previews.clear();
shadowBuffer.dispose(); shadowBuffer.dispose();
if(errorTexture != null){
errorTexture.dispose();
}
}); });
Events.on(ContentReloadEvent.class, event -> { Events.on(ContentReloadEvent.class, event -> {
@@ -66,6 +71,12 @@ public class Schematics implements Loadable{
previews.clear(); previews.clear();
load(); load();
}); });
Events.on(ClientLoadEvent.class, event -> {
Pixmap pixmap = Core.atlas.getPixmap("error").crop();
errorTexture = new Texture(pixmap);
pixmap.dispose();
});
} }
@Override @Override
@@ -163,7 +174,15 @@ public class Schematics implements Loadable{
} }
public Texture getPreview(Schematic schematic){ public Texture getPreview(Schematic schematic){
return getBuffer(schematic).getTexture(); if(errored.contains(schematic)) return errorTexture;
try{
return getBuffer(schematic).getTexture();
}catch(Throwable t){
Log.err(t);
errored.add(schematic);
return errorTexture;
}
} }
public boolean hasPreview(Schematic schematic){ public boolean hasPreview(Schematic schematic){
+38 -99
View File
@@ -14,6 +14,7 @@ import mindustry.game.Teams.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.ui.*; import mindustry.ui.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.blocks.power.*;
import static arc.Core.camera; import static arc.Core.camera;
import static mindustry.Vars.*; import static mindustry.Vars.*;
@@ -25,23 +26,18 @@ public class BlockRenderer implements Disposable{
public final FloorRenderer floor = new FloorRenderer(); public final FloorRenderer floor = new FloorRenderer();
private Array<BlockRequest> requests = new Array<>(true, initialRequests, BlockRequest.class); private Array<Tile> requests = new Array<>(false, initialRequests, Tile.class);
private int lastCamX, lastCamY, lastRangeX, lastRangeY; private int lastCamX, lastCamY, lastRangeX, lastRangeY;
private int requestidx = 0;
private int iterateidx = 0;
private float brokenFade = 0f; private float brokenFade = 0f;
private FrameBuffer shadows = new FrameBuffer(2, 2); private FrameBuffer shadows = new FrameBuffer();
private FrameBuffer fog = new FrameBuffer(2, 2); private FrameBuffer fog = new FrameBuffer();
private Array<Tilec> outArray2 = new Array<>(); private Array<Tilec> outArray2 = new Array<>();
private Array<Tile> shadowEvents = new Array<>(); private Array<Tile> shadowEvents = new Array<>();
private boolean displayStatus = false; private boolean displayStatus = false;
public BlockRenderer(){ public BlockRenderer(){
for(int i = 0; i < requests.size; i++){
requests.set(i, new BlockRequest());
}
Events.on(WorldLoadEvent.class, event -> { Events.on(WorldLoadEvent.class, event -> {
shadowEvents.clear(); shadowEvents.clear();
lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated
@@ -98,7 +94,7 @@ public class BlockRenderer implements Disposable{
}); });
} }
public void drawFog(){ public void drawDarkness(){
float ww = world.width() * tilesize, wh = world.height() * tilesize; float ww = world.width() * tilesize, wh = world.height() * tilesize;
float x = camera.position.x + tilesize / 2f, y = camera.position.y + tilesize / 2f; float x = camera.position.x + tilesize / 2f, y = camera.position.y + tilesize / 2f;
float u = (x - camera.width / 2f) / ww, float u = (x - camera.width / 2f) / ww,
@@ -178,7 +174,6 @@ public class BlockRenderer implements Disposable{
/** Process all blocks to draw. */ /** Process all blocks to draw. */
public void processBlocks(){ public void processBlocks(){
displayStatus = Core.settings.getBool("blockstatus"); displayStatus = Core.settings.getBool("blockstatus");
iterateidx = 0;
int avgx = (int)(camera.position.x / tilesize); int avgx = (int)(camera.position.x / tilesize);
int avgy = (int)(camera.position.y / tilesize); int avgy = (int)(camera.position.y / tilesize);
@@ -190,7 +185,7 @@ public class BlockRenderer implements Disposable{
return; return;
} }
requestidx = 0; requests.clear();
int minx = Math.max(avgx - rangex - expandr, 0); int minx = Math.max(avgx - rangex - expandr, 0);
int miny = Math.max(avgy - rangey - expandr, 0); int miny = Math.max(avgy - rangey - expandr, 0);
@@ -204,29 +199,14 @@ public class BlockRenderer implements Disposable{
Block block = tile.block(); Block block = tile.block();
if(block != Blocks.air && tile.isCenter() && block.cacheLayer == CacheLayer.normal){ if(block != Blocks.air && tile.isCenter() && block.cacheLayer == CacheLayer.normal){
if(!expanded){
addRequest(tile, Layer.block);
}
if(state.rules.lighting && tile.block().synthetic()){
addRequest(tile, Layer.lights);
}
if(block.expanded || !expanded){ if(block.expanded || !expanded){
requests.add(tile);
}
if(block.layer != null){ if(tile.entity != null && tile.entity.power() != null && tile.entity.power().links.size > 0){
addRequest(tile, block.layer); for(Tilec other : tile.entity.getPowerConnections(outArray2)){
} if(other.block() instanceof PowerNode){ //TODO need a generic way to render connections!
requests.add(other.tile());
if(block.layer2 != null){
addRequest(tile, block.layer2);
}
if(tile.entity != null && tile.entity.power() != null && tile.entity.power().links.size > 0){
for(Tilec other : tile.entity.getPowerConnections(outArray2)){
if(other.block().layer == Layer.power){
addRequest(other.tile(), Layer.power);
}
} }
} }
} }
@@ -234,68 +214,44 @@ public class BlockRenderer implements Disposable{
} }
} }
Sort.instance().sort(requests.items, 0, requestidx);
lastCamX = avgx; lastCamX = avgx;
lastCamY = avgy; lastCamY = avgy;
lastRangeX = rangex; lastRangeX = rangex;
lastRangeY = rangey; lastRangeY = rangey;
} }
public void drawBlocks(Layer stopAt){ public void drawBlocks(){
int startIdx = iterateidx; drawDestroyed();
for(; iterateidx < requestidx; iterateidx++){
BlockRequest request = requests.get(iterateidx);
if(request.layer.ordinal() > stopAt.ordinal()){ for(int i = 0; i < requests.size; i++){
break; Tile tile = requests.items[i];
} Block block = tile.block();
Tilec entity = tile.entity;
if(request.layer == Layer.power){ Draw.z(Layer.block);
if(iterateidx - startIdx > 0 && request.tile.pos() == requests.get(iterateidx - 1).tile.pos()){
continue; if(block != Blocks.air){
block.drawBase(tile);
if(entity != null){
if(entity.damaged()){
entity.drawCracks();
}
if(entity.team() != player.team()){
entity.drawTeam();
}
entity.drawLight();
if(displayStatus && block.consumes.any()){
entity.drawStatus();
}
} }
} }
Block block = request.tile.block();
boolean isEnd = (request.layer == Layer.block && block.layer == null) || request.layer == block.layer;
if(request.layer == Layer.block){
block.drawBase(request.tile);
if(request.tile.entity != null && request.tile.entity.damaged()){
request.tile.entity.drawCracks();
}
if(block.synthetic() && request.tile.entity != null && request.tile.team() != player.team()){
request.tile.entity.drawTeam();
}
}else if(request.layer == Layer.lights && request.tile.entity != null){
request.tile.entity.drawLight();
}else if(request.layer == block.layer){
block.drawLayer(request.tile);
}else if(request.layer == block.layer2){
block.drawLayer2(request.tile);
}
if(isEnd && request.tile.entity != null && displayStatus && block.consumes.any()){
request.tile.entity.drawStatus();
}
} }
} }
private void addRequest(Tile tile, Layer layer){
if(requestidx >= requests.size){
requests.add(new BlockRequest());
}
BlockRequest r = requests.get(requestidx);
if(r == null){
requests.set(requestidx, r = new BlockRequest());
}
r.tile = tile;
r.layer = layer;
requestidx++;
}
@Override @Override
public void dispose(){ public void dispose(){
shadows.dispose(); shadows.dispose();
@@ -303,21 +259,4 @@ public class BlockRenderer implements Disposable{
shadows = fog = null; shadows = fog = null;
floor.dispose(); floor.dispose();
} }
private class BlockRequest implements Comparable<BlockRequest>{
Tile tile;
Layer layer;
@Override
public int compareTo(BlockRequest other){
int compare = layer.compareTo(other.layer);
return (compare != 0) ? compare : Integer.compare(tile.pos(), other.tile.pos());
}
@Override
public String toString(){
return tile.block().name + ":" + layer.toString();
}
}
} }
+6 -6
View File
@@ -1,14 +1,14 @@
package mindustry.graphics; package mindustry.graphics;
import arc.Core; import arc.*;
import arc.graphics.Color; import arc.graphics.*;
import arc.graphics.g2d.Draw; import arc.graphics.g2d.*;
import arc.graphics.gl.Shader; import arc.graphics.gl.*;
import static arc.Core.camera;
import static mindustry.Vars.renderer; import static mindustry.Vars.renderer;
public enum CacheLayer{ public enum CacheLayer{
//TODO water animation breaks when tar/slag is present
water{ water{
@Override @Override
public void begin(){ public void begin(){
@@ -81,7 +81,7 @@ public enum CacheLayer{
renderer.effectBuffer.end(); renderer.effectBuffer.end();
Draw.shader(shader); Draw.shader(shader);
Draw.rect(Draw.wrap(renderer.effectBuffer.getTexture()), camera.position.x, camera.position.y, camera.width, -camera.height); Draw.rect(renderer.effectBuffer);
Draw.shader(); Draw.shader();
renderer.blocks.floor.beginc(); renderer.blocks.floor.beginc();
+66 -13
View File
@@ -1,16 +1,69 @@
package mindustry.graphics; package mindustry.graphics;
public enum Layer{ /** Stores constants for sorting layers. Values should be stored in increments of 10. */
/** Base block layer. */ public class Layer{
block,
/** for placement */ public static final float
placement,
/** First overlay. Stuff like conveyor items. */ //background, which may be planets or an image or nothing at all
overlay, background = -10,
/** "High" blocks, like turrets. */
turret, //floor tiles
/** Power lasers. */ floor = 0,
power,
/** Extra layer that's always on top.*/ //scorch marks on the floor
lights scorch = 10,
//things such as spent casings or rubble
debris = 20,
//base block layer - most blocks go here
block = 30,
//things drawn over blocks (intermediate layer)
blockOver = 35,
//blocks currently in progress *shaders used* TODO perhaps put shaders into their own category
blockBuilding = 40,
//ground units
groundUnit = 50,
//turrets
turret = 60,
//power lines
power = 70,
//darkness over block clusters
darkness = 80,
//building plans
plans = 85,
//flying units
flyingUnit = 90,
//bullets *bloom begin*
bullet = 100,
//effects *bloom end*
effect = 110,
//overlaied UI, like block config guides
overlayUI = 120,
//weather effects, e.g. rain and snow TODO draw before overlay UI?
weather = 130,
//light rendering *shaders used*
light = 140,
//names of players in the game
playerName = 150,
//space effects, currently only the land and launch effects
space = 160
;
} }
@@ -17,7 +17,7 @@ public class LightRenderer{
private static final int scaling = 4; private static final int scaling = 4;
private float[] vertices = new float[24]; private float[] vertices = new float[24];
private FrameBuffer buffer = new FrameBuffer(2, 2); private FrameBuffer buffer = new FrameBuffer();
private Array<Runnable> lights = new Array<>(); private Array<Runnable> lights = new Array<>();
public void add(Runnable run){ public void add(Runnable run){
@@ -185,9 +185,7 @@ public class LightRenderer{
return; return;
} }
if(buffer.getWidth() != Core.graphics.getWidth()/scaling || buffer.getHeight() != Core.graphics.getHeight()/scaling){ buffer.resize(Core.graphics.getWidth()/scaling, Core.graphics.getHeight()/scaling);
buffer.resize(Core.graphics.getWidth()/scaling, Core.graphics.getHeight()/scaling);
}
Draw.color(); Draw.color();
buffer.begin(Color.clear); buffer.begin(Color.clear);
@@ -203,7 +201,7 @@ public class LightRenderer{
Draw.color(); Draw.color();
Shaders.light.ambient.set(state.rules.ambientLight); Shaders.light.ambient.set(state.rules.ambientLight);
Draw.shader(Shaders.light); Draw.shader(Shaders.light);
Draw.rect(Draw.wrap(buffer.getTexture()), Core.camera.position.x, Core.camera.position.y, Core.camera.width, -Core.camera.height); Draw.rect(buffer);
Draw.shader(); Draw.shader();
lights.clear(); lights.clear();
+5 -7
View File
@@ -6,13 +6,12 @@ import arc.graphics.Texture.*;
import arc.graphics.g2d.*; import arc.graphics.g2d.*;
import arc.graphics.gl.*; import arc.graphics.gl.*;
import arc.util.*; import arc.util.*;
import mindustry.gen.*;
import static arc.Core.*; import static arc.Core.*;
import static mindustry.Vars.renderer; import static mindustry.Vars.renderer;
public class Pixelator implements Disposable{ public class Pixelator implements Disposable{
private FrameBuffer buffer = new FrameBuffer(2, 2); private FrameBuffer buffer = new FrameBuffer();
{ {
buffer.getTexture().setFilter(TextureFilter.Nearest, TextureFilter.Nearest); buffer.getTexture().setFilter(TextureFilter.Nearest, TextureFilter.Nearest);
@@ -34,19 +33,18 @@ public class Pixelator implements Disposable{
int w = (int)(Core.camera.width * renderer.landScale()); int w = (int)(Core.camera.width * renderer.landScale());
int h = (int)(Core.camera.height * renderer.landScale()); int h = (int)(Core.camera.height * renderer.landScale());
if(!graphics.isHidden() && (buffer.getWidth() != w || buffer.getHeight() != h)){ buffer.resize(w, h);
buffer.resize(w, h);
}
buffer.begin(); buffer.begin();
renderer.draw(); renderer.draw();
buffer.end(); buffer.end();
Draw.blend(Blending.disabled); Draw.blend(Blending.disabled);
Draw.rect(Draw.wrap(buffer.getTexture()), Core.camera.position.x, Core.camera.position.y, Core.camera.width, -Core.camera.height); Draw.rect(buffer);
Draw.blend(); Draw.blend();
Groups.drawNames(); //TODO set all of this up
//Groups.drawNames();
Core.camera.position.set(px, py); Core.camera.position.set(px, py);
renderer.setScale(pre); renderer.setScale(pre);
+49 -49
View File
@@ -7,55 +7,55 @@ import arc.input.InputDevice.DeviceType;
import arc.input.KeyCode; import arc.input.KeyCode;
public enum Binding implements KeyBind{ public enum Binding implements KeyBind{
move_x(new Axis(KeyCode.A, KeyCode.D), "general"), move_x(new Axis(KeyCode.a, KeyCode.d), "general"),
move_y(new Axis(KeyCode.S, KeyCode.W)), move_y(new Axis(KeyCode.s, KeyCode.w)),
mouse_move(KeyCode.MOUSE_BACK), mouse_move(KeyCode.mouseBack),
dash(KeyCode.SHIFT_LEFT), dash(KeyCode.shiftLeft),
control(KeyCode.SHIFT_LEFT), control(KeyCode.shiftLeft),
select(KeyCode.MOUSE_LEFT), select(KeyCode.mouseLeft),
deselect(KeyCode.MOUSE_RIGHT), deselect(KeyCode.mouseRight),
break_block(KeyCode.MOUSE_RIGHT), break_block(KeyCode.mouseRight),
clear_building(KeyCode.Q), clear_building(KeyCode.q),
pause_building(KeyCode.E), pause_building(KeyCode.e),
rotate(new Axis(KeyCode.SCROLL)), rotate(new Axis(KeyCode.scroll)),
rotateplaced(KeyCode.R), rotateplaced(KeyCode.r),
diagonal_placement(KeyCode.CONTROL_LEFT), diagonal_placement(KeyCode.controlLeft),
pick(KeyCode.MOUSE_MIDDLE), pick(KeyCode.mouseMiddle),
schematic_select(KeyCode.F), schematic_select(KeyCode.f),
schematic_flip_x(KeyCode.Z), schematic_flip_x(KeyCode.z),
schematic_flip_y(KeyCode.X), schematic_flip_y(KeyCode.x),
schematic_menu(KeyCode.T), schematic_menu(KeyCode.t),
category_prev(KeyCode.COMMA), category_prev(KeyCode.comma),
category_next(KeyCode.PERIOD), category_next(KeyCode.period),
block_select_left(KeyCode.LEFT), block_select_left(KeyCode.left),
block_select_right(KeyCode.RIGHT), block_select_right(KeyCode.right),
block_select_up(KeyCode.UP), block_select_up(KeyCode.up),
block_select_down(KeyCode.DOWN), block_select_down(KeyCode.down),
block_select_01(KeyCode.NUM_1), block_select_01(KeyCode.num1),
block_select_02(KeyCode.NUM_2), block_select_02(KeyCode.num2),
block_select_03(KeyCode.NUM_3), block_select_03(KeyCode.num3),
block_select_04(KeyCode.NUM_4), block_select_04(KeyCode.num4),
block_select_05(KeyCode.NUM_5), block_select_05(KeyCode.num5),
block_select_06(KeyCode.NUM_6), block_select_06(KeyCode.num6),
block_select_07(KeyCode.NUM_7), block_select_07(KeyCode.num7),
block_select_08(KeyCode.NUM_8), block_select_08(KeyCode.num8),
block_select_09(KeyCode.NUM_9), block_select_09(KeyCode.num9),
block_select_10(KeyCode.NUM_0), block_select_10(KeyCode.num0),
zoom(new Axis(KeyCode.SCROLL), "view"), zoom(new Axis(KeyCode.scroll), "view"),
menu(Core.app.getType() == ApplicationType.Android ? KeyCode.BACK : KeyCode.ESCAPE), menu(Core.app.getType() == ApplicationType.Android ? KeyCode.back : KeyCode.escape),
fullscreen(KeyCode.F11), fullscreen(KeyCode.f11),
pause(KeyCode.SPACE), pause(KeyCode.space),
minimap(KeyCode.M), minimap(KeyCode.m),
toggle_menus(KeyCode.C), toggle_menus(KeyCode.c),
screenshot(KeyCode.P), screenshot(KeyCode.p),
toggle_power_lines(KeyCode.F5), toggle_power_lines(KeyCode.f5),
toggle_block_status(KeyCode.F6), toggle_block_status(KeyCode.f6),
player_list(KeyCode.TAB, "multiplayer"), player_list(KeyCode.tab, "multiplayer"),
chat(KeyCode.ENTER), chat(KeyCode.enter),
chat_history_prev(KeyCode.UP), chat_history_prev(KeyCode.up),
chat_history_next(KeyCode.DOWN), chat_history_next(KeyCode.down),
chat_scroll(new Axis(KeyCode.SCROLL)), chat_scroll(new Axis(KeyCode.scroll)),
console(KeyCode.F8), console(KeyCode.f8),
; ;
private final KeybindValue defaultValue; private final KeybindValue defaultValue;
+4 -4
View File
@@ -72,7 +72,7 @@ public class DesktopInput extends InputHandler{
Core.keybinds.get(Binding.schematic_flip_y).key.toString())).style(Styles.outlineLabel); Core.keybinds.get(Binding.schematic_flip_y).key.toString())).style(Styles.outlineLabel);
b.row(); b.row();
b.table(a -> { b.table(a -> {
a.addImageTextButton("$schematic.add", Icon.save, this::showSchematicSave).colspan(2).size(250f, 50f).disabled(f -> lastSchematic == null || lastSchematic.file != null); a.button("$schematic.add", Icon.save, this::showSchematicSave).colspan(2).size(250f, 50f).disabled(f -> lastSchematic == null || lastSchematic.file != null);
}); });
}).margin(6f); }).margin(6f);
}); });
@@ -182,7 +182,7 @@ public class DesktopInput extends InputHandler{
} }
//TODO this is for debugging, remove later //TODO this is for debugging, remove later
if(Core.input.keyTap(KeyCode.Q) && !player.dead()){ if(Core.input.keyTap(KeyCode.q) && !player.dead()){
Fx.commandSend.at(player); Fx.commandSend.at(player);
Units.nearby(player.team(), player.x(), player.y(), 200f, u -> { Units.nearby(player.team(), player.x(), player.y(), 200f, u -> {
if(u.isAI()){ if(u.isAI()){
@@ -302,11 +302,11 @@ public class DesktopInput extends InputHandler{
@Override @Override
public void buildPlacementUI(Table table){ public void buildPlacementUI(Table table){
table.addImage().color(Pal.gray).height(4f).colspan(4).growX(); table.image().color(Pal.gray).height(4f).colspan(4).growX();
table.row(); table.row();
table.left().margin(0f).defaults().size(48f).left(); table.left().margin(0f).defaults().size(48f).left();
table.addImageButton(Icon.paste, Styles.clearPartiali, () -> { table.button(Icon.paste, Styles.clearPartiali, () -> {
ui.schematics.show(); ui.schematics.show();
}); });
} }
+11 -12
View File
@@ -14,7 +14,6 @@ import arc.scene.ui.layout.*;
import arc.util.*; import arc.util.*;
import mindustry.*; import mindustry.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.core.GameState.*;
import mindustry.entities.*; import mindustry.entities.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.entities.units.*; import mindustry.entities.units.*;
@@ -175,23 +174,23 @@ public class MobileInput extends InputHandler implements GestureListener{
@Override @Override
public void buildPlacementUI(Table table){ public void buildPlacementUI(Table table){
table.addImage().color(Pal.gray).height(4f).colspan(4).growX(); table.image().color(Pal.gray).height(4f).colspan(4).growX();
table.row(); table.row();
table.left().margin(0f).defaults().size(48f); table.left().margin(0f).defaults().size(48f);
table.addImageButton(Icon.hammer, Styles.clearTogglePartiali, () -> { table.button(Icon.hammer, Styles.clearTogglePartiali, () -> {
mode = mode == breaking ? block == null ? none : placing : breaking; mode = mode == breaking ? block == null ? none : placing : breaking;
lastBlock = block; lastBlock = block;
}).update(l -> l.setChecked(mode == breaking)).name("breakmode"); }).update(l -> l.setChecked(mode == breaking)).name("breakmode");
//diagonal swap button //diagonal swap button
table.addImageButton(Icon.diagonal, Styles.clearTogglePartiali, () -> { table.button(Icon.diagonal, Styles.clearTogglePartiali, () -> {
Core.settings.put("swapdiagonal", !Core.settings.getBool("swapdiagonal")); Core.settings.put("swapdiagonal", !Core.settings.getBool("swapdiagonal"));
Core.settings.save(); Core.settings.save();
}).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal"))); }).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal")));
//rotate button //rotate button
table.addImageButton(Icon.right, Styles.clearTogglePartiali, () -> { table.button(Icon.right, Styles.clearTogglePartiali, () -> {
if(block != null && block.rotate){ if(block != null && block.rotate){
rotation = Mathf.mod(rotation + 1, 4); rotation = Mathf.mod(rotation + 1, 4);
}else{ }else{
@@ -210,7 +209,7 @@ public class MobileInput extends InputHandler implements GestureListener{
}); });
//confirm button //confirm button
table.addImageButton(Icon.ok, Styles.clearPartiali, () -> { table.button(Icon.ok, Styles.clearPartiali, () -> {
for(BuildRequest request : selectRequests){ for(BuildRequest request : selectRequests){
Tile tile = request.tile(); Tile tile = request.tile();
@@ -249,7 +248,7 @@ public class MobileInput extends InputHandler implements GestureListener{
group.fill(t -> { group.fill(t -> {
t.bottom().left().visible(() -> (player.builder().isBuilding() || block != null || mode == breaking || !selectRequests.isEmpty()) && !schem.get()); t.bottom().left().visible(() -> (player.builder().isBuilding() || block != null || mode == breaking || !selectRequests.isEmpty()) && !schem.get());
t.addImageTextButton("$cancel", Icon.cancel, () -> { t.button("$cancel", Icon.cancel, () -> {
player.builder().clearBuilding(); player.builder().clearBuilding();
selectRequests.clear(); selectRequests.clear();
mode = none; mode = none;
@@ -265,15 +264,15 @@ public class MobileInput extends InputHandler implements GestureListener{
ImageButtonStyle style = Styles.clearPartiali; ImageButtonStyle style = Styles.clearPartiali;
b.addImageButton(Icon.save, style, this::showSchematicSave).disabled(f -> lastSchematic == null || lastSchematic.file != null); b.button(Icon.save, style, this::showSchematicSave).disabled(f -> lastSchematic == null || lastSchematic.file != null);
b.addImageButton(Icon.cancel, style, () -> { b.button(Icon.cancel, style, () -> {
selectRequests.clear(); selectRequests.clear();
}); });
b.row(); b.row();
b.addImageButton(Icon.flipX, style, () -> flipRequests(selectRequests, true)); b.button(Icon.flipX, style, () -> flipRequests(selectRequests, true));
b.addImageButton(Icon.flipY, style, () -> flipRequests(selectRequests, false)); b.button(Icon.flipY, style, () -> flipRequests(selectRequests, false));
b.row(); b.row();
b.addImageButton(Icon.rotate, style, () -> rotateRequests(selectRequests, 1)); b.button(Icon.rotate, style, () -> rotateRequests(selectRequests, 1));
}).margin(4f); }).margin(4f);
}); });
@@ -63,7 +63,7 @@ public abstract class FilterOption{
table.label(() -> Core.bundle.get("filter.option." + name) + ": " + (int)getter.get()); table.label(() -> Core.bundle.get("filter.option." + name) + ": " + (int)getter.get());
} }
table.row(); table.row();
Slider slider = table.addSlider(min, max, step, setter).growX().get(); Slider slider = table.slider(min, max, step, setter).growX().get();
slider.setValue(getter.get()); slider.setValue(getter.get());
if(updateEditorOnChange){ if(updateEditorOnChange){
slider.changed(changed); slider.changed(changed);
@@ -88,7 +88,7 @@ public abstract class FilterOption{
@Override @Override
public void build(Table table){ public void build(Table table){
table.addButton(b -> b.addImage(supplier.get().icon(Cicon.small)).update(i -> ((TextureRegionDrawable)i.getDrawable()) table.button(b -> b.image(supplier.get().icon(Cicon.small)).update(i -> ((TextureRegionDrawable)i.getDrawable())
.setRegion(supplier.get() == Blocks.air ? Icon.block.getRegion() : supplier.get().icon(Cicon.small))).size(8 * 3), () -> { .setRegion(supplier.get() == Blocks.air ? Icon.block.getRegion() : supplier.get().icon(Cicon.small))).size(8 * 3), () -> {
FloatingDialog dialog = new FloatingDialog(""); FloatingDialog dialog = new FloatingDialog("");
dialog.setFillParent(false); dialog.setFillParent(false);
@@ -96,7 +96,7 @@ public abstract class FilterOption{
for(Block block : Vars.content.blocks()){ for(Block block : Vars.content.blocks()){
if(!filter.get(block)) continue; if(!filter.get(block)) continue;
dialog.cont.addImage(block == Blocks.air ? Icon.block.getRegion() : block.icon(Cicon.medium)).size(8 * 4).pad(3).get().clicked(() -> { dialog.cont.image(block == Blocks.air ? Icon.block.getRegion() : block.icon(Cicon.medium)).size(8 * 4).pad(3).get().clicked(() -> {
consumer.get(block); consumer.get(block);
dialog.hide(); dialog.hide();
changed.run(); changed.run();
+5 -5
View File
@@ -386,7 +386,7 @@ public class Mods implements Loadable{
cont.margin(15); cont.margin(15);
cont.add("$error.title"); cont.add("$error.title");
cont.row(); cont.row();
cont.addImage().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet); cont.image().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet);
cont.row(); cont.row();
cont.add("$mod.errors").wrap().growX().center().get().setAlignment(Align.center); cont.add("$mod.errors").wrap().growX().center().get().setAlignment(Align.center);
cont.row(); cont.row();
@@ -394,18 +394,18 @@ public class Mods implements Loadable{
mods.each(m -> m.enabled() && m.hasContentErrors(), m -> { mods.each(m -> m.enabled() && m.hasContentErrors(), m -> {
p.add(m.name).color(Pal.accent).left(); p.add(m.name).color(Pal.accent).left();
p.row(); p.row();
p.addImage().fillX().pad(4).color(Pal.accent); p.image().fillX().pad(4).color(Pal.accent);
p.row(); p.row();
p.table(d -> { p.table(d -> {
d.left().marginLeft(15f); d.left().marginLeft(15f);
for(Content c : m.erroredContent){ for(Content c : m.erroredContent){
d.add(c.minfo.sourceFile.nameWithoutExtension()).left().padRight(10); d.add(c.minfo.sourceFile.nameWithoutExtension()).left().padRight(10);
d.addImageTextButton("$details", Icon.downOpen, Styles.transt, () -> { d.button("$details", Icon.downOpen, Styles.transt, () -> {
new Dialog(""){{ new Dialog(""){{
setFillParent(true); setFillParent(true);
cont.pane(e -> e.add(c.minfo.error)).grow(); cont.pane(e -> e.add(c.minfo.error)).grow();
cont.row(); cont.row();
cont.addImageTextButton("$ok", Icon.left, this::hide).size(240f, 60f); cont.button("$ok", Icon.left, this::hide).size(240f, 60f);
}}.show(); }}.show();
}).size(190f, 50f).left().marginLeft(6); }).size(190f, 50f).left().marginLeft(6);
d.row(); d.row();
@@ -416,7 +416,7 @@ public class Mods implements Loadable{
}); });
cont.row(); cont.row();
cont.addButton("$ok", this::hide).size(300, 50); cont.button("$ok", this::hide).size(300, 50);
}}.show(); }}.show();
} }
} }
+1 -1
View File
@@ -105,7 +105,7 @@ public class BeControl{
}); });
dialog.cont.add(new Bar(() -> length[0] == 0 ? Core.bundle.get("be.updating") : (int)(progress[0] * length[0]) / 1024/ 1024 + "/" + length[0]/1024/1024 + " MB", () -> Pal.accent, () -> progress[0])).width(400f).height(70f); dialog.cont.add(new Bar(() -> length[0] == 0 ? Core.bundle.get("be.updating") : (int)(progress[0] * length[0]) / 1024/ 1024 + "/" + length[0]/1024/1024 + " MB", () -> Pal.accent, () -> progress[0])).width(400f).height(70f);
dialog.buttons.addImageTextButton("$cancel", Icon.cancel, () -> { dialog.buttons.button("$cancel", Icon.cancel, () -> {
cancel[0] = true; cancel[0] = true;
dialog.hide(); dialog.hide();
}).size(210f, 64f); }).size(210f, 64f);
+21
View File
@@ -114,6 +114,27 @@ public class UnitType extends UnlockableContent{
//region drawing //region drawing
public void draw(Unitc unit){
if(unit.isFlying()){
Draw.z(Layer.darkness);
drawShadow(unit);
}
Draw.z(Mathf.lerp(Layer.groundUnit, Layer.flyingUnit, unit.elevation()));
if(unit instanceof Legsc){
drawLegs((Legsc)unit);
}
drawOcclusion(unit);
drawEngine(unit);
drawBody(unit);
drawWeapons(unit);
if(drawCell) drawCell(unit);
if(drawItems) drawItems(unit);
drawLight(unit);
}
public void drawShadow(Unitc unit){ public void drawShadow(Unitc unit){
Draw.color(shadowColor); Draw.color(shadowColor);
Draw.rect(region, unit.x() + shadowTX * unit.elevation(), unit.y() + shadowTY * unit.elevation(), unit.rotation() - 90); Draw.rect(region, unit.x() + shadowTX * unit.elevation(), unit.y() + shadowTY * unit.elevation(), unit.rotation() - 90);
+5 -2
View File
@@ -1,9 +1,11 @@
package mindustry.type; package mindustry.type;
import arc.func.*; import arc.func.*;
import arc.graphics.g2d.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.ctype.*; import mindustry.ctype.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*;
public abstract class Weather extends MappableContent{ public abstract class Weather extends MappableContent{
protected float duration = 100f; protected float duration = 100f;
@@ -39,7 +41,7 @@ public abstract class Weather extends MappableContent{
@EntityDef(value = {Weatherc.class}, pooled = true, isFinal = false) @EntityDef(value = {Weatherc.class}, pooled = true, isFinal = false)
@Component @Component
abstract class WeatherComp implements Posc, DrawLayerWeatherc{ abstract class WeatherComp implements Posc, Drawc{
Weather weather; Weather weather;
void init(Weather weather){ void init(Weather weather){
@@ -47,7 +49,8 @@ public abstract class Weather extends MappableContent{
} }
@Override @Override
public void drawWeather(){ public void draw(){
Draw.z(Layer.weather);
weather.draw(); weather.draw();
} }
+12 -12
View File
@@ -17,13 +17,13 @@ public class ContentDisplay{
table.table(title -> { table.table(title -> {
int size = 8 * 6; int size = 8 * 6;
title.addImage(block.icon(Cicon.xlarge)).size(size); title.image(block.icon(Cicon.xlarge)).size(size);
title.add("[accent]" + block.localizedName).padLeft(5); title.add("[accent]" + block.localizedName).padLeft(5);
}); });
table.row(); table.row();
table.addImage().height(3).color(Color.lightGray).pad(8).padLeft(0).padRight(0).fillX(); table.image().height(3).color(Color.lightGray).pad(8).padLeft(0).padRight(0).fillX();
table.row(); table.row();
@@ -31,7 +31,7 @@ public class ContentDisplay{
table.add(block.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX(); table.add(block.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row(); table.row();
table.addImage().height(3).color(Color.lightGray).pad(8).padLeft(0).padRight(0).fillX(); table.image().height(3).color(Color.lightGray).pad(8).padLeft(0).padRight(0).fillX();
table.row(); table.row();
} }
@@ -65,13 +65,13 @@ public class ContentDisplay{
public static void displayItem(Table table, Item item){ public static void displayItem(Table table, Item item){
table.table(title -> { table.table(title -> {
title.addImage(item.icon(Cicon.xlarge)).size(8 * 6); title.image(item.icon(Cicon.xlarge)).size(8 * 6);
title.add("[accent]" + item.localizedName).padLeft(5); title.add("[accent]" + item.localizedName).padLeft(5);
}); });
table.row(); table.row();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX(); table.image().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row(); table.row();
@@ -79,7 +79,7 @@ public class ContentDisplay{
table.add(item.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX(); table.add(item.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row(); table.row();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX(); table.image().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row(); table.row();
} }
@@ -99,13 +99,13 @@ public class ContentDisplay{
public static void displayLiquid(Table table, Liquid liquid){ public static void displayLiquid(Table table, Liquid liquid){
table.table(title -> { table.table(title -> {
title.addImage(liquid.icon(Cicon.xlarge)).size(8 * 6); title.image(liquid.icon(Cicon.xlarge)).size(8 * 6);
title.add("[accent]" + liquid.localizedName).padLeft(5); title.add("[accent]" + liquid.localizedName).padLeft(5);
}); });
table.row(); table.row();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX(); table.image().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row(); table.row();
@@ -113,7 +113,7 @@ public class ContentDisplay{
table.add(liquid.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX(); table.add(liquid.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row(); table.row();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX(); table.image().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row(); table.row();
} }
@@ -133,13 +133,13 @@ public class ContentDisplay{
public static void displayUnit(Table table, UnitType unit){ public static void displayUnit(Table table, UnitType unit){
table.table(title -> { table.table(title -> {
title.addImage(unit.icon(Cicon.xlarge)).size(8 * 6); title.image(unit.icon(Cicon.xlarge)).size(8 * 6);
title.add("[accent]" + unit.localizedName).padLeft(5); title.add("[accent]" + unit.localizedName).padLeft(5);
}); });
table.row(); table.row();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX(); table.image().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row(); table.row();
@@ -147,7 +147,7 @@ public class ContentDisplay{
table.add(unit.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX(); table.add(unit.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row(); table.row();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX(); table.image().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row(); table.row();
} }
+2 -3
View File
@@ -3,7 +3,6 @@ package mindustry.ui;
import arc.graphics.*; import arc.graphics.*;
import arc.scene.ui.*; import arc.scene.ui.*;
import arc.scene.ui.layout.*; import arc.scene.ui.layout.*;
import mindustry.core.GameState.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.type.*; import mindustry.type.*;
@@ -33,14 +32,14 @@ public class ItemsDisplay extends Table{
for(Item item : content.items()){ for(Item item : content.items()){
if(item.type == ItemType.material && data.isUnlocked(item)){ if(item.type == ItemType.material && data.isUnlocked(item)){
t.label(() -> format(item)).left(); t.label(() -> format(item)).left();
t.addImage(item.icon(Cicon.small)).size(8 * 3).padLeft(4).padRight(4); t.image(item.icon(Cicon.small)).size(8 * 3).padLeft(4).padRight(4);
t.add(item.localizedName).color(Color.lightGray).left(); t.add(item.localizedName).color(Color.lightGray).left();
t.row(); t.row();
} }
} }
}).get().setScrollingDisabled(true, false), false).setDuration(0.3f); }).get().setScrollingDisabled(true, false), false).setDuration(0.3f);
c.addImageTextButton("$launcheditems", Icon.downOpen, Styles.clearTogglet, col::toggle).update(t -> { c.button("$launcheditems", Icon.downOpen, Styles.clearTogglet, col::toggle).update(t -> {
t.setText(state.isMenu() ? "$launcheditems" : "$launchinfo"); t.setText(state.isMenu() ? "$launcheditems" : "$launchinfo");
t.setChecked(col.isCollapsed()); t.setChecked(col.isCollapsed());
((Image)t.getChildren().get(1)).setDrawable(col.isCollapsed() ? Icon.upOpen : Icon.downOpen); ((Image)t.getChildren().get(1)).setDrawable(col.isCollapsed() ? Icon.upOpen : Icon.downOpen);
@@ -48,14 +48,14 @@ public class AboutDialog extends FloatingDialog{
Table table = new Table(Tex.underline); Table table = new Table(Tex.underline);
table.margin(0); table.margin(0);
table.table(img -> { table.table(img -> {
img.addImage().height(h - 5).width(40f).color(link.color); img.image().height(h - 5).width(40f).color(link.color);
img.row(); img.row();
img.addImage().height(5).width(40f).color(link.color.cpy().mul(0.8f, 0.8f, 0.8f, 1f)); img.image().height(5).width(40f).color(link.color.cpy().mul(0.8f, 0.8f, 0.8f, 1f));
}).expandY(); }).expandY();
table.table(i -> { table.table(i -> {
i.background(Tex.buttonEdge3); i.background(Tex.buttonEdge3);
i.addImage(link.icon); i.image(link.icon);
}).size(h - 5, h); }).size(h - 5, h);
table.table(inset -> { table.table(inset -> {
@@ -64,7 +64,7 @@ public class AboutDialog extends FloatingDialog{
inset.labelWrap(link.description).width(w - 100f).color(Color.lightGray).growX(); inset.labelWrap(link.description).width(w - 100f).color(Color.lightGray).growX();
}).padLeft(8); }).padLeft(8);
table.addImageButton(Icon.link, () -> { table.button(Icon.link, () -> {
if(link.name.equals("wiki")) Events.fire(Trigger.openWiki); if(link.name.equals("wiki")) Events.fire(Trigger.openWiki);
if(!Core.net.openURI(link.link)){ if(!Core.net.openURI(link.link)){
@@ -82,7 +82,7 @@ public class AboutDialog extends FloatingDialog{
addCloseButton(); addCloseButton();
buttons.addButton("$credits", this::showCredits).size(200f, 64f); buttons.button("$credits", this::showCredits).size(200f, 64f);
if(Core.graphics.isPortrait()){ if(Core.graphics.isPortrait()){
for(Cell<?> cell : buttons.getCells()){ for(Cell<?> cell : buttons.getCells()){
@@ -98,7 +98,7 @@ public class AboutDialog extends FloatingDialog{
dialog.cont.add("$credits.text").fillX().wrap().get().setAlignment(Align.center); dialog.cont.add("$credits.text").fillX().wrap().get().setAlignment(Align.center);
dialog.cont.row(); dialog.cont.row();
if(!contributors.isEmpty()){ if(!contributors.isEmpty()){
dialog.cont.addImage().color(Pal.accent).fillX().height(3f).pad(3f); dialog.cont.image().color(Pal.accent).fillX().height(3f).pad(3f);
dialog.cont.row(); dialog.cont.row();
dialog.cont.add("$contributors"); dialog.cont.add("$contributors");
dialog.cont.row(); dialog.cont.row();
@@ -38,7 +38,7 @@ public class AdminsDialog extends FloatingDialog{
res.labelWrap("[LIGHT_GRAY]" + info.lastName).width(w - h - 24f); res.labelWrap("[LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
res.add().growX(); res.add().growX();
res.addImageButton(Icon.cancel, () -> { res.button(Icon.cancel, () -> {
ui.showConfirm("$confirm", "$confirmunadmin", () -> { ui.showConfirm("$confirm", "$confirmunadmin", () -> {
netServer.admins.unAdminPlayer(info.id); netServer.admins.unAdminPlayer(info.id);
Groups.player.each(player -> { Groups.player.each(player -> {
@@ -39,7 +39,7 @@ public class BansDialog extends FloatingDialog{
res.labelWrap("IP: [LIGHT_GRAY]" + info.lastIP + "\n[]Name: [LIGHT_GRAY]" + info.lastName).width(w - h - 24f); res.labelWrap("IP: [LIGHT_GRAY]" + info.lastIP + "\n[]Name: [LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
res.add().growX(); res.add().growX();
res.addImageButton(Icon.cancel, () -> { res.button(Icon.cancel, () -> {
ui.showConfirm("$confirm", "$confirmunban", () -> { ui.showConfirm("$confirm", "$confirmunban", () -> {
netServer.admins.unbanPlayerID(info.id); netServer.admins.unbanPlayerID(info.id);
setup(); setup();
@@ -38,24 +38,24 @@ public class ColorPicker extends FloatingDialog{
t.defaults().padBottom(4); t.defaults().padBottom(4);
t.add("R").color(Pal.remove); t.add("R").color(Pal.remove);
t.addSlider(0f, 1f, 0.01f, current.r, current::r).width(w); t.slider(0f, 1f, 0.01f, current.r, current::r).width(w);
t.row(); t.row();
t.add("G").color(Color.lime); t.add("G").color(Color.lime);
t.addSlider(0f, 1f, 0.01f, current.g, current::g).width(w); t.slider(0f, 1f, 0.01f, current.g, current::g).width(w);
t.row(); t.row();
t.add("B").color(Color.royal); t.add("B").color(Color.royal);
t.addSlider(0f, 1f, 0.01f, current.b, current::b).width(w); t.slider(0f, 1f, 0.01f, current.b, current::b).width(w);
t.row(); t.row();
if(alpha){ if(alpha){
t.add("A"); t.add("A");
t.addSlider(0f, 1f, 0.01f, current.a, current::a).width(w); t.slider(0f, 1f, 0.01f, current.a, current::a).width(w);
t.row(); t.row();
} }
}); });
buttons.clear(); buttons.clear();
addCloseButton(); addCloseButton();
buttons.addImageTextButton("$ok", Icon.ok, () -> { buttons.button("$ok", Icon.ok, () -> {
cons.get(current); cons.get(current);
hide(); hide();
}); });
@@ -17,10 +17,10 @@ public class ControlsDialog extends KeybindDialog{
@Override @Override
public void addCloseButton(){ public void addCloseButton(){
buttons.addImageTextButton("$back", Icon.left, this::hide).size(230f, 64f); buttons.button("$back", Icon.left, this::hide).size(230f, 64f);
keyDown(key -> { keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK) if(key == KeyCode.escape || key == KeyCode.back)
hide(); hide();
}); });
} }
@@ -62,14 +62,14 @@ public class CustomGameDialog extends FloatingDialog{
for(Gamemode mode : Gamemode.all){ for(Gamemode mode : Gamemode.all){
TextureRegionDrawable icon = Vars.ui.getIcon("mode" + Strings.capitalize(mode.name()) + "Small"); TextureRegionDrawable icon = Vars.ui.getIcon("mode" + Strings.capitalize(mode.name()) + "Small");
if(mode.valid(map) && Core.atlas.isFound(icon.getRegion())){ if(mode.valid(map) && Core.atlas.isFound(icon.getRegion())){
t.addImage(icon).size(16f).pad(4f); t.image(icon).size(16f).pad(4f);
} }
} }
}).left(); }).left();
image.row(); image.row();
image.add(map.name()).pad(1f).growX().wrap().left().get().setEllipsis(true); image.add(map.name()).pad(1f).growX().wrap().left().get().setEllipsis(true);
image.row(); image.row();
image.addImage(Tex.whiteui, Pal.gray).growX().pad(3).height(4f); image.image(Tex.whiteui, Pal.gray).growX().pad(3).height(4f);
image.row(); image.row();
image.add(img).size(images); image.add(img).size(images);
@@ -35,12 +35,12 @@ public class CustomRulesDialog extends FloatingDialog{
banDialog.addCloseButton(); banDialog.addCloseButton();
banDialog.shown(this::rebuildBanned); banDialog.shown(this::rebuildBanned);
banDialog.buttons.addImageTextButton("$addall", Icon.add, () -> { banDialog.buttons.button("$addall", Icon.add, () -> {
rules.bannedBlocks.addAll(content.blocks().select(Block::isBuildable)); rules.bannedBlocks.addAll(content.blocks().select(Block::isBuildable));
rebuildBanned(); rebuildBanned();
}).size(180, 64f); }).size(180, 64f);
banDialog.buttons.addImageTextButton("$clear", Icon.trash, () -> { banDialog.buttons.button("$clear", Icon.trash, () -> {
rules.bannedBlocks.clear(); rules.bannedBlocks.clear();
rebuildBanned(); rebuildBanned();
}).size(180, 64f); }).size(180, 64f);
@@ -69,10 +69,10 @@ public class CustomRulesDialog extends FloatingDialog{
for(Block block : array){ for(Block block : array){
t.table(Tex.underline, b -> { t.table(Tex.underline, b -> {
b.left().margin(4f); b.left().margin(4f);
b.addImage(block.icon(Cicon.medium)).size(Cicon.medium.size).padRight(3); b.image(block.icon(Cicon.medium)).size(Cicon.medium.size).padRight(3);
b.add(block.localizedName).color(Color.lightGray).padLeft(3).growX().left().wrap(); b.add(block.localizedName).color(Color.lightGray).padLeft(3).growX().left().wrap();
b.addImageButton(Icon.cancel, Styles.clearPartiali, () -> { b.button(Icon.cancel, Styles.clearPartiali, () -> {
rules.bannedBlocks.remove(block); rules.bannedBlocks.remove(block);
rebuildBanned(); rebuildBanned();
}).size(70f).pad(-4f).padLeft(0f); }).size(70f).pad(-4f).padLeft(0f);
@@ -84,14 +84,14 @@ public class CustomRulesDialog extends FloatingDialog{
} }
}).get().setScrollYForce(previousScroll); }).get().setScrollYForce(previousScroll);
banDialog.cont.row(); banDialog.cont.row();
banDialog.cont.addImageTextButton("$add", Icon.add, () -> { banDialog.cont.button("$add", Icon.add, () -> {
FloatingDialog dialog = new FloatingDialog("$add"); FloatingDialog dialog = new FloatingDialog("$add");
dialog.cont.pane(t -> { dialog.cont.pane(t -> {
t.left().margin(14f); t.left().margin(14f);
int[] i = {0}; int[] i = {0};
content.blocks().each(b -> !rules.bannedBlocks.contains(b) && b.isBuildable(), b -> { content.blocks().each(b -> !rules.bannedBlocks.contains(b) && b.isBuildable(), b -> {
int cols = mobile && Core.graphics.isPortrait() ? 4 : 12; int cols = mobile && Core.graphics.isPortrait() ? 4 : 12;
t.addImageButton(new TextureRegionDrawable(b.icon(Cicon.medium)), Styles.cleari, () -> { t.button(new TextureRegionDrawable(b.icon(Cicon.medium)), Styles.cleari, () -> {
rules.bannedBlocks.add(b); rules.bannedBlocks.add(b);
rebuildBanned(); rebuildBanned();
dialog.hide(); dialog.hide();
@@ -118,7 +118,7 @@ public class CustomRulesDialog extends FloatingDialog{
cont.clear(); cont.clear();
cont.pane(m -> main = m).get().setScrollingDisabled(true, false); cont.pane(m -> main = m).get().setScrollingDisabled(true, false);
main.margin(10f); main.margin(10f);
main.addButton("$settings.reset", () -> { main.button("$settings.reset", () -> {
rules = resetter.get(); rules = resetter.get();
setup(); setup();
requestKeyboard(); requestKeyboard();
@@ -145,7 +145,7 @@ public class CustomRulesDialog extends FloatingDialog{
number("$rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources); number("$rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources);
number("$rules.blockhealthmultiplier", f -> rules.blockHealthMultiplier = f, () -> rules.blockHealthMultiplier); number("$rules.blockhealthmultiplier", f -> rules.blockHealthMultiplier = f, () -> rules.blockHealthMultiplier);
main.addButton("$configure", main.button("$configure",
() -> loadoutDialog.show(Blocks.coreShard.itemCapacity, rules.loadout, () -> loadoutDialog.show(Blocks.coreShard.itemCapacity, rules.loadout,
() -> { () -> {
rules.loadout.clear(); rules.loadout.clear();
@@ -154,7 +154,7 @@ public class CustomRulesDialog extends FloatingDialog{
)).left().width(300f); )).left().width(300f);
main.row(); main.row();
main.addButton("$bannedblocks", banDialog::show).left().width(300f); main.button("$bannedblocks", banDialog::show).left().width(300f);
main.row(); main.row();
title("$rules.title.player"); title("$rules.title.player");
@@ -176,7 +176,7 @@ public class CustomRulesDialog extends FloatingDialog{
number("$rules.solarpowermultiplier", f -> rules.solarPowerMultiplier = f, () -> rules.solarPowerMultiplier); number("$rules.solarpowermultiplier", f -> rules.solarPowerMultiplier = f, () -> rules.solarPowerMultiplier);
check("$rules.lighting", b -> rules.lighting = b, () -> rules.lighting); check("$rules.lighting", b -> rules.lighting = b, () -> rules.lighting);
main.addButton(b -> { main.button(b -> {
b.left(); b.left();
b.table(Tex.pane, in -> { b.table(Tex.pane, in -> {
in.stack(new Image(Tex.alphaBg), new Image(Tex.whiteui){{ in.stack(new Image(Tex.alphaBg), new Image(Tex.whiteui){{
@@ -197,7 +197,7 @@ public class CustomRulesDialog extends FloatingDialog{
t.left(); t.left();
t.add(text).left().padRight(5) t.add(text).left().padRight(5)
.update(a -> a.setColor(condition.get() ? Color.white : Color.gray)); .update(a -> a.setColor(condition.get() ? Color.white : Color.gray));
Vars.platform.addDialog(t.addField((integer ? (int)prov.get() : prov.get()) + "", s -> cons.get(Strings.parseFloat(s))) Vars.platform.addDialog(t.field((integer ? (int)prov.get() : prov.get()) + "", s -> cons.get(Strings.parseFloat(s)))
.padRight(100f) .padRight(100f)
.update(a -> a.setDisabled(!condition.get())) .update(a -> a.setDisabled(!condition.get()))
.valid(Strings::canParsePositiveFloat).width(120f).left().get()); .valid(Strings::canParsePositiveFloat).width(120f).left().get());
@@ -210,14 +210,14 @@ public class CustomRulesDialog extends FloatingDialog{
} }
void check(String text, Boolc cons, Boolp prov, Boolp condition){ void check(String text, Boolc cons, Boolp prov, Boolp condition){
main.addCheck(text, cons).checked(prov.get()).update(a -> a.setDisabled(!condition.get())).padRight(100f).get().left(); main.check(text, cons).checked(prov.get()).update(a -> a.setDisabled(!condition.get())).padRight(100f).get().left();
main.row(); main.row();
} }
void title(String text){ void title(String text){
main.add(text).color(Pal.accent).padTop(20).padRight(100f).padBottom(-3); main.add(text).color(Pal.accent).padTop(20).padRight(100f).padBottom(-3);
main.row(); main.row();
main.addImage().color(Pal.accent).height(3f).padRight(100f).padBottom(20); main.image().color(Pal.accent).height(3f).padRight(100f).padBottom(20);
main.row(); main.row();
} }
} }
@@ -9,7 +9,6 @@ import arc.scene.ui.*;
import arc.scene.ui.layout.*; import arc.scene.ui.layout.*;
import arc.util.*; import arc.util.*;
import mindustry.*; import mindustry.*;
import mindustry.core.GameState.*;
import mindustry.ctype.*; import mindustry.ctype.*;
import mindustry.ctype.ContentType; import mindustry.ctype.ContentType;
import mindustry.gen.*; import mindustry.gen.*;
@@ -46,7 +45,7 @@ public class DatabaseDialog extends FloatingDialog{
table.add("$content." + type.name() + ".name").growX().left().color(Pal.accent); table.add("$content." + type.name() + ".name").growX().left().color(Pal.accent);
table.row(); table.row();
table.addImage().growX().pad(5).padLeft(0).padRight(0).height(3).color(Pal.accent); table.image().growX().pad(5).padLeft(0).padRight(0).height(3).color(Pal.accent);
table.row(); table.row();
table.table(list -> { table.table(list -> {
list.left(); list.left();
@@ -69,7 +68,7 @@ public class DatabaseDialog extends FloatingDialog{
if(unlocked(unlock)){ if(unlocked(unlock)){
image.clicked(() -> { image.clicked(() -> {
if(Core.input.keyDown(KeyCode.SHIFT_LEFT) && Fonts.getUnicode(unlock.name) != 0){ if(Core.input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(unlock.name) != 0){
Core.app.setClipboardText((char)Fonts.getUnicode(unlock.name) + ""); Core.app.setClipboardText((char)Fonts.getUnicode(unlock.name) + "");
ui.showInfoFade("$copied"); ui.showInfoFade("$copied");
}else{ }else{
@@ -23,14 +23,14 @@ public class DiscordDialog extends Dialog{
t.background(Tex.button).margin(0); t.background(Tex.button).margin(0);
t.table(img -> { t.table(img -> {
img.addImage().height(h - 5).width(40f).color(color); img.image().height(h - 5).width(40f).color(color);
img.row(); img.row();
img.addImage().height(5).width(40f).color(color.cpy().mul(0.8f, 0.8f, 0.8f, 1f)); img.image().height(5).width(40f).color(color.cpy().mul(0.8f, 0.8f, 0.8f, 1f));
}).expandY(); }).expandY();
t.table(i -> { t.table(i -> {
i.background(Tex.button); i.background(Tex.button);
i.addImage(Icon.discord); i.image(Icon.discord);
}).size(h).left(); }).size(h).left();
t.add("$discord").color(Pal.accent).growX().padLeft(10f); t.add("$discord").color(Pal.accent).growX().padLeft(10f);
@@ -38,11 +38,11 @@ public class DiscordDialog extends Dialog{
buttons.defaults().size(150f, 50); buttons.defaults().size(150f, 50);
buttons.addButton("$back", this::hide); buttons.button("$back", this::hide);
buttons.addButton("$copylink", () -> { buttons.button("$copylink", () -> {
Core.app.setClipboardText(discordURL); Core.app.setClipboardText(discordURL);
}); });
buttons.addButton("$openlink", () -> { buttons.button("$openlink", () -> {
if(!Core.net.openURI(discordURL)){ if(!Core.net.openURI(discordURL)){
ui.showErrorMessage("$linkfail"); ui.showErrorMessage("$linkfail");
Core.app.setClipboardText(discordURL); Core.app.setClipboardText(discordURL);
@@ -20,7 +20,7 @@ public class FloatingDialog extends Dialog{
setFillParent(true); setFillParent(true);
this.title.setAlignment(Align.center); this.title.setAlignment(Align.center);
titleTable.row(); titleTable.row();
titleTable.addImage(Tex.whiteui, Pal.accent) titleTable.image(Tex.whiteui, Pal.accent)
.growX().height(3f).pad(4f); .growX().height(3f).pad(4f);
hidden(() -> { hidden(() -> {
@@ -56,10 +56,10 @@ public class FloatingDialog extends Dialog{
@Override @Override
public void addCloseButton(){ public void addCloseButton(){
buttons.defaults().size(210f, 64f); buttons.defaults().size(210f, 64f);
buttons.addImageTextButton("$back", Icon.left, this::hide).size(210f, 64f); buttons.button("$back", Icon.left, this::hide).size(210f, 64f);
keyDown(key -> { keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){ if(key == KeyCode.escape || key == KeyCode.back){
Core.app.post(this::hide); Core.app.post(this::hide);
} }
}); });
@@ -37,7 +37,7 @@ public class GameOverDialog extends FloatingDialog{
if(state.rules.pvp){ if(state.rules.pvp){
cont.add(Core.bundle.format("gameover.pvp", winner.localized())).pad(6); cont.add(Core.bundle.format("gameover.pvp", winner.localized())).pad(6);
buttons.addButton("$menu", () -> { buttons.button("$menu", () -> {
hide(); hide();
logic.reset(); logic.reset();
}).size(130f, 60f); }).size(130f, 60f);
@@ -71,7 +71,7 @@ public class GameOverDialog extends FloatingDialog{
if(state.stats.itemsDelivered.get(item, 0) > 0){ if(state.stats.itemsDelivered.get(item, 0) > 0){
t.table(items -> { t.table(items -> {
items.add(" [LIGHT_GRAY]" + state.stats.itemsDelivered.get(item, 0)); items.add(" [LIGHT_GRAY]" + state.stats.itemsDelivered.get(item, 0));
items.addImage(item.icon(Cicon.small)).size(8 * 3).pad(4); items.image(item.icon(Cicon.small)).size(8 * 3).pad(4);
}).left(); }).left();
t.row(); t.row();
} }
@@ -86,13 +86,13 @@ public class GameOverDialog extends FloatingDialog{
}).pad(12); }).pad(12);
if(state.isCampaign()){ if(state.isCampaign()){
buttons.addButton("$continue", () -> { buttons.button("$continue", () -> {
hide(); hide();
logic.reset(); logic.reset();
ui.planet.show(); ui.planet.show();
}).size(130f, 60f); }).size(130f, 60f);
}else{ }else{
buttons.addButton("$menu", () -> { buttons.button("$menu", () -> {
hide(); hide();
logic.reset(); logic.reset();
}).size(130f, 60f); }).size(130f, 60f);
@@ -22,14 +22,14 @@ public class HostDialog extends FloatingDialog{
cont.table(t -> { cont.table(t -> {
t.add("$name").padRight(10); t.add("$name").padRight(10);
t.addField(Core.settings.getString("name"), text -> { t.field(Core.settings.getString("name"), text -> {
player.name(text); player.name(text);
Core.settings.put("name", text); Core.settings.put("name", text);
Core.settings.save(); Core.settings.save();
ui.listfrag.rebuild(); ui.listfrag.rebuild();
}).grow().pad(8).get().setMaxLength(40); }).grow().pad(8).get().setMaxLength(40);
ImageButton button = t.addImageButton(Tex.whiteui, Styles.clearFulli, 40, () -> { ImageButton button = t.button(Tex.whiteui, Styles.clearFulli, 40, () -> {
new PaletteDialog().show(color -> { new PaletteDialog().show(color -> {
player.color().set(color); player.color().set(color);
Core.settings.put("color-0", color.rgba()); Core.settings.put("color-0", color.rgba());
@@ -43,7 +43,7 @@ public class HostDialog extends FloatingDialog{
cont.add().width(65f); cont.add().width(65f);
cont.addButton("$host", () -> { cont.button("$host", () -> {
if(Core.settings.getString("name").trim().isEmpty()){ if(Core.settings.getString("name").trim().isEmpty()){
ui.showInfo("$noname"); ui.showInfo("$noname");
return; return;
@@ -52,7 +52,7 @@ public class HostDialog extends FloatingDialog{
runHost(); runHost();
}).width(w).height(70f); }).width(w).height(70f);
cont.addButton("?", () -> ui.showInfo("$host.info")).size(65f, 70f).padLeft(6f); cont.button("?", () -> ui.showInfo("$host.info")).size(65f, 70f).padLeft(6f);
shown(() -> { shown(() -> {
if(!steam){ if(!steam){
+19 -19
View File
@@ -41,13 +41,13 @@ public class JoinDialog extends FloatingDialog{
buttons.add().growX().width(-1); buttons.add().growX().width(-1);
if(!steam){ if(!steam){
buttons.addButton("?", () -> ui.showInfo("$join.info")).size(60f, 64f).width(-1); buttons.button("?", () -> ui.showInfo("$join.info")).size(60f, 64f).width(-1);
} }
add = new FloatingDialog("$joingame.title"); add = new FloatingDialog("$joingame.title");
add.cont.add("$joingame.ip").padRight(5f).left(); add.cont.add("$joingame.ip").padRight(5f).left();
TextField field = add.cont.addField(Core.settings.getString("ip"), text -> { TextField field = add.cont.field(Core.settings.getString("ip"), text -> {
Core.settings.put("ip", text); Core.settings.put("ip", text);
Core.settings.save(); Core.settings.save();
}).size(320f, 54f).get(); }).size(320f, 54f).get();
@@ -56,8 +56,8 @@ public class JoinDialog extends FloatingDialog{
add.cont.row(); add.cont.row();
add.buttons.defaults().size(140f, 60f).pad(4f); add.buttons.defaults().size(140f, 60f).pad(4f);
add.buttons.addButton("$cancel", add::hide); add.buttons.button("$cancel", add::hide);
add.buttons.addButton("$ok", () -> { add.buttons.button("$ok", () -> {
if(renaming == null){ if(renaming == null){
Server server = new Server(); Server server = new Server();
server.setIP(Core.settings.getString("ip")); server.setIP(Core.settings.getString("ip"));
@@ -81,7 +81,7 @@ public class JoinDialog extends FloatingDialog{
} }
}); });
keyDown(KeyCode.F5, this::refreshAll); keyDown(KeyCode.f5, this::refreshAll);
shown(() -> { shown(() -> {
setup(); setup();
@@ -111,7 +111,7 @@ public class JoinDialog extends FloatingDialog{
//why are java lambdas this bad //why are java lambdas this bad
TextButton[] buttons = {null}; TextButton[] buttons = {null};
TextButton button = buttons[0] = remote.addButton("[accent]" + server.displayIP(), Styles.cleart, () -> { TextButton button = buttons[0] = remote.button("[accent]" + server.displayIP(), Styles.cleart, () -> {
if(!buttons[0].childrenPressed()){ if(!buttons[0].childrenPressed()){
if(server.lastHost != null){ if(server.lastHost != null){
safeConnect(server.ip, server.port, server.lastHost.version); safeConnect(server.ip, server.port, server.lastHost.version);
@@ -129,26 +129,26 @@ public class JoinDialog extends FloatingDialog{
inner.add(button.getLabel()).growX(); inner.add(button.getLabel()).growX();
inner.addImageButton(Icon.upOpen, Styles.emptyi, () -> { inner.button(Icon.upOpen, Styles.emptyi, () -> {
moveRemote(server, -1); moveRemote(server, -1);
}).margin(3f).padTop(6f).top().right(); }).margin(3f).padTop(6f).top().right();
inner.addImageButton(Icon.downOpen, Styles.emptyi, () -> { inner.button(Icon.downOpen, Styles.emptyi, () -> {
moveRemote(server, +1); moveRemote(server, +1);
}).margin(3f).pad(2).padTop(6f).top().right(); }).margin(3f).pad(2).padTop(6f).top().right();
inner.addImageButton(Icon.refresh, Styles.emptyi, () -> { inner.button(Icon.refresh, Styles.emptyi, () -> {
refreshServer(server); refreshServer(server);
}).margin(3f).pad(2).padTop(6f).top().right(); }).margin(3f).pad(2).padTop(6f).top().right();
inner.addImageButton(Icon.pencil, Styles.emptyi, () -> { inner.button(Icon.pencil, Styles.emptyi, () -> {
renaming = server; renaming = server;
add.show(); add.show();
}).margin(3f).pad(2).padTop(6f).top().right(); }).margin(3f).pad(2).padTop(6f).top().right();
inner.addImageButton(Icon.trash, Styles.emptyi, () -> { inner.button(Icon.trash, Styles.emptyi, () -> {
ui.showConfirm("$confirm", "$server.delete", () -> { ui.showConfirm("$confirm", "$server.delete", () -> {
servers.remove(server, true); servers.remove(server, true);
saveServers(); saveServers();
@@ -262,7 +262,7 @@ public class JoinDialog extends FloatingDialog{
cont.table(t -> { cont.table(t -> {
t.add("$name").padRight(10); t.add("$name").padRight(10);
if(!steam){ if(!steam){
t.addField(Core.settings.getString("name"), text -> { t.field(Core.settings.getString("name"), text -> {
player.name(text); player.name(text);
Core.settings.put("name", text); Core.settings.put("name", text);
Core.settings.save(); Core.settings.save();
@@ -271,7 +271,7 @@ public class JoinDialog extends FloatingDialog{
t.add(player.name()).update(l -> l.setColor(player.color())).grow().pad(8); t.add(player.name()).update(l -> l.setColor(player.color())).grow().pad(8);
} }
ImageButton button = t.addImageButton(Tex.whiteui, Styles.clearFulli, 40, () -> { ImageButton button = t.button(Tex.whiteui, Styles.clearFulli, 40, () -> {
new PaletteDialog().show(color -> { new PaletteDialog().show(color -> {
player.color().set(color); player.color().set(color);
Core.settings.put("color-0", color.rgba8888()); Core.settings.put("color-0", color.rgba8888());
@@ -283,7 +283,7 @@ public class JoinDialog extends FloatingDialog{
cont.row(); cont.row();
cont.add(pane).width(w + 38).pad(0); cont.add(pane).width(w + 38).pad(0);
cont.row(); cont.row();
cont.addCenteredImageTextButton("$server.add", Icon.add, () -> { cont.buttonCenter("$server.add", Icon.add, () -> {
renaming = null; renaming = null;
add.show(); add.show();
}).marginLeft(10).width(w).height(80f).update(button -> { }).marginLeft(10).width(w).height(80f).update(button -> {
@@ -310,13 +310,13 @@ public class JoinDialog extends FloatingDialog{
hosts.table(name -> { hosts.table(name -> {
name.add(label).pad(10).growX().left().color(Pal.accent); name.add(label).pad(10).growX().left().color(Pal.accent);
name.addImageButton(Icon.downOpen, Styles.emptyi, () -> { name.button(Icon.downOpen, Styles.emptyi, () -> {
coll.toggle(false); coll.toggle(false);
Core.settings.putSave("collapsed-" + label, coll.isCollapsed()); Core.settings.putSave("collapsed-" + label, coll.isCollapsed());
}).update(i -> i.getStyle().imageUp = (!coll.isCollapsed() ? Icon.upOpen : Icon.downOpen)).size(40f).right().padRight(10f); }).update(i -> i.getStyle().imageUp = (!coll.isCollapsed() ? Icon.upOpen : Icon.downOpen)).size(40f).right().padRight(10f);
}).growX(); }).growX();
hosts.row(); hosts.row();
hosts.addImage().growX().pad(5).padLeft(10).padRight(10).height(3).color(Pal.accent); hosts.image().growX().pad(5).padLeft(10).padRight(10).height(3).color(Pal.accent);
hosts.row(); hosts.row();
hosts.add(coll).width(targetWidth()); hosts.add(coll).width(targetWidth());
hosts.row(); hosts.row();
@@ -350,7 +350,7 @@ public class JoinDialog extends FloatingDialog{
local.background(Tex.button); local.background(Tex.button);
local.add("$hosts.none").pad(10f); local.add("$hosts.none").pad(10f);
local.add().growX(); local.add().growX();
local.addImageButton(Icon.refresh, this::refreshLocal).pad(-12f).padLeft(0).size(70f); local.button(Icon.refresh, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
}else{ }else{
local.background(null); local.background(null);
} }
@@ -366,7 +366,7 @@ public class JoinDialog extends FloatingDialog{
local.row(); local.row();
TextButton button = local.addButton("", Styles.cleart, () -> safeConnect(host.address, host.port, host.version)) TextButton button = local.button("", Styles.cleart, () -> safeConnect(host.address, host.port, host.version))
.width(w).pad(5f).get(); .width(w).pad(5f).get();
button.clearChildren(); button.clearChildren();
buildServer(host, button); buildServer(host, button);
@@ -378,7 +378,7 @@ public class JoinDialog extends FloatingDialog{
global.row(); global.row();
TextButton button = global.addButton("", Styles.cleart, () -> safeConnect(host.address, host.port, host.version)) TextButton button = global.button("", Styles.cleart, () -> safeConnect(host.address, host.port, host.version))
.width(w).pad(5f).get(); .width(w).pad(5f).get();
button.clearChildren(); button.clearChildren();
buildServer(host, button); buildServer(host, button);
@@ -70,25 +70,25 @@ public class LoadDialog extends FloatingDialog{
t.right(); t.right();
t.defaults().size(40f); t.defaults().size(40f);
t.addImageButton(Icon.save, Styles.emptytogglei, () -> { t.button(Icon.save, Styles.emptytogglei, () -> {
slot.setAutosave(!slot.isAutosave()); slot.setAutosave(!slot.isAutosave());
}).checked(slot.isAutosave()).right(); }).checked(slot.isAutosave()).right();
t.addImageButton(Icon.trash, Styles.emptyi, () -> { t.button(Icon.trash, Styles.emptyi, () -> {
ui.showConfirm("$confirm", "$save.delete.confirm", () -> { ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
slot.delete(); slot.delete();
setup(); setup();
}); });
}).right(); }).right();
t.addImageButton(Icon.pencil, Styles.emptyi, () -> { t.button(Icon.pencil, Styles.emptyi, () -> {
ui.showTextInput("$save.rename", "$save.rename.text", slot.getName(), text -> { ui.showTextInput("$save.rename", "$save.rename.text", slot.getName(), text -> {
slot.setName(text); slot.setName(text);
setup(); setup();
}); });
}).right(); }).right();
t.addImageButton(Icon.export, Styles.emptyi, () -> platform.export("save-" + slot.getName(), saveExtension, slot::exportFile)).right(); t.button(Icon.export, Styles.emptyi, () -> platform.export("save-" + slot.getName(), saveExtension, slot::exportFile)).right();
}).padRight(-10).growX(); }).padRight(-10).growX();
}).growX().colspan(2); }).growX().colspan(2);
@@ -142,13 +142,13 @@ public class LoadDialog extends FloatingDialog{
if(!valids){ if(!valids){
slots.row(); slots.row();
slots.addButton("$save.none", () -> { slots.button("$save.none", () -> {
}).disabled(true).fillX().margin(20f).minWidth(340f).height(80f).pad(4f); }).disabled(true).fillX().margin(20f).minWidth(340f).height(80f).pad(4f);
} }
slots.row(); slots.row();
slots.addImageTextButton("$save.import", Icon.add, () -> { slots.button("$save.import", Icon.add, () -> {
platform.showFileChooser(true, saveExtension, file -> { platform.showFileChooser(true, saveExtension, file -> {
if(SaveIO.isSaveValid(file)){ if(SaveIO.isSaveValid(file)){
try{ try{
@@ -26,7 +26,7 @@ public class LoadoutDialog extends FloatingDialog{
setFillParent(true); setFillParent(true);
keyDown(key -> { keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){ if(key == KeyCode.escape || key == KeyCode.back){
Core.app.post(this::hide); Core.app.post(this::hide);
} }
}); });
@@ -42,9 +42,9 @@ public class LoadoutDialog extends FloatingDialog{
} }
}); });
buttons.addImageTextButton("$back", Icon.left, this::hide).size(210f, 64f); buttons.button("$back", Icon.left, this::hide).size(210f, 64f);
buttons.addImageTextButton("$settings.reset", Icon.refresh, () -> { buttons.button("$settings.reset", Icon.refresh, () -> {
resetter.run(); resetter.run();
reseed(); reseed();
updater.run(); updater.run();
@@ -73,17 +73,17 @@ public class LoadoutDialog extends FloatingDialog{
for(ItemStack stack : stacks){ for(ItemStack stack : stacks){
items.table(Tex.pane, t -> { items.table(Tex.pane, t -> {
t.margin(4).marginRight(8).left(); t.margin(4).marginRight(8).left();
t.addButton("-", Styles.cleart, () -> { t.button("-", Styles.cleart, () -> {
stack.amount = Math.max(stack.amount - step(stack.amount), 0); stack.amount = Math.max(stack.amount - step(stack.amount), 0);
updater.run(); updater.run();
}).size(bsize); }).size(bsize);
t.addButton("+", Styles.cleart, () -> { t.button("+", Styles.cleart, () -> {
stack.amount = Math.min(stack.amount + step(stack.amount), capacity); stack.amount = Math.min(stack.amount + step(stack.amount), capacity);
updater.run(); updater.run();
}).size(bsize); }).size(bsize);
t.addImageButton(Icon.pencil, Styles.cleari, () -> ui.showTextInput("$configure", stack.item.localizedName, 10, stack.amount + "", true, str -> { t.button(Icon.pencil, Styles.cleari, () -> ui.showTextInput("$configure", stack.item.localizedName, 10, stack.amount + "", true, str -> {
if(Strings.canParsePostiveInt(str)){ if(Strings.canParsePostiveInt(str)){
int amount = Strings.parseInt(str); int amount = Strings.parseInt(str);
if(amount >= 0 && amount <= capacity){ if(amount >= 0 && amount <= capacity){
@@ -95,7 +95,7 @@ public class LoadoutDialog extends FloatingDialog{
ui.showInfo(Core.bundle.format("configure.invalid", capacity)); ui.showInfo(Core.bundle.format("configure.invalid", capacity));
})).size(bsize); })).size(bsize);
t.addImage(stack.item.icon(Cicon.small)).size(8 * 3).padRight(4).padLeft(4); t.image(stack.item.icon(Cicon.small)).size(8 * 3).padRight(4).padLeft(4);
t.label(() -> stack.amount + "").left().width(90f); t.label(() -> stack.amount + "").left().width(90f);
}).pad(2).left().fillX(); }).pad(2).left().fillX();
@@ -56,18 +56,18 @@ public class MapPlayDialog extends FloatingDialog{
for(Gamemode mode : Gamemode.values()){ for(Gamemode mode : Gamemode.values()){
if(mode.hidden) continue; if(mode.hidden) continue;
modes.addButton(mode.toString(), Styles.togglet, () -> { modes.button(mode.toString(), Styles.togglet, () -> {
selectedGamemode = mode; selectedGamemode = mode;
rules = map.applyRules(mode); rules = map.applyRules(mode);
}).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f).disabled(!mode.valid(map)); }).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f).disabled(!mode.valid(map));
if(i++ % 2 == 1) modes.row(); if(i++ % 2 == 1) modes.row();
} }
selmode.add(modes); selmode.add(modes);
selmode.addButton("?", this::displayGameModeHelp).width(50f).fillY().padLeft(18f); selmode.button("?", this::displayGameModeHelp).width(50f).fillY().padLeft(18f);
cont.add(selmode); cont.add(selmode);
cont.row(); cont.row();
cont.addImageTextButton("$customize", Icon.settings, () -> dialog.show(rules, () -> rules = map.applyRules(selectedGamemode))).width(230); cont.button("$customize", Icon.settings, () -> dialog.show(rules, () -> rules = map.applyRules(selectedGamemode))).width(230);
cont.row(); cont.row();
cont.add(new BorderImage(map.safeTexture(), 3f)).size(mobile && !Core.graphics.isPortrait() ? 150f : 250f).get().setScaling(Scaling.fit); cont.add(new BorderImage(map.safeTexture(), 3f)).size(mobile && !Core.graphics.isPortrait() ? 150f : 250f).get().setScaling(Scaling.fit);
//only maps with survival are valid for high scores //only maps with survival are valid for high scores
@@ -79,7 +79,7 @@ public class MapPlayDialog extends FloatingDialog{
buttons.clearChildren(); buttons.clearChildren();
addCloseButton(); addCloseButton();
buttons.addImageTextButton("$play", Icon.play, () -> { buttons.button("$play", Icon.play, () -> {
control.playMap(map, rules); control.playMap(map, rules);
hide(); hide();
ui.custom.hide(); ui.custom.hide();
@@ -103,7 +103,7 @@ public class MapPlayDialog extends FloatingDialog{
} }
d.cont.add(pane); d.cont.add(pane);
d.buttons.addButton("$ok", d::hide).size(110, 50).pad(10f); d.buttons.button("$ok", d::hide).size(110, 50).pad(10f);
d.show(); d.show();
} }
} }
@@ -26,7 +26,7 @@ public class MapsDialog extends FloatingDialog{
buttons.remove(); buttons.remove();
keyDown(key -> { keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){ if(key == KeyCode.escape || key == KeyCode.back){
Core.app.post(this::hide); Core.app.post(this::hide);
} }
}); });
@@ -44,13 +44,13 @@ public class MapsDialog extends FloatingDialog{
buttons.clearChildren(); buttons.clearChildren();
if(Core.graphics.isPortrait()){ if(Core.graphics.isPortrait()){
buttons.addImageTextButton("$back", Icon.left, this::hide).size(210f*2f, 64f).colspan(2); buttons.button("$back", Icon.left, this::hide).size(210f*2f, 64f).colspan(2);
buttons.row(); buttons.row();
}else{ }else{
buttons.addImageTextButton("$back", Icon.left, this::hide).size(210f, 64f); buttons.button("$back", Icon.left, this::hide).size(210f, 64f);
} }
buttons.addImageTextButton("$editor.newmap", Icon.add, () -> { buttons.button("$editor.newmap", Icon.add, () -> {
ui.showTextInput("$editor.newmap", "$editor.mapname", "", text -> { ui.showTextInput("$editor.newmap", "$editor.mapname", "", text -> {
Runnable show = () -> ui.loadAnd(() -> { Runnable show = () -> ui.loadAnd(() -> {
hide(); hide();
@@ -67,7 +67,7 @@ public class MapsDialog extends FloatingDialog{
}); });
}).size(210f, 64f); }).size(210f, 64f);
buttons.addImageTextButton("$editor.importmap", Icon.upload, () -> { buttons.button("$editor.importmap", Icon.upload, () -> {
platform.showFileChooser(true, mapExtension, file -> { platform.showFileChooser(true, mapExtension, file -> {
ui.loadAnd(() -> { ui.loadAnd(() -> {
maps.tryCatchMapError(() -> { maps.tryCatchMapError(() -> {
@@ -134,12 +134,12 @@ public class MapsDialog extends FloatingDialog{
maps.row(); maps.row();
} }
TextButton button = maps.addButton("", Styles.cleart, () -> showMapInfo(map)).width(mapsize).pad(8).get(); TextButton button = maps.button("", Styles.cleart, () -> showMapInfo(map)).width(mapsize).pad(8).get();
button.clearChildren(); button.clearChildren();
button.margin(9); button.margin(9);
button.add(map.name()).width(mapsize - 18f).center().get().setEllipsis(true); button.add(map.name()).width(mapsize - 18f).center().get().setEllipsis(true);
button.row(); button.row();
button.addImage().growX().pad(4).color(Pal.gray); button.image().growX().pad(4).color(Pal.gray);
button.row(); button.row();
button.stack(new Image(map.safeTexture()).setScaling(Scaling.fit), new BorderImage(map.safeTexture()).setScaling(Scaling.fit)).size(mapsize - 20f); button.stack(new Image(map.safeTexture()).setScaling(Scaling.fit), new BorderImage(map.safeTexture()).setScaling(Scaling.fit)).size(mapsize - 20f);
button.row(); button.row();
@@ -192,7 +192,7 @@ public class MapsDialog extends FloatingDialog{
table.row(); table.row();
table.addImageTextButton("$editor.openin", Icon.export, () -> { table.button("$editor.openin", Icon.export, () -> {
try{ try{
Vars.ui.editor.beginEditMap(map.file); Vars.ui.editor.beginEditMap(map.file);
dialog.hide(); dialog.hide();
@@ -203,7 +203,7 @@ public class MapsDialog extends FloatingDialog{
} }
}).fillX().height(54f).marginLeft(10); }).fillX().height(54f).marginLeft(10);
table.addImageTextButton(map.workshop && steam ? "$view.workshop" : "$delete", map.workshop && steam ? Icon.link : Icon.trash, () -> { table.button(map.workshop && steam ? "$view.workshop" : "$delete", map.workshop && steam ? Icon.link : Icon.trash, () -> {
if(map.workshop && steam){ if(map.workshop && steam){
platform.viewListing(map); platform.viewListing(map);
}else{ }else{
@@ -28,7 +28,7 @@ public class MinimapDialog extends FloatingDialog{
cont.clear(); cont.clear();
cont.table(Tex.pane,t -> { cont.table(Tex.pane,t -> {
t.addRect((x, y, width, height) -> { t.rect((x, y, width, height) -> {
if(renderer.minimap.getRegion() == null) return; if(renderer.minimap.getRegion() == null) return;
Draw.color(Color.white); Draw.color(Color.white);
Draw.alpha(parentAlpha); Draw.alpha(parentAlpha);
+14 -14
View File
@@ -23,7 +23,7 @@ public class ModsDialog extends FloatingDialog{
super("$mods"); super("$mods");
addCloseButton(); addCloseButton();
buttons.addImageTextButton("$mods.guide", Icon.link, () -> Core.net.openURI(modGuideURL)).size(210, 64f); buttons.button("$mods.guide", Icon.link, () -> Core.net.openURI(modGuideURL)).size(210, 64f);
shown(this::setup); shown(this::setup);
@@ -66,7 +66,7 @@ public class ModsDialog extends FloatingDialog{
TextButtonStyle style = Styles.clearPartialt; TextButtonStyle style = Styles.clearPartialt;
float margin = 12f; float margin = 12f;
buttons.addImageTextButton("$mod.import", Icon.add, style, () -> { buttons.button("$mod.import", Icon.add, style, () -> {
FloatingDialog dialog = new FloatingDialog("$mod.import"); FloatingDialog dialog = new FloatingDialog("$mod.import");
TextButtonStyle bstyle = Styles.cleart; TextButtonStyle bstyle = Styles.cleart;
@@ -75,7 +75,7 @@ public class ModsDialog extends FloatingDialog{
t.defaults().size(300f, 70f); t.defaults().size(300f, 70f);
t.margin(12f); t.margin(12f);
t.addImageTextButton("$mod.import.file", Icon.file, bstyle, () -> { t.button("$mod.import.file", Icon.file, bstyle, () -> {
dialog.hide(); dialog.hide();
platform.showFileChooser(true, "zip", file -> { platform.showFileChooser(true, "zip", file -> {
@@ -91,7 +91,7 @@ public class ModsDialog extends FloatingDialog{
t.row(); t.row();
t.addImageTextButton("$mod.import.github", Icon.github, bstyle, () -> { t.button("$mod.import.github", Icon.github, bstyle, () -> {
dialog.hide(); dialog.hide();
ui.showTextInput("$mod.import.github", "", 64, "Anuken/ExampleMod", text -> { ui.showTextInput("$mod.import.github", "", 64, "Anuken/ExampleMod", text -> {
@@ -131,10 +131,10 @@ public class ModsDialog extends FloatingDialog{
dialog.show(); dialog.show();
}).margin(margin); }).margin(margin);
buttons.addImageTextButton("$mods.reload", Icon.refresh, style, this::reload).margin(margin); buttons.button("$mods.reload", Icon.refresh, style, this::reload).margin(margin);
if(!mobile){ if(!mobile){
buttons.addImageTextButton("$mods.openfolder", Icon.link, style, () -> Core.app.openFolder(modDirectory.absolutePath())).margin(margin); buttons.button("$mods.openfolder", Icon.link, style, () -> Core.app.openFolder(modDirectory.absolutePath())).margin(margin);
} }
}).width(w); }).width(w);
@@ -151,11 +151,11 @@ public class ModsDialog extends FloatingDialog{
if(!mod.enabled() && !anyDisabled && mods.list().size > 0){ if(!mod.enabled() && !anyDisabled && mods.list().size > 0){
anyDisabled = true; anyDisabled = true;
table.row(); table.row();
table.addImage().growX().height(4f).pad(6f).color(Pal.gray); table.image().growX().height(4f).pad(6f).color(Pal.gray);
table.row(); table.row();
} }
table.addButton(t -> { table.button(t -> {
t.top().left(); t.top().left();
t.margin(12f); t.margin(12f);
@@ -176,26 +176,26 @@ public class ModsDialog extends FloatingDialog{
Fonts.def.draw(letter, x + width/2f, y + height/2f, Align.center); Fonts.def.draw(letter, x + width/2f, y + height/2f, Align.center);
} }
} }
}.border(Pal.accent)).size(h - 8f).padTop(-8f).padLeft(-8f).padRight(6f); }.border(Pal.accent)).size(h - 8f).padTop(-8f).padLeft(-8f).padRight(2f);
t.defaults().left().top(); t.defaults().left().top();
t.table(title -> { t.table(title -> {
title.left(); title.left();
title.add("" + mod.meta.displayName() + "\n[lightgray]v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + "")).growX(); title.add("" + mod.meta.displayName() + "\n[lightgray]v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + "")).wrap().width(170f).growX();
title.add().growX(); title.add().growX();
title.addImageTextButton(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.transt, () -> { title.button(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.transt, () -> {
mods.setEnabled(mod, !mod.enabled()); mods.setEnabled(mod, !mod.enabled());
setup(); setup();
}).height(50f).margin(8f).width(130f).disabled(!mod.isSupported()); }).height(50f).margin(8f).width(130f).disabled(!mod.isSupported());
if(steam && !mod.hasSteamID()){ if(steam && !mod.hasSteamID()){
title.addImageButton(Icon.download, Styles.clearTransi, () -> { title.button(Icon.download, Styles.clearTransi, () -> {
platform.publish(mod); platform.publish(mod);
}).size(50f); }).size(50f);
} }
title.addImageButton(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> { title.button(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> {
if(!mod.hasSteamID()){ if(!mod.hasSteamID()){
ui.showConfirm("$confirm", "$mod.remove.confirm", () -> { ui.showConfirm("$confirm", "$mod.remove.confirm", () -> {
mods.removeMod(mod); mods.removeMod(mod);
@@ -250,7 +250,7 @@ public class ModsDialog extends FloatingDialog{
dialog.addCloseButton(); dialog.addCloseButton();
if(!mobile){ if(!mobile){
dialog.buttons.addImageTextButton("$mods.openfolder", Icon.link, () -> Core.app.openFolder(mod.file.absolutePath())); dialog.buttons.button("$mods.openfolder", Icon.link, () -> Core.app.openFolder(mod.file.absolutePath()));
} }
//TODO improve this menu later //TODO improve this menu later
@@ -25,7 +25,7 @@ public class PaletteDialog extends Dialog{
for(int i = 0; i < playerColors.length; i++){ for(int i = 0; i < playerColors.length; i++){
Color color = playerColors[i]; Color color = playerColors[i];
ImageButton button = table.addImageButton(Tex.whiteui, Styles.clearTogglei, 34, () -> { ImageButton button = table.button(Tex.whiteui, Styles.clearTogglei, 34, () -> {
cons.get(color); cons.get(color);
hide(); hide();
}).size(48).get(); }).size(48).get();
@@ -38,7 +38,7 @@ public class PaletteDialog extends Dialog{
} }
keyDown(key -> { keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK) if(key == KeyCode.escape || key == KeyCode.back)
hide(); hide();
}); });
+15 -15
View File
@@ -18,7 +18,7 @@ public class PausedDialog extends FloatingDialog{
shown(this::rebuild); shown(this::rebuild);
keyDown(key -> { keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){ if(key == KeyCode.escape || key == KeyCode.back){
hide(); hide();
} }
}); });
@@ -37,26 +37,26 @@ public class PausedDialog extends FloatingDialog{
float dw = 220f; float dw = 220f;
cont.defaults().width(dw).height(55).pad(5f); cont.defaults().width(dw).height(55).pad(5f);
cont.addImageTextButton("$back", Icon.left, this::hide).colspan(2).width(dw * 2 + 20f); cont.button("$back", Icon.left, this::hide).colspan(2).width(dw * 2 + 20f);
cont.row(); cont.row();
if(state.isCampaign()){ if(state.isCampaign()){
cont.addImageTextButton("$techtree", Icon.tree, ui.tech::show); cont.button("$techtree", Icon.tree, ui.tech::show);
}else{ }else{
cont.addImageTextButton("$database", Icon.book, ui.database::show); cont.button("$database", Icon.book, ui.database::show);
} }
cont.addImageTextButton("$settings", Icon.settings, ui.settings::show); cont.button("$settings", Icon.settings, ui.settings::show);
if(!state.rules.tutorial){ if(!state.rules.tutorial){
if(!state.isCampaign() && !state.isEditor()){ if(!state.isCampaign() && !state.isEditor()){
cont.row(); cont.row();
cont.addImageTextButton("$savegame", Icon.save, save::show); cont.button("$savegame", Icon.save, save::show);
cont.addImageTextButton("$loadgame", Icon.upload, load::show).disabled(b -> net.active()); cont.button("$loadgame", Icon.upload, load::show).disabled(b -> net.active());
} }
cont.row(); cont.row();
cont.addImageTextButton("$hostserver", Icon.host, () -> { cont.button("$hostserver", Icon.host, () -> {
if(net.server() && steam){ if(net.server() && steam){
platform.inviteFriends(); platform.inviteFriends();
}else{ }else{
@@ -71,26 +71,26 @@ public class PausedDialog extends FloatingDialog{
cont.row(); cont.row();
cont.addImageTextButton("$quit", Icon.exit, this::showQuitConfirm).colspan(2).width(dw + 20f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit")); cont.button("$quit", Icon.exit, this::showQuitConfirm).colspan(2).width(dw + 20f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit"));
}else{ }else{
cont.defaults().size(130f).pad(5); cont.defaults().size(130f).pad(5);
cont.addRowImageTextButton("$back", Icon.play, this::hide); cont.buttonRow("$back", Icon.play, this::hide);
cont.addRowImageTextButton("$settings", Icon.settings, ui.settings::show); cont.buttonRow("$settings", Icon.settings, ui.settings::show);
if(!state.isCampaign() && !state.isEditor()){ if(!state.isCampaign() && !state.isEditor()){
cont.addRowImageTextButton("$save", Icon.save, save::show); cont.buttonRow("$save", Icon.save, save::show);
cont.row(); cont.row();
cont.addRowImageTextButton("$load", Icon.download, load::show).disabled(b -> net.active()); cont.buttonRow("$load", Icon.download, load::show).disabled(b -> net.active());
}else{ }else{
cont.row(); cont.row();
} }
cont.addRowImageTextButton("$hostserver.mobile", Icon.host, ui.host::show).disabled(b -> net.active()); cont.buttonRow("$hostserver.mobile", Icon.host, ui.host::show).disabled(b -> net.active());
cont.addRowImageTextButton("$quit", Icon.exit, this::showQuitConfirm).update(s -> { cont.buttonRow("$quit", Icon.exit, this::showQuitConfirm).update(s -> {
s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit"); s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit");
s.getLabelCell().growX().wrap(); s.getLabelCell().growX().wrap();
}); });
@@ -92,7 +92,7 @@ public class PlanetDialog extends FloatingDialog{
float bmargin = 6f; float bmargin = 6f;
//TODO names //TODO names
buttons.addImageTextButton("$back", Icon.left, style, this::hide).margin(bmargin); buttons.button("$back", Icon.left, style, this::hide).margin(bmargin);
//buttons.addImageTextButton("Tech", Icon.tree, style, () -> ui.tech.show()).margin(bmargin); //buttons.addImageTextButton("Tech", Icon.tree, style, () -> ui.tech.show()).margin(bmargin);
//buttons.addImageTextButton("Launch", Icon.upOpen, style, this::hide).margin(bmargin); //buttons.addImageTextButton("Launch", Icon.upOpen, style, this::hide).margin(bmargin);
//buttons.addImageTextButton("Database", Icon.book, style, () -> ui.database.show()).margin(bmargin); //buttons.addImageTextButton("Database", Icon.book, style, () -> ui.database.show()).margin(bmargin);
@@ -163,7 +163,7 @@ public class PlanetDialog extends FloatingDialog{
cont.clear(); cont.clear();
titleTable.remove(); titleTable.remove();
cont.addRect((x, y, w, h) -> render()).grow(); cont.rect((x, y, w, h) -> render()).grow();
} }
private void render(){ private void render(){
@@ -341,7 +341,7 @@ public class PlanetDialog extends FloatingDialog{
//TODO add strings to bundle after prototyping is done //TODO add strings to bundle after prototyping is done
stable.add("[accent]" + selected.id).row(); stable.add("[accent]" + selected.id).row();
stable.addImage().color(Pal.accent).fillX().height(3f).pad(3f).row(); stable.image().color(Pal.accent).fillX().height(3f).pad(3f).row();
stable.add(selected.save != null ? selected.save.getPlayTime() : "[lightgray]Unexplored").row(); stable.add(selected.save != null ? selected.save.getPlayTime() : "[lightgray]Unexplored").row();
stable.add("Resources:").row(); stable.add("Resources:").row();
@@ -350,14 +350,14 @@ public class PlanetDialog extends FloatingDialog{
int idx = 0; int idx = 0;
int max = 5; int max = 5;
for(UnlockableContent c : selected.data.resources){ for(UnlockableContent c : selected.data.resources){
t.addImage(c.icon(Cicon.small)).padRight(3); t.image(c.icon(Cicon.small)).padRight(3);
if(++idx % max == 0) t.row(); if(++idx % max == 0) t.row();
} }
}).fillX().row(); }).fillX().row();
stable.row(); stable.row();
stable.addButton("Launch", Styles.transt, () -> { stable.button("Launch", Styles.transt, () -> {
if(selected != null){ if(selected != null){
if(selected.is(SectorAttribute.naval)){ if(selected.is(SectorAttribute.naval)){
ui.showInfo("You need a naval loadout to launch here."); ui.showInfo("You need a naval loadout to launch here.");
@@ -3,7 +3,6 @@ package mindustry.ui.dialogs;
import arc.Core; import arc.Core;
import arc.scene.ui.TextButton; import arc.scene.ui.TextButton;
import arc.util.Time; import arc.util.Time;
import mindustry.core.GameState.State;
import mindustry.game.Saves.SaveSlot; import mindustry.game.Saves.SaveSlot;
import mindustry.gen.*; import mindustry.gen.*;
@@ -23,7 +22,7 @@ public class SaveDialog extends LoadDialog{
public void addSetup(){ public void addSetup(){
slots.row(); slots.row();
slots.addImageTextButton("$save.new", Icon.add, () -> slots.button("$save.new", Icon.add, () ->
ui.showTextInput("$save", "$save.newslot", 30, "", text -> { ui.showTextInput("$save", "$save.newslot", 30, "", text -> {
ui.loadAnd("$saving", () -> { ui.loadAnd("$saving", () -> {
control.saves.addSave(text); control.saves.addSave(text);
@@ -31,7 +31,7 @@ public class SchematicsDialog extends FloatingDialog{
shouldPause = true; shouldPause = true;
addCloseButton(); addCloseButton();
buttons.addImageTextButton("$schematic.import", Icon.download, this::showImport); buttons.button("$schematic.import", Icon.download, this::showImport);
shown(this::setup); shown(this::setup);
onResize(this::setup); onResize(this::setup);
} }
@@ -45,8 +45,8 @@ public class SchematicsDialog extends FloatingDialog{
cont.table(s -> { cont.table(s -> {
s.left(); s.left();
s.addImage(Icon.zoom); s.image(Icon.zoom);
s.addField(search, res -> { s.field(search, res -> {
search = res; search = res;
rebuildPane[0].run(); rebuildPane[0].run();
}).growX(); }).growX();
@@ -69,7 +69,7 @@ public class SchematicsDialog extends FloatingDialog{
if(!search.isEmpty() && !s.name().toLowerCase().contains(search.toLowerCase())) continue; if(!search.isEmpty() && !s.name().toLowerCase().contains(search.toLowerCase())) continue;
Button[] sel = {null}; Button[] sel = {null};
sel[0] = t.addButton(b -> { sel[0] = t.button(b -> {
b.top(); b.top();
b.margin(0f); b.margin(0f);
b.table(buttons -> { b.table(buttons -> {
@@ -78,15 +78,15 @@ public class SchematicsDialog extends FloatingDialog{
ImageButtonStyle style = Styles.clearPartiali; ImageButtonStyle style = Styles.clearPartiali;
buttons.addImageButton(Icon.info, style, () -> { buttons.button(Icon.info, style, () -> {
showInfo(s); showInfo(s);
}); });
buttons.addImageButton(Icon.download, style, () -> { buttons.button(Icon.download, style, () -> {
showExport(s); showExport(s);
}); });
buttons.addImageButton(Icon.pencil, style, () -> { buttons.button(Icon.pencil, style, () -> {
ui.showTextInput("$schematic.rename", "$name", s.name(), res -> { ui.showTextInput("$schematic.rename", "$name", s.name(), res -> {
Schematic replacement = schematics.all().find(other -> other.name().equals(res) && other != s); Schematic replacement = schematics.all().find(other -> other.name().equals(res) && other != s);
if(replacement != null){ if(replacement != null){
@@ -102,9 +102,9 @@ public class SchematicsDialog extends FloatingDialog{
}); });
if(s.hasSteamID()){ if(s.hasSteamID()){
buttons.addImageButton(Icon.link, style, () -> platform.viewListing(s)); buttons.button(Icon.link, style, () -> platform.viewListing(s));
}else{ }else{
buttons.addImageButton(Icon.trash, style, () -> { buttons.button(Icon.trash, style, () -> {
if(s.mod != null){ if(s.mod != null){
ui.showInfo(Core.bundle.format("mod.item.remove", s.mod.meta.displayName())); ui.showInfo(Core.bundle.format("mod.item.remove", s.mod.meta.displayName()));
}else{ }else{
@@ -160,7 +160,7 @@ public class SchematicsDialog extends FloatingDialog{
TextButtonStyle style = Styles.cleart; TextButtonStyle style = Styles.cleart;
t.defaults().size(280f, 60f).left(); t.defaults().size(280f, 60f).left();
t.row(); t.row();
t.addImageTextButton("$schematic.copy.import", Icon.copy, style, () -> { t.button("$schematic.copy.import", Icon.copy, style, () -> {
dialog.hide(); dialog.hide();
try{ try{
Schematic s = Schematics.readBase64(Core.app.getClipboardText()); Schematic s = Schematics.readBase64(Core.app.getClipboardText());
@@ -174,7 +174,7 @@ public class SchematicsDialog extends FloatingDialog{
} }
}).marginLeft(12f).disabled(b -> Core.app.getClipboardText() == null || !Core.app.getClipboardText().startsWith(schematicBaseStart)); }).marginLeft(12f).disabled(b -> Core.app.getClipboardText() == null || !Core.app.getClipboardText().startsWith(schematicBaseStart));
t.row(); t.row();
t.addImageTextButton("$schematic.importfile", Icon.download, style, () -> platform.showFileChooser(true, schematicExtension, file -> { t.button("$schematic.importfile", Icon.download, style, () -> platform.showFileChooser(true, schematicExtension, file -> {
dialog.hide(); dialog.hide();
try{ try{
@@ -189,7 +189,7 @@ public class SchematicsDialog extends FloatingDialog{
})).marginLeft(12f); })).marginLeft(12f);
t.row(); t.row();
if(steam){ if(steam){
t.addImageTextButton("$schematic.browseworkshop", Icon.book, style, () -> { t.button("$schematic.browseworkshop", Icon.book, style, () -> {
dialog.hide(); dialog.hide();
platform.openWorkshop(); platform.openWorkshop();
}).marginLeft(12f); }).marginLeft(12f);
@@ -209,18 +209,18 @@ public class SchematicsDialog extends FloatingDialog{
TextButtonStyle style = Styles.cleart; TextButtonStyle style = Styles.cleart;
t.defaults().size(280f, 60f).left(); t.defaults().size(280f, 60f).left();
if(steam && !s.hasSteamID()){ if(steam && !s.hasSteamID()){
t.addImageTextButton("$schematic.shareworkshop", Icon.book, style, t.button("$schematic.shareworkshop", Icon.book, style,
() -> platform.publish(s)).marginLeft(12f); () -> platform.publish(s)).marginLeft(12f);
t.row(); t.row();
dialog.hide(); dialog.hide();
} }
t.addImageTextButton("$schematic.copy", Icon.copy, style, () -> { t.button("$schematic.copy", Icon.copy, style, () -> {
dialog.hide(); dialog.hide();
ui.showInfoFade("$copied"); ui.showInfoFade("$copied");
Core.app.setClipboardText(schematics.writeBase64(s)); Core.app.setClipboardText(schematics.writeBase64(s));
}).marginLeft(12f); }).marginLeft(12f);
t.row(); t.row();
t.addImageTextButton("$schematic.exportfile", Icon.export, style, () -> { t.button("$schematic.exportfile", Icon.export, style, () -> {
dialog.hide(); dialog.hide();
platform.export(s.name(), schematicExtension, file -> Schematics.write(s, file)); platform.export(s.name(), schematicExtension, file -> Schematics.write(s, file));
}).marginLeft(12f); }).marginLeft(12f);
@@ -312,7 +312,7 @@ public class SchematicsDialog extends FloatingDialog{
cont.table(r -> { cont.table(r -> {
int i = 0; int i = 0;
for(ItemStack s : arr){ for(ItemStack s : arr){
r.addImage(s.item.icon(Cicon.small)).left(); r.image(s.item.icon(Cicon.small)).left();
r.label(() -> { r.label(() -> {
Tilec core = player.closestCore(); Tilec core = player.closestCore();
if(core == null || state.rules.infiniteResources || core.items().has(s.item, s.amount)) return "[lightgray]" + s.amount + ""; if(core == null || state.rules.infiniteResources || core.items().has(s.item, s.amount)) return "[lightgray]" + s.amount + "";

Some files were not shown because too many files have changed in this diff Show More