Minimap switched to container
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ allprojects{
|
|||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.9'
|
gdxVersion = '1.9.9'
|
||||||
roboVMVersion = '2.3.0'
|
roboVMVersion = '2.3.0'
|
||||||
uCoreVersion = '5871d2d0385370bc937fed3e5e301d6962a50476'
|
uCoreVersion = '7ffeb2a9c754f4d31ca13e02dd857876b0707dc5'
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
|
|||||||
@@ -9,20 +9,16 @@ import io.anuke.ucore.graphics.Draw;
|
|||||||
import io.anuke.ucore.scene.Element;
|
import io.anuke.ucore.scene.Element;
|
||||||
import io.anuke.ucore.scene.event.InputEvent;
|
import io.anuke.ucore.scene.event.InputEvent;
|
||||||
import io.anuke.ucore.scene.event.InputListener;
|
import io.anuke.ucore.scene.event.InputListener;
|
||||||
import io.anuke.ucore.scene.ui.layout.Table;
|
import io.anuke.ucore.scene.ui.layout.Container;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class Minimap extends Table{
|
public class Minimap extends Container<Element>{
|
||||||
|
|
||||||
public Minimap(){
|
public Minimap(){
|
||||||
super("pane");
|
super(new Element(){
|
||||||
|
TextureRegion r = new TextureRegion();
|
||||||
|
|
||||||
margin(5);
|
|
||||||
|
|
||||||
TextureRegion r = new TextureRegion();
|
|
||||||
|
|
||||||
Element elem = new Element(){
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
if(renderer.minimap.getRegion() == null) return;
|
if(renderer.minimap.getRegion() == null) return;
|
||||||
@@ -57,7 +53,12 @@ public class Minimap extends Table{
|
|||||||
renderer.fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
|
renderer.fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
|
background("pane");
|
||||||
|
|
||||||
|
size(140f);
|
||||||
|
margin(5f);
|
||||||
|
|
||||||
addListener(new InputListener(){
|
addListener(new InputListener(){
|
||||||
public boolean scrolled(InputEvent event, float x, float y, int amount){
|
public boolean scrolled(InputEvent event, float x, float y, int amount){
|
||||||
@@ -66,7 +67,7 @@ public class Minimap extends Table{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
elem.update(() -> {
|
update(() -> {
|
||||||
|
|
||||||
Element e = Core.scene.hit(Graphics.mouse().x, Graphics.mouse().y, true);
|
Element e = Core.scene.hit(Graphics.mouse().x, Graphics.mouse().y, true);
|
||||||
if(e != null && e.isDescendantOf(this)){
|
if(e != null && e.isDescendantOf(this)){
|
||||||
@@ -75,7 +76,5 @@ public class Minimap extends Table{
|
|||||||
Core.scene.setScrollFocus(null);
|
Core.scene.setScrollFocus(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
add(elem).size(140f, 140f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user