More character support, made menus collapsible

This commit is contained in:
Anuken 2017-12-27 23:05:10 -05:00
parent c693674ac6
commit b25c611c33
35 changed files with 569 additions and 343 deletions

View File

@ -38,6 +38,9 @@ _(not necessarily planned!)_
- Solar panels
- Deflector shields
- Autosave
- Underground blocks
- Configurable outputs/inputs
- Getting items out of the core
### Balance
- Slow down progression slightly

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 198 B

View File

@ -33,9 +33,8 @@ text.loading=[accent]Loading...
text.wave=[orange]Wave {0}
text.wave.waiting=Wave in {0}
text.waiting=Waiting...
text.countdown=Wave in {0}
text.enemies={0} Enemies left
text.enemies.single={0} Enemy left
text.enemies={0} Enemies
text.enemies.single={0} Enemy
text.loadimage=Load Image
text.saveimage=Save Image
text.editor.badsize=[orange]Invalid image dimensions![]\nValid map dimensions: {0}
@ -375,7 +374,7 @@ block.stoneformer.name=stone former
block.stoneformer.fulldescription=Soldifies liquid lava into stone. Useful for producing massive amounts of stone for coal purifiers.
block.stoneformer.description=Converts lava to stone.
block.lavasmelter.name=lava smelter
block.lavasmelter.fulldescription=Uses lava to convert iron to steel. An alternative to smelteries. Useful in situations where coal is scarace.
block.lavasmelter.fulldescription=Uses lava to convert iron to steel. An alternative to smelteries. Useful in situations where coal is scarce.
block.lavasmelter.description=Converts iron + lava to steel.
block.stonedrill.name=stone drill
block.stonedrill.fulldescription=The essential drill. When placed on stone tiles, outputs stone at a slow pace indefinitely.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -1,97 +0,0 @@
info face="5squared pixel Regular" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=44 base=36 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="prose.png"
chars count=92
char id=10 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=0 page=0 chnl=0
char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=35 xadvance=8 page=0 chnl=0
char id=33 x=504 y=0 width=6 height=22 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0
char id=34 x=110 y=52 width=14 height=10 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=35 x=22 y=52 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=36 x=6 y=0 width=22 height=30 xoffset=-1 yoffset=11 xadvance=24 page=0 chnl=0
char id=37 x=468 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=38 x=44 y=52 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=39 x=502 y=30 width=6 height=10 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0
char id=40 x=322 y=30 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0
char id=41 x=332 y=30 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0
char id=42 x=66 y=52 width=22 height=22 xoffset=-1 yoffset=11 xadvance=24 page=0 chnl=0
char id=43 x=0 y=52 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=44 x=502 y=30 width=6 height=10 xoffset=-1 yoffset=31 xadvance=8 page=0 chnl=0
char id=45 x=130 y=52 width=22 height=6 xoffset=-1 yoffset=23 xadvance=24 page=0 chnl=0
char id=46 x=124 y=52 width=6 height=6 xoffset=-1 yoffset=31 xadvance=8 page=0 chnl=0
char id=47 x=418 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=48 x=278 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=49 x=88 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=50 x=102 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=51 x=124 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=52 x=146 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=53 x=168 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=54 x=190 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=55 x=212 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=56 x=234 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=57 x=256 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=58 x=496 y=30 width=6 height=14 xoffset=-1 yoffset=23 xadvance=8 page=0 chnl=0
char id=59 x=490 y=30 width=6 height=18 xoffset=-1 yoffset=23 xadvance=8 page=0 chnl=0
char id=60 x=390 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=61 x=88 y=52 width=22 height=14 xoffset=-1 yoffset=19 xadvance=24 page=0 chnl=0
char id=62 x=404 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=63 x=300 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=64 x=432 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=65 x=50 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=66 x=72 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=67 x=94 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=68 x=116 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=69 x=138 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=70 x=160 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=71 x=182 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=72 x=204 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=73 x=226 y=0 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=74 x=240 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=75 x=262 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=76 x=284 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=77 x=306 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=78 x=328 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=79 x=350 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=80 x=372 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=81 x=28 y=0 width=22 height=26 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=82 x=394 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=83 x=416 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=84 x=438 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=85 x=460 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=86 x=482 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=87 x=0 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=88 x=22 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=89 x=44 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=90 x=66 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=91 x=342 y=30 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0
char id=92 x=454 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=93 x=352 y=30 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0
char id=97 x=50 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=98 x=72 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=99 x=94 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=100 x=116 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=101 x=138 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=102 x=160 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=103 x=182 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=104 x=204 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=105 x=226 y=0 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=106 x=240 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=107 x=262 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=108 x=284 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=109 x=306 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=110 x=328 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=111 x=350 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=112 x=372 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=113 x=28 y=0 width=22 height=26 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=114 x=394 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=115 x=416 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=116 x=438 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=117 x=460 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=118 x=482 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=119 x=0 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=120 x=22 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=121 x=44 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=122 x=66 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=123 x=362 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=124 x=0 y=0 width=6 height=30 xoffset=-1 yoffset=11 xadvance=8 page=0 chnl=0
char id=125 x=376 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
kernings count=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

235
core/assets/ui/square.fnt Normal file
View File

