mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
init
This commit is contained in:
parent
5397d8426c
commit
12be9647a5
5 changed files with 18 additions and 5 deletions
|
|
@ -455,6 +455,7 @@ steam.error = Failed to initialize Steam services.\nError: {0}
|
|||
editor.showblocks = Show Blocks
|
||||
editor.showterrain = Show Terrain
|
||||
editor.showfloor = Show Floor
|
||||
editor.xray = XRay mode
|
||||
editor.planet = Planet:
|
||||
editor.sector = Sector:
|
||||
editor.seed = Seed:
|
||||
|
|
|
|||
|
|
@ -186,3 +186,4 @@ Iniquit
|
|||
DSFdsfWxp
|
||||
Someone's Shadow
|
||||
buj
|
||||
xxbrainnotfoundxx296
|
||||
|
|
@ -72,9 +72,14 @@ public class EditorRenderer implements Disposable{
|
|||
varying lowp vec4 v_color;
|
||||
varying vec2 v_texCoords;
|
||||
uniform sampler2D u_texture;
|
||||
uniform bool u_xray;
|
||||
|
||||
void main(){
|
||||
gl_FragColor = v_color * texture2D(u_texture, v_texCoords);
|
||||
vec4 color = v_color * texture2D(u_texture, v_texCoords);
|
||||
if(u_xray){
|
||||
color.a *= 0.4;
|
||||
}
|
||||
gl_FragColor = color;
|
||||
}
|
||||
"""
|
||||
);
|
||||
|
|
@ -113,9 +118,11 @@ public class EditorRenderer implements Disposable{
|
|||
|
||||
Draw.proj(Core.camera.mat);
|
||||
|
||||
Draw.shader(Shaders.darkness);
|
||||
Draw.rect(Draw.wrap(renderer.blocks.getShadowBuffer().getTexture()), world.width() * tilesize/2f - tilesize/2f, world.height() * tilesize/2f - tilesize/2f, world.width() * tilesize, -world.height() * tilesize);
|
||||
Draw.shader();
|
||||
if(!editor.xrayMode){
|
||||
Draw.shader(Shaders.darkness);
|
||||
Draw.rect(Draw.wrap(renderer.blocks.getShadowBuffer().getTexture()), world.width() * tilesize/2f - tilesize/2f, world.height() * tilesize/2f - tilesize/2f, world.width() * tilesize, -world.height() * tilesize);
|
||||
Draw.shader();
|
||||
}
|
||||
|
||||
Draw.proj(Tmp.m2);
|
||||
|
||||
|
|
@ -135,6 +142,7 @@ public class EditorRenderer implements Disposable{
|
|||
if(editor.showBuildings){
|
||||
shader.bind();
|
||||
shader.setUniformMatrix4("u_projTrans", Tmp.m1.set(Core.camera.mat).translate(-packPad, -packPad).scale(packWidth, packHeight));
|
||||
shader.setUniformi("u_xray", editor.xrayMode ? 1 : 0);
|
||||
|
||||
for(int x = 0; x < chunks.length; x++){
|
||||
for(int y = 0; y < chunks[0].length; y++){
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class MapEditor{
|
|||
public int rotation;
|
||||
public Block drawBlock = Blocks.stone;
|
||||
public Team drawTeam = Team.sharded;
|
||||
public boolean showTerrain = true, showFloor = true, showBuildings = true;
|
||||
public boolean showTerrain = true, showFloor = true, showBuildings = true, xrayMode = false;
|
||||
|
||||
public boolean isLoading(){
|
||||
return loading;
|
||||
|
|
|
|||
|
|
@ -702,6 +702,9 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||
editor.renderer.recacheTerrain();
|
||||
}).pad(2f).growX().with(Table::left).row();
|
||||
mid.check("@editor.showfloor", editor.showFloor, b -> editor.showFloor = b).pad(2f).growX().with(Table::left).row();
|
||||
mid.check("@editor.xray", editor.xrayMode, b -> {
|
||||
editor.xrayMode = b;
|
||||
}).pad(2f).growX().with(Table::left).row();
|
||||
|
||||
if(!mobile){
|
||||
mid.button("@editor.center", Icon.move, Styles.flatt, view::center).growX().margin(9f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue