use of mathax.client.systems.modules.Modules in project Client by MatHax.
the class Systems method init.
public static void init() {
System<?> config = add(new Config());
config.init();
config.load();
add(new Modules());
add(new Commands());
add(new Friends());
add(new Enemies());
add(new Macros());
add(new Accounts());
add(new Waypoints());
add(new Profiles());
add(new Proxies());
add(new HUD());
MatHax.EVENT_BUS.subscribe(Systems.class);
}
use of mathax.client.systems.modules.Modules in project Client by MatHax.
the class ModulesScreen method createSearch.
protected WWindow createSearch(WContainer c) {
WWindow w = theme.window("Search");
w.id = "search";
if (theme.categoryIcons())
w.beforeHeaderInit = wContainer -> wContainer.add(theme.item(Items.COMPASS.getDefaultStack())).pad(2);
c.add(w);
w.view.scrollOnlyWhenMouseOver = true;
w.view.hasScrollBar = false;
w.view.maxHeight -= 20;
WVerticalList l = theme.verticalList();
WTextBox text = w.add(theme.textBox("")).minWidth(140).expandX().widget();
text.setFocused(true);
text.action = () -> {
l.clear();
createSearchW(l, text.get());
};
text.actionOnEnter = () -> {
Set<Module> modules = Modules.get().searchTitles(text.get());
if (modules.size() != 1)
return;
Module target = modules.iterator().next();
target.toggle();
};
w.add(l).expandX();
createSearchW(l, text.get());
return w;
}
use of mathax.client.systems.modules.Modules in project Client by MatHax.
the class BindsCommand method build.
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
// Modules
List<Module> modules = Modules.get().getAll().stream().filter(module -> module.keybind.isSet()).collect(Collectors.toList());
info("--- Bound Modules ((highlight)%d(default)) ---", modules.size());
for (Module module : modules) {
HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, getTooltip(module));
MutableText text = new LiteralText(module.title).formatted(Formatting.WHITE);
text.setStyle(text.getStyle().withHoverEvent(hoverEvent));
MutableText sep = new LiteralText(" - ");
sep.setStyle(sep.getStyle().withHoverEvent(hoverEvent));
text.append(sep.formatted(Formatting.GRAY));
MutableText key = new LiteralText(module.keybind.toString());
key.setStyle(key.getStyle().withHoverEvent(hoverEvent));
text.append(key.formatted(Formatting.GRAY));
ChatUtils.sendMsg(text);
}
return SINGLE_SUCCESS;
});
}
Aggregations