use of mathax.client.gui.widgets.containers.WHorizontalList in project Client by MatHax.
the class WPlaybackControls method add.
@Override
public void add(WTable parent, MusicTab.MusicScreen screen, GuiTheme theme) {
WHorizontalList list = parent.add(theme.horizontalList()).widget();
WButton pauseButton = list.add(theme.button(Music.player.isPaused() ? "Resume" : "Pause")).widget();
pauseButton.action = () -> {
if (Music.player.isPaused()) {
Music.trackScheduler.setPaused(false);
pauseButton.set("Pause");
} else {
Music.trackScheduler.setPaused(true);
pauseButton.set("Resume");
}
};
if (Music.trackScheduler.hasNext()) {
list.add(theme.button("Shuffle")).widget().action = () -> {
Collections.shuffle(Music.trackScheduler.tracks);
screen.construct();
};
list.add(theme.button("Clear")).widget().action = () -> {
Music.trackScheduler.tracks.clear();
screen.construct();
};
}
list.add(theme.button("Playlists")).widget().action = () -> {
mc.setScreen(new PlaylistsScreen(theme, screen));
};
String duration;
AudioTrack current = Music.player.getPlayingTrack();
if (current == null)
duration = "Not playing";
else
duration = Music.getTime();
list.add(theme.label("Duration: " + duration)).right();
parent.row();
super.add(parent, screen, theme);
}
use of mathax.client.gui.widgets.containers.WHorizontalList in project Client by MatHax.
the class CapesModule method getWidget.
// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
WHorizontalList w = theme.horizontalList();
WButton reload = w.add(theme.button("Reload")).widget();
reload.action = () -> {
if (isActive())
Capes.init();
};
w.add(theme.label("Reloads the capes."));
return w;
}
use of mathax.client.gui.widgets.containers.WHorizontalList in project Client by MatHax.
the class FakePlayer method getWidget.
// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
WHorizontalList w = theme.horizontalList();
WButton spawn = w.add(theme.button("Spawn")).widget();
spawn.action = () -> {
if (isActive())
FakePlayerManager.add(name.get(), health.get(), copyInv.get());
};
WButton clear = w.add(theme.button("Clear")).widget();
clear.action = () -> {
if (isActive())
FakePlayerManager.clear();
};
return w;
}
use of mathax.client.gui.widgets.containers.WHorizontalList in project Client by MatHax.
the class Marker method fillList.
protected void fillList(GuiTheme theme, WVerticalList list) {
// Marker List
for (BaseMarker marker : markers) {
WHorizontalList hList = list.add(theme.horizontalList()).expandX().widget();
// Name
WLabel label = hList.add(theme.label(marker.name.get())).widget();
label.tooltip = marker.description.get();
// Dimension
hList.add(theme.label(" - " + marker.getDimension().toString())).expandX().widget().color = theme.textSecondaryColor();
// Toggle
WCheckbox checkbox = hList.add(theme.checkbox(marker.isActive())).widget();
checkbox.action = () -> {
if (marker.isActive() != checkbox.checked)
marker.toggle();
};
// Edit
WButton edit = hList.add(theme.button(GuiRenderer.EDIT)).widget();
edit.action = () -> mc.setScreen(marker.getScreen(theme));
// Remove
WMinus remove = hList.add(theme.minus()).widget();
remove.action = () -> {
markers.remove(marker);
marker.settings.unregisterColorSettings();
list.clear();
fillList(theme, list);
};
}
// Bottom
WHorizontalList bottom = list.add(theme.horizontalList()).expandX().widget();
WDropdown<String> newMarker = bottom.add(theme.dropdown(factory.getNames(), factory.getNames()[0])).widget();
WButton add = bottom.add(theme.button("Add")).expandX().widget();
add.action = () -> {
String name = newMarker.get();
markers.add(factory.createMarker(name));
list.clear();
fillList(theme, list);
};
}
use of mathax.client.gui.widgets.containers.WHorizontalList in project Client by MatHax.
the class Timer method getWidget.
// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
if (Modules.get().get(TPSSync.class).isActive()) {
WHorizontalList list = theme.horizontalList();
list.add(theme.label("Multiplier is overwritten by TPSSync."));
WButton disableBtn = list.add(theme.button("Disable TPSSync")).widget();
disableBtn.action = () -> {
TPSSync tpsSync = Modules.get().get(TPSSync.class);
if (tpsSync.isActive())
tpsSync.toggle();
list.visible = false;
};
return list;
}
return null;
}
Aggregations