diff --git a/core/assets-raw/sprites/mechs/mech-standard.png b/core/assets-raw/sprites/mechs/mech-standard.png index d2044dcb29..1b343a9775 100644 Binary files a/core/assets-raw/sprites/mechs/mech-standard.png and b/core/assets-raw/sprites/mechs/mech-standard.png differ diff --git a/core/assets-raw/sprites/weapons/beam-equip.png b/core/assets-raw/sprites/weapons/beam-equip.png new file mode 100644 index 0000000000..4509ed3ade Binary files /dev/null and b/core/assets-raw/sprites/weapons/beam-equip.png differ diff --git a/core/assets-raw/sprites/weapons/blaster-equip.png b/core/assets-raw/sprites/weapons/blaster-equip.png new file mode 100644 index 0000000000..6a90610d9f Binary files /dev/null and b/core/assets-raw/sprites/weapons/blaster-equip.png differ diff --git a/core/assets-raw/sprites/weapons/clustergun-equip.png b/core/assets-raw/sprites/weapons/clustergun-equip.png new file mode 100644 index 0000000000..8f5c6db8a2 Binary files /dev/null and b/core/assets-raw/sprites/weapons/clustergun-equip.png differ diff --git a/core/assets-raw/sprites/weapons/shockgun-equip.png b/core/assets-raw/sprites/weapons/shockgun-equip.png new file mode 100644 index 0000000000..96a33a55a5 Binary files /dev/null and b/core/assets-raw/sprites/weapons/shockgun-equip.png differ diff --git a/core/assets-raw/sprites/weapons/triblaster-equip.png b/core/assets-raw/sprites/weapons/triblaster-equip.png new file mode 100644 index 0000000000..231869b8e4 Binary files /dev/null and b/core/assets-raw/sprites/weapons/triblaster-equip.png differ diff --git a/core/assets-raw/sprites/weapons/vulcan-equip.png b/core/assets-raw/sprites/weapons/vulcan-equip.png new file mode 100644 index 0000000000..1c9ddf9401 Binary files /dev/null and b/core/assets-raw/sprites/weapons/vulcan-equip.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 5180498c74..59637b39c3 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -215,6 +215,7 @@ setting.effects.name=Display Effects setting.sensitivity.name=Controller Sensitivity setting.saveinterval.name=Autosave Interval setting.seconds={0} Seconds +setting.fullscreen.name=Fullscreen setting.fps.name=Show FPS setting.vsync.name=VSync setting.lasers.name=Show Power Lasers @@ -329,6 +330,7 @@ liquid.plasma.name=plasma liquid.lava.name=lava liquid.oil.name=oil block.weaponfactory.name=weapon factory +block.weaponfactory.fulldescription=Used to create weapons for the player mech. Click to use. Automatically takes resources from the core. block.air.name=air block.blockpart.name=blockpart block.deepwater.name=deepwater diff --git a/core/assets/shaders/outline.fragment b/core/assets/shaders/outline.fragment index 49b799ae52..6a43f1d4a6 100644 --- a/core/assets/shaders/outline.fragment +++ b/core/assets/shaders/outline.fragment @@ -12,6 +12,10 @@ uniform float u_lighten; varying vec4 v_color; varying vec2 v_texCoord; +bool id(vec4 v){ + return v.a > 0.1 && !(v.r < 0.01 && v.g < 0.01 && v.b < 0.01); +} + void main() { vec2 T = v_texCoord.xy; @@ -20,18 +24,21 @@ void main() { bool any = false; - float thickness = 1.0; float step = 1.0; - if(texture2D(u_texture, T).a < 0.1 && - (texture2D(u_texture, T + vec2(0, step) * v).a > 0.1 || texture2D(u_texture, T + vec2(0, -step) * v).a > 0.1 || - texture2D(u_texture, T + vec2(step, 0) * v).a > 0.1 || texture2D(u_texture, T + vec2(-step, 0) * v).a > 0.1)) + vec4 c = texture2D(u_texture, T); + + if(texture2D(u_texture, T).a < 0.1 && + (id(texture2D(u_texture, T + vec2(0, step) * v)) || id(texture2D(u_texture, T + vec2(0, -step) * v)) || + id(texture2D(u_texture, T + vec2(step, 0) * v)) || id(texture2D(u_texture, T + vec2(-step, 0) * v)))) any = true; if(any){ gl_FragColor = u_color; }else{ - vec4 c = texture2D(u_texture, T); + if((c.r < 0.01 && c.g < 0.01 && c.b < 0.01)){ + c = vec4(0.0); + } gl_FragColor = mix(c, vec4(1.0, 1.0, 1.0, c.a), u_lighten) * v_color; } } diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 3b34462f84..a8ffc3901e 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -20,56 +20,56 @@ blank index: -1 blocks/blackrock1 rotate: false - xy: 132, 88 + xy: 722, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackrockshadow1 rotate: false - xy: 722, 381 + xy: 166, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstone1 rotate: false - xy: 166, 83 + xy: 732, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstone2 rotate: false - xy: 732, 381 + xy: 736, 371 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstone3 rotate: false - xy: 736, 371 + xy: 736, 361 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock1 rotate: false - xy: 736, 361 + xy: 736, 351 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock2 rotate: false - xy: 736, 351 + xy: 659, 282 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock3 rotate: false - xy: 659, 282 + xy: 669, 282 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -83,7 +83,7 @@ blocks/blackstoneedge index: -1 blocks/block rotate: false - xy: 679, 282 + xy: 250, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -104,7 +104,7 @@ blocks/block-3x3 index: -1 blocks/block-middle rotate: false - xy: 240, 91 + xy: 260, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -125,112 +125,112 @@ blocks/chainturret-icon index: -1 blocks/coal1 rotate: false - xy: 270, 91 + xy: 300, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal2 rotate: false - xy: 280, 91 + xy: 310, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal3 rotate: false - xy: 290, 91 + xy: 320, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coaldrill rotate: false - xy: 300, 95 + xy: 330, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator rotate: false - xy: 310, 95 + xy: 340, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator-top rotate: false - xy: 320, 95 + xy: 350, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalpurifier rotate: false - xy: 330, 95 + xy: 360, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/combustiongenerator rotate: false - xy: 340, 95 + xy: 370, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/compositewall rotate: false - xy: 350, 95 + xy: 380, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduit rotate: false - xy: 360, 95 + xy: 390, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitbottom rotate: false - xy: 370, 95 + xy: 400, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitliquid rotate: false - xy: 380, 95 + xy: 410, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduittop rotate: false - xy: 390, 95 + xy: 420, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyor rotate: false - xy: 400, 95 + xy: 430, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyormove rotate: false - xy: 410, 95 + xy: 440, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyortunnel rotate: false - xy: 420, 95 + xy: 450, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -244,42 +244,42 @@ blocks/core index: -1 blocks/cross rotate: false - xy: 430, 95 + xy: 460, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/crucible rotate: false - xy: 440, 95 + xy: 470, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/deepwater rotate: false - xy: 450, 95 + xy: 113, 71 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt1 rotate: false - xy: 460, 95 + xy: 113, 61 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt2 rotate: false - xy: 470, 95 + xy: 113, 51 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt3 rotate: false - xy: 113, 71 + xy: 117, 41 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -293,7 +293,7 @@ blocks/dirtedge index: -1 blocks/door rotate: false - xy: 113, 61 + xy: 117, 31 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -307,7 +307,7 @@ blocks/door-large index: -1 blocks/door-large-icon rotate: false - xy: 113, 51 + xy: 117, 21 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -321,7 +321,7 @@ blocks/door-large-open index: -1 blocks/door-open rotate: false - xy: 117, 41 + xy: 117, 11 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -335,7 +335,7 @@ blocks/doubleturret index: -1 blocks/duriumwall rotate: false - xy: 117, 31 + xy: 117, 1 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -349,14 +349,14 @@ blocks/duriumwall-large index: -1 blocks/duriumwall-large-icon rotate: false - xy: 117, 21 + xy: 624, 233 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/enemyspawn rotate: false - xy: 117, 11 + xy: 624, 223 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -370,42 +370,42 @@ blocks/flameturret index: -1 blocks/fluxpump rotate: false - xy: 117, 1 + xy: 624, 213 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass1 rotate: false - xy: 310, 85 + xy: 634, 235 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass2 rotate: false - xy: 320, 85 + xy: 634, 225 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass3 rotate: false - xy: 330, 85 + xy: 634, 215 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock1 rotate: false - xy: 340, 85 + xy: 627, 203 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock2 rotate: false - xy: 350, 85 + xy: 627, 193 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -419,21 +419,21 @@ blocks/grassedge index: -1 blocks/ice1 rotate: false - xy: 360, 85 + xy: 637, 205 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice2 rotate: false - xy: 370, 85 + xy: 637, 195 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice3 rotate: false - xy: 380, 85 + xy: 637, 185 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -447,84 +447,84 @@ blocks/iceedge index: -1 blocks/icerock1 rotate: false - xy: 390, 85 + xy: 865, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerock2 rotate: false - xy: 400, 85 + xy: 300, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow1 rotate: false - xy: 410, 85 + xy: 310, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow1 rotate: false - xy: 410, 85 + xy: 310, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow2 rotate: false - xy: 420, 85 + xy: 320, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow2 rotate: false - xy: 420, 85 + xy: 320, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron1 rotate: false - xy: 624, 213 + xy: 410, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron2 rotate: false - xy: 634, 235 + xy: 420, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron3 rotate: false - xy: 634, 225 + xy: 430, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/irondrill rotate: false - xy: 634, 215 + xy: 440, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ironwall rotate: false - xy: 627, 203 + xy: 450, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/junction rotate: false - xy: 627, 193 + xy: 460, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -538,7 +538,7 @@ blocks/laserturret index: -1 blocks/lava rotate: false - xy: 627, 183 + xy: 470, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -552,28 +552,28 @@ blocks/lavaedge index: -1 blocks/lavasmelter rotate: false - xy: 637, 205 + xy: 480, 87 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquiditemjunction rotate: false - xy: 637, 195 + xy: 875, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidjunction rotate: false - xy: 637, 185 + xy: 885, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidrouter rotate: false - xy: 865, 417 + xy: 895, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -601,14 +601,14 @@ blocks/mortarturret index: -1 blocks/mossblock rotate: false - xy: 875, 417 + xy: 905, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/mossstone rotate: false - xy: 875, 417 + xy: 905, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -629,7 +629,7 @@ blocks/nuclearreactor-center index: -1 blocks/nuclearreactor-icon rotate: false - xy: 885, 421 + xy: 915, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -650,7 +650,7 @@ blocks/nuclearreactor-small index: -1 blocks/oil rotate: false - xy: 895, 421 + xy: 925, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -664,14 +664,14 @@ blocks/oiledge index: -1 blocks/oilrefinery rotate: false - xy: 905, 421 + xy: 935, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/omnidrill rotate: false - xy: 915, 421 + xy: 945, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -685,77 +685,77 @@ blocks/plasmaturret index: -1 blocks/playerspawn rotate: false - xy: 925, 421 + xy: 955, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerbooster rotate: false - xy: 935, 421 + xy: 965, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyor rotate: false - xy: 945, 421 + xy: 975, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyormove rotate: false - xy: 955, 421 + xy: 985, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaser rotate: false - xy: 965, 421 + xy: 995, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlasercorner rotate: false - xy: 975, 421 + xy: 885, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaserrouter rotate: false - xy: 985, 421 + xy: 895, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduit rotate: false - xy: 995, 421 + xy: 905, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduitbottom rotate: false - xy: 885, 411 + xy: 915, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduittop rotate: false - xy: 895, 411 + xy: 925, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pump rotate: false - xy: 905, 411 + xy: 935, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -769,77 +769,77 @@ blocks/repairturret index: -1 blocks/rock1 rotate: false - xy: 915, 411 + xy: 945, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rock2 rotate: false - xy: 925, 411 + xy: 955, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/router rotate: false - xy: 935, 411 + xy: 965, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator rotate: false - xy: 945, 411 + xy: 975, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator-top rotate: false - xy: 955, 411 + xy: 985, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand1 rotate: false - xy: 965, 411 + xy: 995, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand2 rotate: false - xy: 975, 411 + xy: 532, 126 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand3 rotate: false - xy: 985, 411 + xy: 532, 116 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock1 rotate: false - xy: 995, 411 + xy: 530, 106 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock2 rotate: false - xy: 532, 126 + xy: 542, 127 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock3 rotate: false - xy: 532, 116 + xy: 542, 117 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -860,7 +860,7 @@ blocks/shadow index: -1 blocks/shieldgenerator rotate: false - xy: 542, 127 + xy: 746, 372 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -874,28 +874,28 @@ blocks/shotgunturret index: -1 blocks/shrub rotate: false - xy: 746, 362 + xy: 644, 278 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shrubshadow rotate: false - xy: 746, 352 + xy: 644, 268 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/smelter rotate: false - xy: 637, 278 + xy: 654, 272 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/smelter-middle rotate: false - xy: 647, 278 + xy: 664, 272 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -909,42 +909,42 @@ blocks/sniperturret index: -1 blocks/snow1 rotate: false - xy: 689, 281 + xy: 674, 272 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow2 rotate: false - xy: 699, 281 + xy: 684, 272 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow3 rotate: false - xy: 709, 281 + xy: 644, 258 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock1 rotate: false - xy: 719, 281 + xy: 654, 262 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock2 rotate: false - xy: 634, 267 + xy: 644, 248 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock3 rotate: false - xy: 644, 268 + xy: 654, 252 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -958,28 +958,28 @@ blocks/snowedge index: -1 blocks/sorter rotate: false - xy: 644, 258 + xy: 664, 262 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyor rotate: false - xy: 644, 248 + xy: 644, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyormove rotate: false - xy: 644, 238 + xy: 654, 242 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelwall rotate: false - xy: 644, 228 + xy: 664, 252 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -993,56 +993,56 @@ blocks/steelwall-large index: -1 blocks/steelwall-large-icon rotate: false - xy: 644, 218 + xy: 674, 262 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone1 rotate: false - xy: 647, 208 + xy: 644, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone2 rotate: false - xy: 647, 198 + xy: 654, 232 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone3 rotate: false - xy: 647, 188 + xy: 664, 242 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock1 rotate: false - xy: 654, 268 + xy: 674, 252 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock2 rotate: false - xy: 654, 258 + xy: 684, 262 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock3 rotate: false - xy: 654, 248 + xy: 644, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonedrill rotate: false - xy: 654, 238 + xy: 654, 222 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1056,35 +1056,35 @@ blocks/stoneedge index: -1 blocks/stoneformer rotate: false - xy: 654, 228 + xy: 664, 232 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonewall rotate: false - xy: 654, 218 + xy: 674, 242 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter rotate: false - xy: 657, 208 + xy: 684, 252 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter-top rotate: false - xy: 657, 198 + xy: 664, 222 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/thermalgenerator rotate: false - xy: 657, 188 + xy: 674, 232 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1105,49 +1105,49 @@ blocks/titancannon-icon index: -1 blocks/titanium1 rotate: false - xy: 664, 272 + xy: 684, 242 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium2 rotate: false - xy: 664, 262 + xy: 674, 222 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium3 rotate: false - xy: 674, 272 + xy: 684, 232 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumdrill rotate: false - xy: 664, 252 + xy: 684, 222 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumpurifier rotate: false - xy: 674, 262 + xy: 647, 208 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumshieldwall rotate: false - xy: 664, 242 + xy: 647, 198 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumwall rotate: false - xy: 674, 252 + xy: 647, 188 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1161,7 +1161,7 @@ blocks/titaniumwall-large index: -1 blocks/titaniumwall-large-icon rotate: false - xy: 664, 232 + xy: 657, 212 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1175,35 +1175,35 @@ blocks/turret index: -1 blocks/uranium1 rotate: false - xy: 674, 232 + xy: 667, 202 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium2 rotate: false - xy: 674, 222 + xy: 677, 212 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium3 rotate: false - xy: 667, 212 + xy: 667, 192 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uraniumdrill rotate: false - xy: 667, 202 + xy: 677, 202 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/water rotate: false - xy: 677, 212 + xy: 687, 202 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1231,14 +1231,14 @@ blocks/weaponfactory index: -1 blocks/weaponfactory-icon rotate: false - xy: 677, 202 + xy: 687, 192 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 bullet rotate: false - xy: 250, 91 + xy: 270, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1504,63 +1504,63 @@ enemies/titanenemy-t3 index: -1 enemyarrow rotate: false - xy: 300, 86 + xy: 627, 184 size: 8, 7 orig: 8, 7 offset: 0, 0 index: -1 icon-coal rotate: false - xy: 430, 85 + xy: 330, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-dirium rotate: false - xy: 440, 85 + xy: 340, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-iron rotate: false - xy: 450, 85 + xy: 350, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-sand rotate: false - xy: 460, 85 + xy: 360, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-steel rotate: false - xy: 470, 85 + xy: 370, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-stone rotate: false - xy: 480, 87 + xy: 380, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-titanium rotate: false - xy: 624, 233 + xy: 390, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-uranium rotate: false - xy: 624, 223 + xy: 400, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1602,28 +1602,28 @@ mechs/ship-standard index: -1 shell rotate: false - xy: 530, 106 + xy: 742, 382 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 742, 382 + xy: 634, 277 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 746, 372 + xy: 634, 267 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 674, 242 + xy: 657, 202 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2325,7 +2325,7 @@ ui/selection index: -1 ui/slider rotate: false - xy: 634, 277 + xy: 689, 282 size: 1, 8 orig: 1, 8 offset: 0, 0 @@ -2425,37 +2425,79 @@ weapons/beam orig: 8, 8 offset: 0, 0 index: -1 +weapons/beam-equip + rotate: false + xy: 132, 88 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 weapons/blaster rotate: false - xy: 669, 282 + xy: 679, 282 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +weapons/blaster-equip + rotate: false + xy: 240, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/clustergun rotate: false - xy: 260, 91 + xy: 280, 91 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +weapons/clustergun-equip + rotate: false + xy: 290, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/shockgun rotate: false - xy: 542, 117 + xy: 746, 362 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +weapons/shockgun-equip + rotate: false + xy: 746, 352 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/triblaster rotate: false - xy: 664, 222 + xy: 667, 212 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +weapons/triblaster-equip + rotate: false + xy: 657, 192 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/vulcan rotate: false - xy: 667, 192 + xy: 677, 192 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +weapons/vulcan-equip + rotate: false + xy: 687, 212 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index f5415cebeb..253d5eeb63 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/Mindustry.java b/core/src/io/anuke/mindustry/Mindustry.java index 2e978ad57c..57e59ad1ef 100644 --- a/core/src/io/anuke/mindustry/Mindustry.java +++ b/core/src/io/anuke/mindustry/Mindustry.java @@ -3,6 +3,7 @@ package io.anuke.mindustry; import io.anuke.mindustry.core.*; import io.anuke.mindustry.io.BlockLoader; import io.anuke.mindustry.io.BundleLoader; +import io.anuke.mindustry.io.Platform; import io.anuke.ucore.modules.ModuleCore; import io.anuke.ucore.util.Log; @@ -12,6 +13,8 @@ public class Mindustry extends ModuleCore { @Override public void init(){ + debug = Platform.instance.isDebug(); + Log.setUseColors(false); BundleLoader.load(); BlockLoader.load(); diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 853cbf0875..53f22810fd 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -146,6 +146,7 @@ public class Control extends Module{ }); Events.on(ResetEvent.class, () -> { + upgrades.reset(); player.weaponLeft = player.weaponRight = Weapon.blaster; player.add(); diff --git a/core/src/io/anuke/mindustry/core/NetClient.java b/core/src/io/anuke/mindustry/core/NetClient.java index cdaabb1ebf..5a1e39f8d5 100644 --- a/core/src/io/anuke/mindustry/core/NetClient.java +++ b/core/src/io/anuke/mindustry/core/NetClient.java @@ -304,6 +304,20 @@ public class NetClient extends Module { } } + //TODO remove. + public void test(){ + gotData = false; + connecting = true; + } + + public boolean hasData(){ + return gotData; + } + + public boolean isConnecting(){ + return connecting; + } + private void finishConnecting(){ Net.send(new ConnectConfirmPacket(), SendMode.tcp); state.set(State.playing); diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index b2ecb90cab..7cb22ce63b 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -68,7 +68,7 @@ public class NetServer extends Module{ data.stream = new ByteArrayInputStream(stream.toByteArray()); Net.sendStream(id, data); - Log.info("Sending custom map: Packed {0}uncompressed bytes of MAP data.", stream.size()); + Log.info("Sending custom map: Packed {0} uncompressed bytes of MAP data.", stream.size()); }else{ //hack-- simulate the map ack packet recieved to send the world data to the client. Net.handleServerReceived(id, new MapAckPacket()); diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 98b2d9099f..25bd67fced 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -177,14 +177,17 @@ public class Renderer extends RendererModule{ Graphics.shader(Shaders.outline, false); Entities.draw(enemyGroup); + Entities.draw(playerGroup, p -> !p.isAndroid); Graphics.shader(); - Entities.draw(playerGroup, p -> !p.isAndroid); Entities.draw(Entities.defaultGroup()); blocks.drawBlocks(true); + Graphics.shader(Shaders.outline, false); Entities.draw(playerGroup, p -> p.isAndroid); + Graphics.shader(); + Entities.draw(bulletGroup); drawShield(); @@ -208,6 +211,10 @@ public class Renderer extends RendererModule{ super.resize(width, height); control.input().resetCursor(); camera.position.set(player.x, player.y, 0); + + int scale = Settings.getBool("pixelate") ? Core.cameraScale : 1; + Graphics.getEffects1().setScale(scale); + Graphics.getEffects2().setScale(scale); } public void clearTiles(){ @@ -224,7 +231,7 @@ public class Renderer extends RendererModule{ Draw.color(0f, 0f, 0f, 0.3f); Draw.rect("blank", player.x, player.y + 8 - layout.height/2, layout.width + 2, layout.height + 2); Draw.color(); - Draw.tcolor(NetCommon.colorArray[player.id % NetCommon.colorArray.length]); + Draw.tcolor(player.getColor()); Draw.text(player.name, player.x, player.y + 8); Draw.tcolor(); } diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 6d413e0f28..bc90107ee6 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -1,16 +1,16 @@ package io.anuke.mindustry.entities; +import com.badlogic.gdx.graphics.Color; +import io.anuke.mindustry.core.NetCommon; import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.Shaders; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.mindustry.resource.Mech; import io.anuke.mindustry.resource.Weapon; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.Blocks; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Inputs; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; +import io.anuke.ucore.core.*; import io.anuke.ucore.entities.SolidEntity; import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.util.Angles; @@ -108,25 +108,33 @@ public class Player extends SyncEntity{ boolean snap = snapCamera && Settings.getBool("smoothcam") && Settings.getBool("pixelate") && isLocal; String part = isAndroid ? "ship" : "mech"; - + + Shaders.outline.color.set(getColor()); + Shaders.outline.lighten = 0f; + Shaders.outline.region = Draw.region(part + "-" + mech.name); + + Shaders.outline.apply(); + + if(!isAndroid) { + for (int i : Mathf.signs) { + Weapon weapon = i < 0 ? weaponLeft : weaponRight; + Angles.vector.set(3 * i, 2).rotate(angle - 90); + float w = i > 0 ? -8 : 8; + if(snap){ + Draw.rect(weapon.name + "-equip", (int)x + Angles.x(), (int)y + Angles.y(), w, 8, angle - 90); + }else{ + Draw.rect(weapon.name + "-equip", x + Angles.x(), y + Angles.y(), w, 8, angle - 90); + } + } + } + if(snap){ Draw.rect(part + "-" + mech.name, (int)x, (int)y, angle-90); }else{ Draw.rect(part + "-" + mech.name, x, y, angle-90); } - if(!isAndroid) { - for (boolean b : new boolean[]{true, false}) { - Weapon weapon = b ? weaponLeft : weaponRight; - Angles.translation(angle + Mathf.sign(b) * -50f, 3.5f); - float s = 5f; - if(snap){ - Draw.rect(weapon.name, (int)x + Angles.x(), (int)y + Angles.y(), s, s, angle- 90); - }else{ - Draw.rect(weapon.name, x + Angles.x(), y + Angles.y(), s, s, angle - 90); - } - } - } + Graphics.flush(); } @Override @@ -250,4 +258,8 @@ public class Player extends SyncEntity{ y = Mathf.lerpDelta(y, i.target.y, 0.4f); angle = Mathf.lerpAngDelta(angle, i.targetrot, 0.6f); } + + public Color getColor(){ + return NetCommon.colorArray[id % NetCommon.colorArray.length]; + } } diff --git a/core/src/io/anuke/mindustry/io/Platform.java b/core/src/io/anuke/mindustry/io/Platform.java index e51fe1a177..ca2ae7c48e 100644 --- a/core/src/io/anuke/mindustry/io/Platform.java +++ b/core/src/io/anuke/mindustry/io/Platform.java @@ -26,4 +26,5 @@ public abstract class Platform { public boolean canJoinGame(){ return true; } + public boolean isDebug(){return false;} } diff --git a/core/src/io/anuke/mindustry/net/Net.java b/core/src/io/anuke/mindustry/net/Net.java index ba6fd11fc3..8cb50dc70b 100644 --- a/core/src/io/anuke/mindustry/net/Net.java +++ b/core/src/io/anuke/mindustry/net/Net.java @@ -5,11 +5,13 @@ import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.IntMap; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.reflect.ClassReflection; +import io.anuke.mindustry.io.Platform; import io.anuke.mindustry.net.Packet.ImportantPacket; import io.anuke.mindustry.net.Packets.KickReason; import io.anuke.mindustry.net.Streamable.StreamBegin; import io.anuke.mindustry.net.Streamable.StreamBuilder; import io.anuke.mindustry.net.Streamable.StreamChunk; +import io.anuke.ucore.core.Timers; import io.anuke.ucore.function.BiConsumer; import io.anuke.ucore.function.Consumer; import io.anuke.ucore.util.Log; @@ -51,6 +53,8 @@ public class Net{ clientProvider.connect(ip, port); active = true; server = false; + + Timers.runTask(60f, Platform.instance::updateRPC); } /**Host a server at an address*/ @@ -58,6 +62,8 @@ public class Net{ serverProvider.host(port); active = true; server = true; + + Timers.runTask(60f, Platform.instance::updateRPC); } /**Closes the server.*/ diff --git a/core/src/io/anuke/mindustry/net/NetworkIO.java b/core/src/io/anuke/mindustry/net/NetworkIO.java index a8bae0b5e1..5efe3634b4 100644 --- a/core/src/io/anuke/mindustry/net/NetworkIO.java +++ b/core/src/io/anuke/mindustry/net/NetworkIO.java @@ -22,6 +22,7 @@ public class NetworkIO { public static void writeMap(Map map, OutputStream os){ try(DataOutputStream stream = new DataOutputStream(os)){ + stream.writeUTF(map.name); stream.writeBoolean(map.oreGen); stream.writeShort(map.getWidth()); @@ -65,6 +66,7 @@ public class NetworkIO { public static Map loadMap(InputStream is){ try(DataInputStream stream = new DataInputStream(is)){ + String name = stream.readUTF(); boolean ores = stream.readBoolean(); short width = stream.readShort(); @@ -85,11 +87,11 @@ public class NetworkIO { } Map map = new Map(); + map.name = name; map.oreGen = ores; map.custom = true; map.pixmap = pixmap; map.visible = false; - map.name = "network map"; map.id = -1; return map; diff --git a/core/src/io/anuke/mindustry/resource/Weapon.java b/core/src/io/anuke/mindustry/resource/Weapon.java index 271ad6a300..e8c3940fb2 100644 --- a/core/src/io/anuke/mindustry/resource/Weapon.java +++ b/core/src/io/anuke/mindustry/resource/Weapon.java @@ -20,6 +20,7 @@ public class Weapon extends Upgrade{ blaster = new Weapon("blaster", 12, BulletType.shot){ { effect = Fx.laserShoot; + length = 2f; } }, triblaster = new Weapon("triblaster", 16, BulletType.spread){ @@ -63,6 +64,7 @@ public class Weapon extends Upgrade{ roundrobin = true; shots = 7; inaccuracy = 15f; + length = 3.5f; } }; /**weapon reload in frames*/ @@ -81,6 +83,8 @@ public class Weapon extends Upgrade{ float shake = 0f; /**effect displayed when shooting*/ Effect effect; + /**shoot barrel length*/ + float length = 3f; /**whether to shoot the weapons in different arms one after another, rather an all at once*/ boolean roundrobin = false; @@ -96,7 +100,7 @@ public class Weapon extends Upgrade{ Timers.reset(p, "reload" + !left, reload/2f); } float ang = Angles.mouseAngle(p.x, p.y); - Angles.translation(ang + Mathf.sign(left) * -60f, 3f); + Angles.vector.set(3f * Mathf.sign(left), length).rotate(ang - 90); shoot(p, p.x + Angles.x(), p.y + Angles.y(), Angles.mouseAngle(p.x + Angles.x(), p.y + Angles.y())); } } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java index 82809c2032..d20f880c8a 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -8,6 +8,7 @@ import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.net.Net; import io.anuke.ucore.core.Core; +import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Settings; import io.anuke.ucore.function.Consumer; import io.anuke.ucore.scene.ui.Image; @@ -114,6 +115,13 @@ public class SettingsMenuDialog extends SettingsDialog{ graphics.checkPref("fps", false); graphics.checkPref("vsync", true, b -> Gdx.graphics.setVSync(b)); + graphics.checkPref("fullscreen", false, b -> { + if(b){ + Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + }else{ + Gdx.graphics.setWindowedMode(600, 480); + } + }); graphics.checkPref("lasers", true); graphics.checkPref("indicators", true); graphics.checkPref("healthbars", true); @@ -122,14 +130,21 @@ public class SettingsMenuDialog extends SettingsDialog{ renderer.pixelSurface.setScale(Core.cameraScale); renderer.shadowSurface.setScale(Core.cameraScale); renderer.shieldSurface.setScale(Core.cameraScale); + Graphics.getEffects1().setScale(Core.cameraScale); + Graphics.getEffects2().setScale(Core.cameraScale); }else{ renderer.shadowSurface.setScale(1); renderer.shieldSurface.setScale(1); + Graphics.getEffects1().setScale(1); + Graphics.getEffects2().setScale(1); } renderer.setPixelate(b); }); Gdx.graphics.setVSync(Settings.getBool("vsync")); + if(!gwt && Settings.getBool("fullscreen")){ + Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + } } private void back(){ diff --git a/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java b/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java index fe5257523c..1e8a6dda1e 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java @@ -57,6 +57,8 @@ public class DebugFragment implements Fragment { row(); new button("spawn", () -> new Enemy(EnemyTypes.standard).set(player.x, player.y).add()); row(); + new button("stuff", () -> netClient.test()); + row(); }}.end(); row(); @@ -102,16 +104,23 @@ public class DebugFragment implements Fragment { }}.end(); } + public static void printDebugInfo(){ + Gdx.app.error("Minudstry Info Dump", debugInfo()); + } + public static String debugInfo(){ return join( "net.active: " + Net.active(), "net.server: " + Net.server(), - Net.client() ? "chat.open: " + ui.chatfrag.chatOpen() : "", - Net.client() ? "chat.messages: " + ui.chatfrag.getMessagesSize() : "", + Net.client() ? + "chat.open: " + ui.chatfrag.chatOpen() + "\n" + + "chat.messages: " + ui.chatfrag.getMessagesSize() + "\n" + + "client.connecting: " + netClient.isConnecting() + "\n" + + "client.hasdata: " + netClient.hasData() : "", "players: " + playerGroup.size(), "enemies: " + enemyGroup.size(), "tiles: " + tileGroup.size(), - world.getCore() != null ? "core.health: " + world.getCore().entity.health : "", + world.getCore() != null && world.getCore().entity != null ? "core.health: " + world.getCore().entity.health : "", "", !Net.server() ? clientDebug.getOut() : serverDebug.getOut() ); diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index 4f46d6bbf8..41b76e3c8a 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -63,6 +63,7 @@ public class HudFragment implements Fragment{ }).get(); new imagebutton("icon-pause", isize, () -> { + if(android) DebugFragment.printDebugInfo(); if (Net.active() && android) { ui.listfrag.visible = !ui.listfrag.visible; } else { diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index 4751731a93..b431c606ba 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -18,7 +18,7 @@ public class DesktopLauncher { config.setWindowedMode(960, 540); config.setWindowIcon("sprites/icon.png"); - Platform.instance = new DesktopPlatform(); + Platform.instance = new DesktopPlatform(arg); Net.setClientProvider(new KryoClient()); Net.setServerProvider(new KryoServer()); diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopPlatform.java b/desktop/src/io/anuke/mindustry/desktop/DesktopPlatform.java index 8bdb6597e2..7962856ec3 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopPlatform.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopPlatform.java @@ -3,7 +3,6 @@ package io.anuke.mindustry.desktop; import club.minnced.discord.rpc.DiscordEventHandlers; import club.minnced.discord.rpc.DiscordRPC; import club.minnced.discord.rpc.DiscordRichPresence; -import static io.anuke.mindustry.Vars.*; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.io.Platform; import io.anuke.mindustry.net.Net; @@ -16,14 +15,15 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; -import static io.anuke.mindustry.Vars.state; -import static io.anuke.mindustry.Vars.world; +import static io.anuke.mindustry.Vars.*; public class DesktopPlatform extends Platform { DateFormat format = SimpleDateFormat.getDateTimeInstance(); DiscordRPC lib = DiscordRPC.INSTANCE; + String[] args; - public DesktopPlatform(){ + public DesktopPlatform(String[] args){ + this.args = args; String applicationId = "398246104468291591"; DiscordEventHandlers handlers = new DiscordEventHandlers(); @@ -80,4 +80,9 @@ public class DesktopPlatform extends Platform { public void onGameExit() { lib.Discord_Shutdown(); } + + @Override + public boolean isDebug() { + return args.length > 0 && args[0].equalsIgnoreCase("-debug"); + } }