@ -0,0 +1,235 @@
info face="5squared pixel Regular" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=44 base=36 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="square.png"
chars count=230
char id=0 x=238 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=35 xadvance=8 page=0 chnl=0
char id=33 x=498 y=38 width=6 height=22 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0
char id=34 x=136 y=146 width=14 height=10 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=35 x=260 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=36 x=352 y=38 width=22 height=30 xoffset=-1 yoffset=11 xadvance=24 page=0 chnl=0
char id=37 x=282 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=38 x=304 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=39 x=150 y=146 width=6 height=10 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0
char id=40 x=326 y=72 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0
char id=41 x=336 y=72 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0
char id=42 x=346 y=72 width=22 height=22 xoffset=-1 yoffset=11 xadvance=24 page=0 chnl=0
char id=43 x=368 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=44 x=150 y=146 width=6 height=10 xoffset=-1 yoffset=31 xadvance=8 page=0 chnl=0
char id=45 x=156 y=146 width=22 height=6 xoffset=-1 yoffset=23 xadvance=24 page=0 chnl=0
char id=46 x=178 y=146 width=6 height=6 xoffset=-1 yoffset=31 xadvance=8 page=0 chnl=0
char id=47 x=390 y=72 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=48 x=404 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=49 x=426 y=72 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=50 x=440 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=51 x=462 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=52 x=484 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=53 x=0 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=54 x=22 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=55 x=44 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=56 x=66 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=57 x=88 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=58 x=108 y=146 width=6 height=14 xoffset=-1 yoffset=23 xadvance=8 page=0 chnl=0
char id=59 x=504 y=38 width=6 height=18 xoffset=-1 yoffset=23 xadvance=8 page=0 chnl=0
char id=60 x=110 y=102 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=61 x=114 y=146 width=22 height=14 xoffset=-1 yoffset=19 xadvance=24 page=0 chnl=0
char id=62 x=124 y=102 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=63 x=138 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=64 x=160 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=65 x=182 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=66 x=204 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=67 x=226 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=68 x=248 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=69 x=270 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=70 x=292 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=71 x=314 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=72 x=336 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=73 x=358 y=102 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=74 x=372 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=75 x=394 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=76 x=416 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=77 x=438 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=78 x=460 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=79 x=482 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=80 x=0 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=81 x=216 y=72 width=22 height=26 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=82 x=22 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=83 x=44 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=84 x=66 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=85 x=88 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=86 x=110 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=87 x=132 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=88 x=154 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=89 x=176 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=90 x=198 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=91 x=220 y=124 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0
char id=92 x=230 y=124 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=93 x=244 y=124 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0
char id=97 x=182 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=98 x=204 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=99 x=226 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=100 x=248 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=101 x=270 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=102 x=292 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=103 x=314 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=104 x=336 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=105 x=358 y=102 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=106 x=372 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=107 x=394 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=108 x=416 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=109 x=438 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=110 x=460 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=111 x=482 y=102 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=112 x=0 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=113 x=216 y=72 width=22 height=26 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=114 x=22 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=115 x=44 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=116 x=66 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=117 x=88 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=118 x=110 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=119 x=132 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=120 x=154 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=121 x=176 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=122 x=198 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=123 x=254 y=124 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=124 x=504 y=0 width=6 height=30 xoffset=-1 yoffset=11 xadvance=8 page=0 chnl=0
char id=125 x=268 y=124 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=161 x=504 y=102 width=6 height=22 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0
char id=162 x=374 y=38 width=22 height=30 xoffset=-1 yoffset=11 xadvance=24 page=0 chnl=0
char id=163 x=282 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=164 x=304 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=171 x=326 y=124 width=26 height=22 xoffset=-1 yoffset=15 xadvance=28 page=0 chnl=0
char id=177 x=352 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=187 x=374 y=124 width=26 height=22 xoffset=-1 yoffset=15 xadvance=28 page=0 chnl=0
char id=191 x=400 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=192 x=44 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=193 x=66 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=194 x=88 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=195 x=110 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=196 x=396 y=38 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=197 x=0 y=0 width=22 height=38 xoffset=-1 yoffset=-1 xadvance=24 page=0 chnl=0
char id=198 x=422 y=124 width=38 height=22 xoffset=-1 yoffset=15 xadvance=40 page=0 chnl=0
char id=199 x=418 y=38 width=22 height=30 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=200 x=132 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=201 x=154 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=202 x=176 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=203 x=440 y=38 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=204 x=198 y=0 width=14 height=34 xoffset=-1 yoffset=3 xadvance=16 page=0 chnl=0
char id=205 x=212 y=0 width=14 height=34 xoffset=-1 yoffset=3 xadvance=16 page=0 chnl=0
char id=206 x=226 y=0 width=14 height=34 xoffset=-1 yoffset=3 xadvance=16 page=0 chnl=0
char id=207 x=462 y=38 width=14 height=30 xoffset=-1 yoffset=7 xadvance=16 page=0 chnl=0
char id=208 x=460 y=124 width=26 height=22 xoffset=-1 yoffset=15 xadvance=28 page=0 chnl=0
char id=209 x=240 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=210 x=262 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=211 x=284 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=212 x=306 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=213 x=328 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=214 x=476 y=38 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=216 x=404 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=217 x=350 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=218 x=372 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=219 x=394 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=220 x=0 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=221 x=416 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=222 x=486 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=223 x=0 y=146 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=224 x=44 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=225 x=66 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=226 x=88 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=227 x=110 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=228 x=396 y=38 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=229 x=0 y=0 width=22 height=38 xoffset=-1 yoffset=-1 xadvance=24 page=0 chnl=0
char id=230 x=422 y=124 width=38 height=22 xoffset=-1 yoffset=15 xadvance=40 page=0 chnl=0
char id=231 x=418 y=38 width=22 height=30 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=232 x=132 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=233 x=154 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=234 x=176 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=235 x=440 y=38 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=236 x=198 y=0 width=14 height=34 xoffset=-1 yoffset=3 xadvance=16 page=0 chnl=0
char id=237 x=212 y=0 width=14 height=34 xoffset=-1 yoffset=3 xadvance=16 page=0 chnl=0
char id=238 x=226 y=0 width=14 height=34 xoffset=-1 yoffset=3 xadvance=16 page=0 chnl=0
char id=239 x=462 y=38 width=14 height=30 xoffset=-1 yoffset=7 xadvance=16 page=0 chnl=0
char id=240 x=460 y=124 width=26 height=22 xoffset=-1 yoffset=15 xadvance=28 page=0 chnl=0
char id=241 x=240 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=242 x=262 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=243 x=284 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=244 x=306 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=245 x=328 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=246 x=476 y=38 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=248 x=404 y=72 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=249 x=350 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=250 x=372 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=251 x=394 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=252 x=0 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=253 x=416 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=254 x=486 y=124 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=255 x=22 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=258 x=438 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=259 x=438 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=260 x=44 y=72 width=26 height=30 xoffset=-1 yoffset=15 xadvance=28 page=0 chnl=0
char id=261 x=44 y=72 width=26 height=30 xoffset=-1 yoffset=15 xadvance=28 page=0 chnl=0
char id=262 x=460 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=263 x=460 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=266 x=70 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=267 x=70 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=268 x=482 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=269 x=482 y=0 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=270 x=0 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=271 x=0 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=278 x=92 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=279 x=92 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=280 x=114 y=72 width=22 height=30 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=281 x=114 y=72 width=22 height=30 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=282 x=22 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=283 x=22 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=288 x=136 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=289 x=136 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=302 x=158 y=72 width=14 height=30 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=303 x=158 y=72 width=14 height=30 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=321 x=22 y=146 width=26 height=22 xoffset=-1 yoffset=15 xadvance=28 page=0 chnl=0
char id=322 x=22 y=146 width=26 height=22 xoffset=-1 yoffset=15 xadvance=28 page=0 chnl=0
char id=323 x=44 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=324 x=44 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=327 x=66 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=328 x=66 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=336 x=88 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=337 x=88 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=338 x=48 y=146 width=38 height=22 xoffset=-1 yoffset=15 xadvance=40 page=0 chnl=0
char id=339 x=48 y=146 width=38 height=22 xoffset=-1 yoffset=15 xadvance=40 page=0 chnl=0
char id=340 x=110 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=341 x=110 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=344 x=132 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=345 x=132 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=346 x=154 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=347 x=154 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=348 x=176 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=349 x=176 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=352 x=198 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=353 x=198 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=354 x=172 y=72 width=22 height=30 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=355 x=172 y=72 width=22 height=30 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
char id=356 x=220 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=357 x=220 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=366 x=22 y=0 width=22 height=38 xoffset=-1 yoffset=-1 xadvance=24 page=0 chnl=0
char id=367 x=22 y=0 width=22 height=38 xoffset=-1 yoffset=-1 xadvance=24 page=0 chnl=0
char id=368 x=242 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=369 x=242 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=372 x=264 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=373 x=264 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=374 x=286 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=375 x=286 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=376 x=22 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=377 x=308 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=378 x=308 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=379 x=194 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=380 x=194 y=72 width=22 height=30 xoffset=-1 yoffset=7 xadvance=24 page=0 chnl=0
char id=381 x=330 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=382 x=330 y=38 width=22 height=34 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=8216 x=150 y=146 width=6 height=10 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0
char id=8217 x=150 y=146 width=6 height=10 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0
char id=8220 x=136 y=146 width=14 height=10 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=8221 x=136 y=146 width=14 height=10 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=8249 x=110 y=102 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=8250 x=124 y=102 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0
char id=8364 x=86 y=146 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0
kernings count=0

