use of meteordevelopment.meteorclient.gui.WidgetScreen in project meteor-client by MeteorDevelopment.
the class MinecraftClientMixin method onSetScreen.
@Inject(method = "setScreen", at = @At("HEAD"), cancellable = true)
private void onSetScreen(Screen screen, CallbackInfo info) {
if (screen instanceof WidgetScreen)
screen.mouseMoved(mouse.getX() * window.getScaleFactor(), mouse.getY() * window.getScaleFactor());
OpenScreenEvent event = OpenScreenEvent.get(screen);
MeteorClient.EVENT_BUS.post(event);
if (event.isCancelled())
info.cancel();
}
use of meteordevelopment.meteorclient.gui.WidgetScreen in project meteor-client by MeteorDevelopment.
the class Fonts method load.
@Init(stage = InitStage.Post)
public static void load() {
if (lastFont.equals(Config.get().font.get()))
return;
File file = new File(FOLDER, Config.get().font + ".ttf");
if (!file.exists()) {
Config.get().font.set(DEFAULT_FONT);
file = new File(FOLDER, Config.get().font + ".ttf");
}
try {
CUSTOM_FONT = new CustomTextRenderer(file);
} catch (Exception ignored) {
Config.get().font.set(DEFAULT_FONT);
file = new File(FOLDER, Config.get().font + ".ttf");
CUSTOM_FONT = new CustomTextRenderer(file);
}
if (mc.currentScreen instanceof WidgetScreen && Config.get().customFont.get()) {
((WidgetScreen) mc.currentScreen).invalidate();
}
lastFont = Config.get().font.get();
}
use of meteordevelopment.meteorclient.gui.WidgetScreen in project meteor-client by MeteorDevelopment.
the class RainbowColors method onTick.
@EventHandler
private static void onTick(TickEvent.Post event) {
GLOBAL.setSpeed(Config.get().rainbowSpeed.get() / 100);
GLOBAL.getNext();
for (Setting<SettingColor> setting : colorSettings) {
if (setting.module == null || setting.module.isActive())
setting.get().update();
}
for (SettingColor color : colors) {
color.update();
}
for (Waypoint waypoint : Waypoints.get()) {
waypoint.color.update();
}
if (mc.currentScreen instanceof WidgetScreen) {
for (SettingGroup group : GuiThemes.get().settings) {
for (Setting<?> setting : group) {
if (setting instanceof ColorSetting)
((SettingColor) setting.get()).update();
}
}
}
for (Runnable listener : listeners) listener.run();
}
Aggregations