mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-13 12:16:53 +07:00
Minimap switched to container
This commit is contained in:
parent
982f9ce8fb
commit
fefdad5335
@ -24,7 +24,7 @@ allprojects{
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.9'
|
||||
roboVMVersion = '2.3.0'
|
||||
uCoreVersion = '5871d2d0385370bc937fed3e5e301d6962a50476'
|
||||
uCoreVersion = '7ffeb2a9c754f4d31ca13e02dd857876b0707dc5'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
|
@ -9,20 +9,16 @@ import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.scene.Element;
|
||||
import io.anuke.ucore.scene.event.InputEvent;
|
||||
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.*;
|
||||
|
||||
public class Minimap extends Table{
|
||||
public class Minimap extends Container<Element>{
|
||||
|
||||
public Minimap(){
|
||||
super("pane");
|
||||
super(new Element(){
|
||||
TextureRegion r = new TextureRegion();
|
||||
|
||||
margin(5);
|
||||
|
||||
TextureRegion r = new TextureRegion();
|
||||
|
||||
Element elem = new Element(){
|
||||
@Override
|
||||
public void draw(){
|
||||
if(renderer.minimap.getRegion() == null) return;
|
||||
@ -57,7 +53,12 @@ public class Minimap extends Table{
|
||||
renderer.fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
background("pane");
|
||||
|
||||
size(140f);
|
||||
margin(5f);
|
||||
|
||||
addListener(new InputListener(){
|
||||
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);
|
||||
if(e != null && e.isDescendantOf(this)){
|
||||
@ -75,7 +76,5 @@ public class Minimap extends Table{
|
||||
Core.scene.setScrollFocus(null);
|
||||
}
|
||||
});
|
||||
|
||||
add(elem).size(140f, 140f);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user