BIN
core/assets/ui/square.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -1,7 +1,7 @@
{
com.badlogic.gdx.graphics.g2d.BitmapFont: {
default-font: {
file: prose.fnt,
file: square.fnt,
markupEnabled: true,
scale: 0.5
}

View File

@ -10,7 +10,6 @@ import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.I18NBundle;
import io.anuke.mindustry.core.*;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.io.BundleUtil;
import io.anuke.mindustry.io.PlatformFunction;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.*;
@ -32,6 +31,7 @@ public class Mindustry extends ModuleCore {
@Override public void openLink(String link){ }
@Override public void addDialog(TextField field){}
};
public static boolean externalBundle = false;
@Override
public void init(){
@ -46,10 +46,18 @@ public class Mindustry extends ModuleCore {
public void loadBundle(){
I18NBundle.setExceptionOnMissingKey(false);
if(externalBundle){
FileHandle handle = Gdx.files.local("bundle");
Locale locale = Locale.ENGLISH;
Core.bundle = I18NBundle.createBundle(handle, locale);
}else{
FileHandle handle = Gdx.files.internal("bundles/bundle");
Locale locale = Locale.getDefault();
Core.bundle = I18NBundle.createBundle(handle, locale);
}
//always initialize blocks in this order, otherwise there are ID errors
Block[] blockClasses = {
@ -67,7 +75,6 @@ public class Mindustry extends ModuleCore {
@Override
public void postInit(){
Vars.control.reset();
BundleUtil.buildBundle(Gdx.files.absolute("/home/anuke/bundle_en_US.properties"));
}
@Override

View File

@ -10,7 +10,7 @@ import io.anuke.mindustry.entities.Player;
import io.anuke.ucore.scene.ui.layout.Unit;
public class Vars{
public static final boolean testAndroid = false;
public static final boolean testAndroid = true;
//shorthand for whether or not this is running on android
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android) || testAndroid;
//shorthand for whether or not this is running on GWT

View File

@ -3,19 +3,12 @@ package io.anuke.mindustry.core;
import static io.anuke.mindustry.Vars.*;
import java.util.Arrays;
import java.util.Locale;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Buttons;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.controllers.Controller;
import com.badlogic.gdx.controllers.ControllerAdapter;
import com.badlogic.gdx.controllers.Controllers;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.I18NBundle;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import io.anuke.mindustry.Mindustry;
@ -30,7 +23,6 @@ import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.input.AndroidInput;
import io.anuke.mindustry.input.DesktopInput;
import io.anuke.mindustry.input.InputHandler;
import io.anuke.mindustry.io.BundleUtil;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.resource.ItemStack;
import io.anuke.mindustry.resource.Weapon;
@ -84,11 +76,6 @@ public class Control extends Module{
if(Mindustry.args.contains("-debug", false))
Vars.debug = true;
FileHandle handle = Gdx.files.internal("bundles/bundle");
Locale locale = Locale.getDefault();
Core.bundle = I18NBundle.createBundle(handle, locale);
Inputs.useControllers(false);
log("Total blocks loaded: " + Block.getAllBlocks().size);
@ -442,7 +429,7 @@ public class Control extends Module{
addItem(Item.stone, 40);
if(debug){
Arrays.fill(items, 2000000);
Arrays.fill(items, 999900);
}
}

View File

@ -367,7 +367,7 @@ public class Renderer extends RendererModule{
//draw placement box
if((player.recipe != null && Vars.control.hasItems(player.recipe.requirements) && (!ui.hasMouse() || android)
&& control.input.drawPlace()) || (player.placeMode.delete && Inputs.keyDown("area_delete_mode"))){
&& control.input.drawPlace())){
player.placeMode.draw(control.input.getBlockX(), control.input.getBlockY(), control.input.getBlockEndX(), control.input.getBlockEndY());

View File

@ -58,8 +58,7 @@ public class UI extends SceneModule{
MapEditor editor;
boolean wasPaused = false;
private Fragment blockfrag = new BlocksFragment(),
menufrag = new MenuFragment(),
private Fragment menufrag = new MenuFragment(),
toolfrag = new ToolFragment(),
hudfrag = new HudFragment(),
placefrag = new PlacementFragment(),
@ -292,8 +291,6 @@ public class UI extends SceneModule{
weaponfrag.build();
blockfrag.build();
hudfrag.build();
menufrag.build();

View File

@ -95,11 +95,11 @@ public class BlockRenderer{
}
if(block.expanded || !expanded){
if(block.layer != null){
if(block.layer != null && block.isLayer(tile)){
addRequest(tile, block.layer);
}
if(block.layer2 != null){
if(block.layer2 != null && block.isLayer2(tile)){
addRequest(tile, block.layer2);
}
}

View File

@ -47,9 +47,9 @@ public class AndroidInput extends InputHandler{
return false;
}
if(placing && pointer == 0 && !player.placeMode.pan && player.recipe != null){
if(placing && pointer == 0 && !player.placeMode.pan && !breaking()){
player.placeMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY());
}else if(pointer == 0 && !player.breakMode.pan && player.recipe == null && drawPlace()){
}else if(pointer == 0 && !player.breakMode.pan && breaking() && drawPlace()){
player.breakMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY());
}
placing = false;
@ -64,7 +64,7 @@ public class AndroidInput extends InputHandler{
lmousex = screenX;
lmousey = screenY;
if((!player.placeMode.pan || player.recipe == null) && pointer == 0){
if((!player.placeMode.pan || breaking()) && pointer == 0){
mousex = screenX;
mousey = screenY;
}
@ -184,4 +184,8 @@ public class AndroidInput extends InputHandler{
}
return false;
}
public boolean breaking(){
return player.recipe == null;
}
}

View File

@ -151,4 +151,9 @@ public class DesktopInput extends InputHandler{
}
return 0;
}
@Override
public boolean keyDown(int keycode) {
return super.keyDown(keycode);
}
}

View File

@ -190,6 +190,7 @@ public abstract class InputHandler extends InputAdapter{
int worldy = dy + offsety + y;
if(!(worldx == x && worldy == y)){
Tile toplace = world.tile(worldx, worldy);
if(toplace != null)
toplace.setLinked((byte)(dx + offsetx), (byte)(dy + offsety));
}
@ -201,6 +202,8 @@ public abstract class InputHandler extends InputAdapter{
}
if(effects && sound) Sounds.play("place");
result.placed(tile);
}
public void breakBlock(int x, int y, boolean sound){

View File

@ -1,6 +1,5 @@
package io.anuke.mindustry.io;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.Vars;
@ -19,13 +18,11 @@ import io.anuke.ucore.scene.ui.SettingsDialog.SettingsTable.Setting;
import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Mathf;
import java.io.File;
public class BundleUtil {
public class BundleGen {
private static FileHandle file;
public static void buildBundle(FileHandle file){
BundleUtil.file = file;
BundleGen.file = file;
file.writeString("", false);
write("about.text=" + join(Vars.aboutText));

View File

@ -233,7 +233,7 @@ public class MapEditorDialog extends Dialog{
ImageButton undo = tools.addIButton("icon-undo", 16*2f, () -> view.undo()).get();
ImageButton redo = tools.addIButton("icon-redo", 16*2f, () -> view.redo()).get();
ImageButton grid = tools.addIButton("toggle", "icon-grid", 16*2f, () -> view.setGrid(!view.isGrid())).get();
tools.addIButton("toggle", "icon-grid", 16*2f, () -> view.setGrid(!view.isGrid())).get();
undo.setDisabled(() -> !view.getStack().canUndo());
redo.setDisabled(() -> !view.getStack().canRedo());

View File

@ -10,8 +10,10 @@ import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.Mindustry;
import io.anuke.mindustry.core.GameState;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.resource.ItemStack;
import io.anuke.mindustry.resource.Recipe;
import io.anuke.mindustry.resource.Section;
@ -28,11 +30,14 @@ import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.*;
import io.anuke.ucore.scene.ui.layout.Stack;
import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.scene.ui.layout.Value;
import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings;
public class BlocksFragment implements Fragment{
private Table desctable;
private Table desctable, itemtable, blocks;
private Stack stack = new Stack();
private Array<String> statlist = new Array<>();
private boolean shown = true;
@ -42,15 +47,25 @@ public class BlocksFragment implements Fragment{
abottom();
aright();
visible(() -> !GameState.is(State.menu));
visible(() -> !GameState.is(State.menu) && shown);
Table blocks = new table(){{
blocks = new table(){{
new table("button") {{
visible(() -> player.recipe != null);
desctable = get();
fillX();
}}.end().uniformX();
itemtable = new Table("button");
itemtable.setVisible(() -> player.recipe == null);
desctable = new Table("button");
desctable.setVisible(() -> player.recipe != null);
desctable.update(() -> {
if(player.recipe == null && desctable.getChildren().size != 0){
desctable.clear();
}
});
stack.add(itemtable);
stack.add(desctable);
add(stack).fillX().uniformX();
row();
@ -83,7 +98,7 @@ public class BlocksFragment implements Fragment{
}
});
button.setName("sectionbutton" + sec.name());
add(button).growX().height(54).padTop(sec.ordinal() <= 2 ? -10 : -5);
add(button).growX().height(54).padRight(-1).padTop(sec.ordinal() <= 2 ? -10 : -5);
button.getImageCell().size(40).padBottom(4).padTop(2);
group.add(button);
@ -110,7 +125,7 @@ public class BlocksFragment implements Fragment{
}
});
table.add(image).size(size + 8).pad(2);
table.add(image).size(size + 8);
image.getImageCell().size(size);
image.update(() -> {
@ -146,36 +161,18 @@ public class BlocksFragment implements Fragment{
visible(() -> !GameState.is(State.menu) && shown);
}}.end().get();
row();
ImageButton buttons[] = new ImageButton[2];
float size = 46f;
float t = 0.2f;
Interpolation ip = Interpolation.pow3Out;
//TODO fix glitch when resizing
buttons[0] = new imagebutton("icon-arrow-down", 10*2, () -> {
if(blocks.getActions().size != 0) return;
blocks.actions(Actions.translateBy(0, -blocks.getHeight(), t, ip), Actions.call(() -> shown = false));
buttons[0].actions(Actions.fadeOut(t));
buttons[1].actions(Actions.fadeIn(t));
}).padBottom(-5).visible(() -> shown).height(size).uniformX().fillX()
.update(i -> i.getStyle().imageUp = Core.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up")).get();
buttons[1] = new imagebutton("icon-arrow-up", 10*2, () -> {
if(blocks.getActions().size != 0) return;
blocks.actions(Actions.translateBy(0, blocks.getHeight(), t, ip));
shown = true;
buttons[0].actions(Actions.fadeIn(t));
buttons[1].actions(Actions.fadeOut(t));
}).touchable(() -> shown ? Touchable.disabled : Touchable.enabled).size(size).padBottom(-5).padLeft(-size).get();
buttons[1].getColor().a = 0f;
}}.end();
}
public void toggle(boolean show, float t, Interpolation ip){
if(!show){
blocks.actions(Actions.translateBy(0, -blocks.getHeight() - stack.getHeight(), t, ip), Actions.call(() -> shown = false));
}else{
shown = true;
blocks.actions(Actions.translateBy(0, -blocks.getTranslation().y, t, ip));
}
}
void updateRecipe(){
Recipe recipe = player.recipe;
desctable.clear();
@ -197,7 +194,7 @@ public class BlocksFragment implements Fragment{
header.addImage(region).size(8*5).padTop(4);
Label nameLabel = new Label(recipe.result.formalName);
nameLabel.setWrap(true);
header.add(nameLabel).padLeft(2).width(130f);
header.add(nameLabel).padLeft(2).width(120f);
//extra info
if(recipe.result.fullDescription != null){
@ -288,4 +285,40 @@ public class BlocksFragment implements Fragment{
desctable.add(label).width(200).padTop(4).padBottom(2);
}
public void updateItems(){
itemtable.clear();
itemtable.left();
if(control.getMode().infiniteResources){
return;
}
Item[] items = Item.values();
for(int i = 0; i < control.getItems().length; i ++){
int amount = control.getItems()[i];
if(amount == 0) continue;
String formatted = amount > 99999999 ? "inf" : format(amount);
Image image = new Image(Draw.region("icon-" + items[i].name()));
Label label = new Label(formatted);
label.setFontScale(fontscale*1.5f);
itemtable.add(image).size(8*3);
itemtable.add(label).expandX().left();
if(i % 2 == 1 && i > 0) itemtable.row();
}
}
String format(int number){
if(number > 1000000) {
return Strings.toFixed(number/1000000f, 1) + "[gray]mil";
}else if(number > 10000){
return number/1000 + "[gray]k";
}else if(number > 1000){
return Strings.toFixed(number/1000f, 1) + "[gray]k";
}else{
return number + "";
}
}
}

View File

@ -5,12 +5,14 @@ import static io.anuke.mindustry.Vars.*;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Interpolation;
import io.anuke.mindustry.Mindustry;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.core.GameState;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.world.GameMode;
import io.anuke.ucore.UCore;
import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Draw;
import io.anuke.ucore.core.Settings;
@ -20,16 +22,21 @@ import io.anuke.ucore.scene.builders.label;
import io.anuke.ucore.scene.builders.table;
import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.Image;
import io.anuke.ucore.scene.ui.ImageButton;
import io.anuke.ucore.scene.ui.Label;
import io.anuke.ucore.scene.ui.layout.Cell;
import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.util.Bundles;
public class HudFragment implements Fragment{
private Table itemtable, respawntable;
private Cell<Table> itemcell;
private ImageButton menu, flip, pause;
private Table respawntable;
private Table wavetable;
private boolean shown = true;
private BlocksFragment blockfrag = new BlocksFragment();
public void build(){
//menu at top left
new table(){{
atop();
@ -37,41 +44,50 @@ public class HudFragment implements Fragment{
new table(){{
left();
defaults().size(68).left();
float dsize = 58;
defaults().size(dsize).left();
float isize = 40;
new imagebutton("icon-menu", isize, ()->{
menu = new imagebutton("icon-menu", isize, ()->{
ui.showMenu();
});
}).get();
new imagebutton("icon-settings", isize, ()->{
ui.showPrefs();
});
flip = new imagebutton("icon-arrow-up", isize, ()->{
if(wavetable.getActions().size != 0) return;
new imagebutton("icon-pause", isize, ()->{
float dur = 0.3f;
Interpolation in = Interpolation.pow3Out;
flip.getStyle().imageUp = Core.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up");
if(shown){
blockfrag.toggle(false, dur, in);
wavetable.actions(Actions.translateBy(0, wavetable.getHeight() + dsize, dur, in), Actions.call(() -> shown = false));
}else{
shown = true;
blockfrag.toggle(true, dur, in);
wavetable.actions(Actions.translateBy(0, -wavetable.getTranslation().y, dur, in));
}
}).get();
pause = new imagebutton("icon-pause", isize, ()->{
GameState.set(GameState.is(State.paused) ? State.playing : State.paused);
}){{
get().update(()->{
get().getStyle().imageUp = Core.skin.getDrawable(GameState.is(State.paused) ? "icon-play" : "icon-pause");
});
}};
}).update(i -> i.getStyle().imageUp = Core.skin.getDrawable(GameState.is(State.paused) ? "icon-play" : "icon-pause")).get();
}}.end();
row();
new table(){{
get().setTouchable(Touchable.enabled);
touchable(Touchable.enabled);
visible(() -> shown);
addWaveTable();
}}.fillX().end();
row();
itemtable = new table("button").end().top().left().fillX().size(-1).get();
itemtable.setTouchable(Touchable.enabled);
itemtable.setVisible(()-> !control.getMode().infiniteResources);
itemcell = get().getCell(itemtable);
get().setVisible(()->!GameState.is(State.menu));
visible(()->!GameState.is(State.menu));
Label fps = new Label(()->(Settings.getBool("fps") ? (Gdx.graphics.getFramesPerSecond() + " FPS") : ""));
row();
@ -79,7 +95,7 @@ public class HudFragment implements Fragment{
}}.end();
//ui table
//tutorial ui table
new table(){{
control.getTutorial().buildUI(this);
@ -96,27 +112,10 @@ public class HudFragment implements Fragment{
}}.end();
}}.end();
//wave table...
new table(){{
if(!Vars.android){
atop();
aright();
}else{
abottom();
aleft();
}
//addWaveTable();
visible(()->!GameState.is(State.menu));
}}.end();
//respawn background table
new table("white"){{
respawntable = get();
respawntable.setColor(Color.CLEAR);
}}.end();
//respawn table
@ -148,6 +147,8 @@ public class HudFragment implements Fragment{
new label("[red]DEBUG MODE").scale(0.5f).left();
}}.end();
}
blockfrag.build();
}
private String getEnemiesRemaining() {
@ -159,12 +160,12 @@ public class HudFragment implements Fragment{
private void addWaveTable(){
float uheight = 66f;
new table("button"){{
wavetable = new table("button"){{
aleft();
new table(){{
aleft();
new label(() -> Bundles.format("text.wave", control.getWave())).scale(fontscale*1.5f).left();
new label(() -> Bundles.format("text.wave", control.getWave())).scale(fontscale*1.5f).left().padLeft(-6);
row();
@ -172,15 +173,15 @@ public class HudFragment implements Fragment{
getEnemiesRemaining() :
(control.getTutorial().active() || Vars.control.getMode().toggleWaves) ? "$text.waiting"
: Bundles.format("text.wave.waiting", (int) (control.getWaveCountdown() / 60f)))
.minWidth(140).left();
.minWidth(140).padLeft(-6).padRight(-12).left();
margin(12f);
margin(10f);
get().marginLeft(6);
}}.left().end();
playButton(uheight);
}}.height(uheight).fillX().expandX().end();
}}.height(uheight).fillX().expandX().end().get();
wavetable.getParent().getParent().swapActor(wavetable.getParent(), menu.getParent());
}
private void playButton(float uheight){
@ -198,34 +199,10 @@ public class HudFragment implements Fragment{
}
public void updateItems(){
itemtable.clear();
itemtable.left();
if(control.getMode().infiniteResources){
return;
}
Item[] items = Item.values();
for(int i = 0; i < control.getItems().length; i ++){
int amount = control.getItems()[i];
if(amount == 0) continue;
String formatted = Mindustry.platforms.format(amount);
if(amount > 99999999){
formatted = "inf";
}
Image image = new Image(Draw.region("icon-" + items[i].name()));
Label label = new Label(formatted);
label.setFontScale(fontscale*1.5f);
itemtable.add(image).size(8*3);
itemtable.add(label).left();
itemtable.row();
}
blockfrag.updateItems();
}
public void fadeRespawn(boolean in){
respawntable.addAction(Actions.color(in ? new Color(0, 0, 0, 0.3f) : Color.CLEAR, 0.3f));
}
}

View File

@ -3,28 +3,41 @@ package io.anuke.mindustry.ui.fragments;
import static io.anuke.mindustry.Vars.*;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.utils.Align;
import io.anuke.mindustry.core.GameState;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.input.PlaceMode;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.scene.actions.Actions;
import io.anuke.ucore.scene.builders.*;
import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.ButtonGroup;
import io.anuke.ucore.scene.ui.ImageButton;
import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.util.Mathf;
public class PlacementFragment implements Fragment{
boolean shown = false;
Table breaktable, next;
public void build(){
if(android){
//placement table
float s = 50f;
new table(){{
visible(()->player.recipe != null && !GameState.is(State.menu));
visible(() -> !GameState.is(State.menu));
abottom();
aleft();
ButtonGroup<ImageButton> group = new ButtonGroup<>();
new table(){{
visible(() -> player.recipe != null);
touchable(Touchable.enabled);
aleft();
@ -34,31 +47,24 @@ public class PlacementFragment implements Fragment{
new table("pane"){{
margin(5f);
aleft();
ButtonGroup<ImageButton> group = new ButtonGroup<>();
defaults().size(54, 58).pad(0);
defaults().size(s, s + 4).padBottom(-5.5f);
for(PlaceMode mode : PlaceMode.values()){
if(!mode.shown || mode.delete) continue;
defaults().padBottom(-5.5f);
new imagebutton("icon-" + mode.name(), "toggle", 10*3, ()->{
control.getInput().resetCursor();
player.placeMode = mode;
}).group(group);
}
row();
Color color = Color.GRAY;//Colors.get("accent"); //Color.valueOf("4d4d4d")
Color color = Color.GRAY;
new imagebutton("icon-cancel", 14*3, ()->{
player.recipe = null;
}).imageColor(color)
.visible(()->player.recipe != null);
new button("", ()->{}).get().setTouchable(Touchable.disabled);;
for(PlaceMode mode : PlaceMode.values()){
if(!mode.shown || mode.delete) continue;
new imagebutton("icon-" + mode.name(), "toggle", 10*3, ()->{
control.getInput().resetCursor();
player.placeMode = mode;
}).group(group);
}
new imagebutton("icon-arrow", 14*3, ()->{
player.rotation = Mathf.mod(player.rotation + 1, 4);
@ -67,25 +73,47 @@ public class PlacementFragment implements Fragment{
image.getImage().setOrigin(Align.center);
});
}}.padBottom(-5).left().end();
}}.left().end();
}}.end();
}}.end();
row();
new table(){{
visible(()->player.recipe == null && !GameState.is(State.menu));
abottom();
aleft();
new label("$text.breakmode");
row();
height(s+5+4);
new table("pane"){{
next = new table("pane"){{
margin(5f);
defaults().padBottom(-5.5f);
new imagebutton("icon-arrow-right", 10 * 3, () -> {
float dur = 0.3f;
Interpolation in = Interpolation.pow3Out;
if(breaktable.getActions().size != 0) return;
breaktable.getParent().swapActor(breaktable, next);
if(shown){
breaktable.actions(Actions.translateBy(-breaktable.getWidth() - 5, 0, dur, in), Actions.call(() -> shown = false));
}else{
shown = true;
breaktable.actions(Actions.translateBy(-breaktable.getTranslation().x - 5, 0, dur, in));
}
}).size(s, s+4);
}}.end().get();
breaktable = new table("pane"){{
visible(() -> shown);
margin(5f);
marginLeft(0f);
touchable(Touchable.enabled);
aleft();
ButtonGroup<ImageButton> group = new ButtonGroup<>();
defaults().size(54, 58).pad(0);
defaults().size(s, s+4);
for(PlaceMode mode : PlaceMode.values()){
if(!mode.shown || !mode.delete) continue;
@ -95,12 +123,20 @@ public class PlacementFragment implements Fragment{
new imagebutton("icon-" + mode.name(), "toggle", 10*3, ()->{
control.getInput().resetCursor();
player.breakMode = mode;
}){{
group.add(get());
}};
player.placeMode = mode;
}).group(group);
}
}}.end();
}}.end().get();
breaktable.getParent().swapActor(breaktable, next);
breaktable.getTranslation().set(-breaktable.getPrefWidth(), 0);
}}.end().get();
//one.getParent().swapActor(one, two);
}}.end();
}
}

View File

@ -52,7 +52,7 @@ public class WeaponFragment implements Fragment{
String description = weapon.description;
tiptable.background("button");
tiptable.add("weapon."+weapon.name()+".name", 0.5f).left().padBottom(3f);
tiptable.add("$weapon."+weapon.name()+".name", 0.5f).left().padBottom(3f);
tiptable.row();
tiptable.row();

View File

@ -92,11 +92,14 @@ public class Block{
}
public boolean isLayer(Tile tile){return true;}
public boolean isLayer2(Tile tile){return true;}
public void drawLayer(Tile tile){}
public void drawLayer2(Tile tile){}
public void drawSelect(Tile tile){}
public void drawPlace(int x, int y, int rotation, boolean valid){}
public void postInit(){}
public void placed(Tile tile){}
public void getStats(Array<String> list){
list.add("[gray]size: " + width + "x" + height);
@ -124,6 +127,7 @@ public class Block{
}
public void handleItem(Item item, Tile tile, Tile source){
if(tile.entity == null) return;
tile.entity.addItem(item, 1);
}

View File

@ -57,6 +57,11 @@ public class Conveyor extends Block{
tile.worldx(), tile.worldy(), rotation * 90);
}
@Override
public boolean isLayer(Tile tile){
return tile.<ConveyorEntity>entity().convey.size > 0;
}
@Override
public void drawLayer(Tile tile){
ConveyorEntity entity = tile.entity();

View File

@ -25,7 +25,7 @@ public class Junction extends Block{
Tile to = tile.getNearby()[dir];
Timers.run(15, ()->{
if(to == null || to.entity == null) return;
if(to == null) return;
to.block().handleItem(item, to, tile);
});

View File

@ -22,9 +22,11 @@ public class Teleporter extends Block implements Configurable{
public static final Color[] colorArray = {Color.ROYAL, Color.ORANGE, Color.SCARLET, Color.FOREST, Color.PURPLE, Color.GOLD, Color.PINK};
public static final int colors = colorArray.length;
private static Array<Tile> removal = new Array<>();
private static Array<Tile> returns = new Array<>();
private static ObjectSet<Tile>[] teleporters = new ObjectSet[colors];
private static byte lastColor = 0;
private Array<Tile> removal = new Array<>();
private Array<Tile> returns = new Array<>();
static{
for(int i = 0; i < colors; i ++){
@ -39,6 +41,11 @@ public class Teleporter extends Block implements Configurable{
health = 80;
}
@Override
public void placed(Tile tile){
tile.<TeleporterEntity>entity().color = lastColor;
}
@Override
public void draw(Tile tile){
TeleporterEntity entity = tile.entity();
@ -70,12 +77,14 @@ public class Teleporter extends Block implements Configurable{
table.addIButton("icon-arrow-left", 10*3, ()->{
entity.color = (byte)Mathf.mod(entity.color - 1, colors);
lastColor = entity.color;
});
table.add().size(40f);
table.addIButton("icon-arrow-right", 10*3, ()->{
entity.color = (byte)Mathf.mod(entity.color + 1, colors);
lastColor = entity.color;
});
}
@ -100,7 +109,7 @@ public class Teleporter extends Block implements Configurable{
return new TeleporterEntity();
}
static Array<Tile> findLinks(Tile tile){
private Array<Tile> findLinks(Tile tile){
TeleporterEntity entity = tile.entity();
removal.clear();

View File

@ -53,13 +53,16 @@ public class Drill extends Block{
}
}
@Override
public boolean isLayer(Tile tile){
return tile.floor() != resource && resource != null && !(resource.drops.equals(tile.floor().drops));
}
@Override
public void drawLayer(Tile tile){
if(tile.floor() != resource && resource != null && !(resource.drops.equals(tile.floor().drops))){
Draw.colorl(0.85f + Mathf.absin(Timers.time(), 6f, 0.15f));
Draw.rect("cross", tile.worldx(), tile.worldy());
Draw.color();
}
}
}

View File

@ -91,11 +91,7 @@ public class LiquidPowerGenerator extends Generator implements LiquidAcceptor{
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
LiquidPowerEntity entity = tile.entity();
if(liquid != generateLiquid){
return false;
}
return entity.liquidAmount + amount < liquidCapacity && (entity.liquid == liquid || entity.liquidAmount <= 0.01f);
return liquid == generateLiquid && entity.liquidAmount + amount < liquidCapacity && (entity.liquid == liquid || entity.liquidAmount <= 0.01f);
}
@Override

View File

@ -7,6 +7,7 @@ import java.io.IOException;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.effect.DamageArea;
@ -18,11 +19,16 @@ import io.anuke.ucore.core.Draw;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings;
import io.anuke.ucore.util.Tmp;
public class NuclearReactor extends LiquidItemPowerGenerator{
//TODO possibly proken
public class NuclearReactor extends LiquidPowerGenerator{
protected final int timerFuel = timers++;
protected Item generateItem;
protected int itemInput = 5;
protected int itemCapacity = 30;
protected Color coolColor = new Color(1, 1, 1, 0f);
protected Color hotColor = Color.valueOf("ff9575a3");
protected int fuelUseTime = 140; //time to consume 1 fuel
@ -45,6 +51,12 @@ public class NuclearReactor extends LiquidItemPowerGenerator{
powerCapacity = 80f;
}
@Override
public void getStats(Array<String> list){
super.getStats(list);
list.add("[powerinfo]Input Item: " + generateItem);
}
@Override
public void update(Tile tile){
NuclearReactorEntity entity = tile.entity();
@ -141,17 +153,25 @@ public class NuclearReactor extends LiquidItemPowerGenerator{
super.drawSelect(tile);
NuclearReactorEntity entity = tile.entity();
Vector2 offset = getPlaceOffset();
Vars.renderer.drawBar(Color.GREEN, tile.worldx() + offset.x, tile.worldy() + 6 +
offset.y + height*Vars.tilesize/2f, (float)entity.getItem(generateItem) / itemCapacity);
Draw.reset();
float fract = entity.heat;
if(fract > 0)
fract = Mathf.clamp(fract + 0.2f, 0.24f, 1f);
Vector2 offset = getPlaceOffset();
Vars.renderer.drawBar(Color.ORANGE, tile.worldx() + offset.x,
tile.worldy() + Vars.tilesize * height/2f + 10 + offset.y, fract);
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return item == generateItem && tile.entity.getItem(generateItem) < itemCapacity;
}
@Override
public void draw(Tile tile){
super.draw(tile);

View File

@ -50,14 +50,17 @@ public class Pump extends LiquidBlock{
Draw.color();
}
@Override
public boolean isLayer(Tile tile) {
return tile.floor().liquidDrop == null;
}
@Override
public void drawLayer(Tile tile){
if(tile.floor().liquidDrop == null){
Draw.colorl(0.85f + Mathf.absin(Timers.time(), 6f, 0.15f));
Draw.rect("cross", tile.worldx(), tile.worldy());
Draw.color();
}
}
@Override
public void update(Tile tile){