Add status indicators

Allow removal of elements from gui containers
This commit is contained in:
johni0702
2015-10-04 21:15:06 +02:00
parent aa3eb463ee
commit fc4dc86355
3 changed files with 19 additions and 0 deletions

View File

@@ -40,6 +40,13 @@ public class GuiReplayOverlay extends AbstractGuiOverlay<GuiReplayOverlay> {
}
}.setSize(Integer.MAX_VALUE, 20);
/**
* This is not used by the replay module itself but may be used by other modules/extras to show
* when they're active.
*/
public final GuiPanel statusIndicatorPanel = new GuiPanel(this).setSize(100, 20)
.setLayout(new HorizontalLayout(HorizontalLayout.Alignment.RIGHT).setSpacing(5));
public GuiReplayOverlay(final ReplayHandler replayHandler) {
this.replayHandler = replayHandler;
@@ -49,6 +56,9 @@ public class GuiReplayOverlay extends AbstractGuiOverlay<GuiReplayOverlay> {
protected void layout(GuiReplayOverlay container, int width, int height) {
pos(topPanel, 10, 10);
size(topPanel, width - 20, 20);
pos(statusIndicatorPanel, width / 2, height - 25);
width(statusIndicatorPanel, width / 2 - 5);
}
});