Search in sources :

Example 1 with WidgetScreen

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();
}
Also used : WidgetScreen(meteordevelopment.meteorclient.gui.WidgetScreen) OpenScreenEvent(meteordevelopment.meteorclient.events.game.OpenScreenEvent)

Example 2 with WidgetScreen

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();
}
Also used : CustomTextRenderer(meteordevelopment.meteorclient.renderer.text.CustomTextRenderer) WidgetScreen(meteordevelopment.meteorclient.gui.WidgetScreen) File(java.io.File) Init(meteordevelopment.meteorclient.utils.Init)

Example 3 with WidgetScreen

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();
}
Also used : ColorSetting(meteordevelopment.meteorclient.settings.ColorSetting) WidgetScreen(meteordevelopment.meteorclient.gui.WidgetScreen) SettingGroup(meteordevelopment.meteorclient.settings.SettingGroup) Waypoint(meteordevelopment.meteorclient.systems.waypoints.Waypoint) EventHandler(meteordevelopment.orbit.EventHandler)

Aggregations

WidgetScreen (meteordevelopment.meteorclient.gui.WidgetScreen)3 File (java.io.File)1 OpenScreenEvent (meteordevelopment.meteorclient.events.game.OpenScreenEvent)1 CustomTextRenderer (meteordevelopment.meteorclient.renderer.text.CustomTextRenderer)1 ColorSetting (meteordevelopment.meteorclient.settings.ColorSetting)1 SettingGroup (meteordevelopment.meteorclient.settings.SettingGroup)1 Waypoint (meteordevelopment.meteorclient.systems.waypoints.Waypoint)1 Init (meteordevelopment.meteorclient.utils.Init)1 EventHandler (meteordevelopment.orbit.EventHandler)1