mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09:27 +02:00
update mindow
This commit is contained in:
@@ -229,10 +229,10 @@ public class UnitWindow extends Window {
|
|||||||
Draw.color(Color.white);
|
Draw.color(Color.white);
|
||||||
Draw.alpha(parentAlpha * color.a);
|
Draw.alpha(parentAlpha * color.a);
|
||||||
BarInfo.BarData data = BarInfo.data.get(index);
|
BarInfo.BarData data = BarInfo.data.get(index);
|
||||||
getDrawable().draw(x, y, width, height);
|
data.icon.draw(x, y, width, height);
|
||||||
if (!hasMouse() && ScissorStack.push(Tmp.r1.set(ScissorStack.peek().x + x, ScissorStack.peek().y + y, width, height * data.number))) {
|
if (!hasMouse() && ScissorStack.push(Tmp.r1.set(ScissorStack.peek().x + x, ScissorStack.peek().y + y, width, height * data.number))) {
|
||||||
Draw.color(data.color);
|
Draw.color(data.color);
|
||||||
getDrawable().draw(x, y, width, height);
|
data.icon.draw(x, y, width, height);
|
||||||
ScissorStack.pop();
|
ScissorStack.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,7 +245,7 @@ public class UnitWindow extends Window {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exit(InputEvent event, float x, float y, int pointer, Element fromActor){
|
public void exit(InputEvent event, float x, float y, int pointer, Element fromActor){
|
||||||
icon.setDrawable(BarInfo.data.get(index).icon);
|
icon.setDrawable(BarInfo.data.size >= index ? Icon.none : BarInfo.data.get(index).icon);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
icon.clicked(()->{
|
icon.clicked(()->{
|
||||||
|
|||||||
@@ -44,6 +44,14 @@ public class Window extends Table {
|
|||||||
id = WindowManager.register(this);
|
id = WindowManager.register(this);
|
||||||
|
|
||||||
visible(() -> shown);
|
visible(() -> shown);
|
||||||
|
|
||||||
|
update(() -> {
|
||||||
|
if(x > Core.graphics.getWidth() - getWidth()/2) setPosition(Core.graphics.getWidth() - getWidth()/2, y);
|
||||||
|
else if(x < -getWidth()/2) setPosition(-getWidth()/2, y);
|
||||||
|
|
||||||
|
if(y > Core.graphics.getHeight() - getHeight()/2) setPosition(x, Core.graphics.getHeight() - getHeight()/2);
|
||||||
|
else if(y < -getHeight()/2) setPosition(x, -getHeight()/2);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void build(Table t){
|
protected void build(Table t){
|
||||||
|
|||||||
Reference in New Issue
Block a user