use of mathax.client.gui.widgets.containers.WTable in project Client by MatHax.
the class InteractionMenu method getWidget.
// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
WTable table = theme.table();
fillTable(theme, table);
return table;
}
use of mathax.client.gui.widgets.containers.WTable in project Client by MatHax.
the class WCurrentTracksView method add.
@Override
public void add(WTable parent, MusicTab.MusicScreen screen, GuiTheme theme) {
currentTrack = Music.player.getPlayingTrack();
parent.row();
WTable currentTracks = parent.add(theme.section("Current tracks")).expandX().widget().add(theme.table()).expandX().widget();
super.add(currentTracks, screen, theme);
}
use of mathax.client.gui.widgets.containers.WTable in project Client by MatHax.
the class WSearchBar method add.
@Override
public void add(WTable parent, MusicTab.MusicScreen screen, GuiTheme theme) {
WTextBox box = parent.add(theme.textBox("")).expandX().widget();
parent.add(theme.button("Search")).widget().action = () -> SearchUtils.search(box.get(), playlist -> mc.setScreen(new PlaylistViewScreen(theme, playlist, screen)));
super.add(parent, screen, theme);
}
use of mathax.client.gui.widgets.containers.WTable in project Client by MatHax.
the class Notebot method getWidget.
// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
WTable table = theme.table();
// Label
status = table.add(theme.label(getStatus())).expandCellX().widget();
// Pause
WButton pauseBtn = table.add(theme.button(isPlaying ? "Pause" : "Resume")).right().widget();
pauseBtn.action = () -> {
pause();
pauseBtn.set(isPlaying ? "Pause" : "Resume");
status.set(getStatus());
};
// Stop
WButton stop = table.add(theme.button("Stop")).right().widget();
stop.action = this::stop;
table.row();
noSongsFound = true;
try {
Files.list(MatHax.FOLDER.toPath().resolve("Notebot")).forEach(path -> {
if (isValidFile(path)) {
noSongsFound = false;
table.add(theme.label(getFileLabel(path))).expandCellX();
WButton load = table.add(theme.button("Load")).right().widget();
load.action = () -> {
loadSong(path.toFile());
status.set(getStatus());
};
WButton preview = table.add(theme.button("Preview")).right().widget();
preview.action = () -> {
previewSong(path.toFile());
status.set(getStatus());
};
table.row();
}
});
} catch (IOException e) {
table.add(theme.label("Missing \"Notebot\" folder.")).expandCellX();
table.row();
}
if (noSongsFound) {
table.add(theme.label("No songs found.")).expandCellX();
table.row();
WButton guide = table.add(theme.button("Guide")).expandX().widget();
guide.action = () -> Util.getOperatingSystem().open("https://mathaxclient.xyz/Notebot-Guide");
}
return table;
}
Aggregations