Search in sources :

Example 6 with Frame

use of dev.hypnotic.ui.clickgui2.frame.Frame in project Hypnotic-Client by Hypnotic-Development.

the class ClickGUI method render.

@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
    this.renderBackground(matrices);
    for (Frame frame : frames) {
        frame.setWidth(120);
        frame.render(matrices, mouseX, mouseY);
        frame.updatePosition(mouseX, mouseY);
        frame.updateButtons();
    }
    menuBar.renderMenuBar(matrices, mouseX, mouseY, this.width, this.height);
    super.render(matrices, mouseX, mouseY, delta);
}
Also used : Frame(dev.hypnotic.ui.clickgui2.frame.Frame)

Example 7 with Frame

use of dev.hypnotic.ui.clickgui2.frame.Frame in project Hypnotic-Client by Hypnotic-Development.

the class SaveLoad method save.

public void save() {
    ArrayList<String> toSave = new ArrayList<String>();
    if (ModuleManager.INSTANCE == null || HudManager.INSTANCE == null)
        return;
    for (Mod mod : ModuleManager.INSTANCE.modules) {
        toSave.add("MOD:" + mod.getName() + ":" + mod.isEnabled() + ":" + mod.getKey());
    }
    for (HudModule element : HudManager.INSTANCE.hudModules) {
        toSave.add("HUD:" + element.getName() + ":" + element.getX() + ":" + element.getY());
    }
    for (Friend friend : FriendManager.INSTANCE.friends) {
        toSave.add("FRIEND:" + friend.name);
    }
    for (Frame frame : ClickGUI.INSTANCE.frames) {
        toSave.add("FRAME:" + frame.name + ":" + frame.getX() + ":" + frame.getY() + ":" + frame.isExtended());
    }
    toSave.add("FRAME:" + HudEditorScreen.INSTANCE.frame.name + ":" + HudEditorScreen.INSTANCE.frame.getX() + ":" + HudEditorScreen.INSTANCE.frame.getY() + ":" + HudEditorScreen.INSTANCE.frame.isExtended());
    toSave.add("CLICKGUI:X:" + dev.hypnotic.ui.clickgui.ClickGUI.INSTANCE.x + ":Y:" + dev.hypnotic.ui.clickgui.ClickGUI.INSTANCE.y);
    for (Waypoint waypoint : WaypointManager.INSTANCE.waypoints) {
        toSave.add("WAYPOINT:NAME:" + waypoint.getName() + ":X:" + waypoint.getX() + ":Y:" + waypoint.getY() + ":Z:" + waypoint.getZ());
    }
    try {
        PrintWriter pw = new PrintWriter(this.dataFile);
        for (String str : toSave) {
            pw.println(str);
        }
        pw.close();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
}
Also used : Frame(dev.hypnotic.ui.clickgui2.frame.Frame) Mod(dev.hypnotic.module.Mod) Friend(dev.hypnotic.config.friends.Friend) ArrayList(java.util.ArrayList) FileNotFoundException(java.io.FileNotFoundException) Waypoint(dev.hypnotic.waypoint.Waypoint) HudModule(dev.hypnotic.module.hud.HudModule) PrintWriter(java.io.PrintWriter)

Example 8 with Frame

use of dev.hypnotic.ui.clickgui2.frame.Frame in project service-proxy by membrane.

the class FrameSender method getNextFrame.

private Frame getNextFrame() {
    Frame frame = queue.poll();
    if (frame != null) {
        totalBufferedFrames.decrementAndGet();
        return frame;
    }
    // TODO: implement prioritization logic
    for (StreamInfo streamInfo : streams.values()) {
        frame = streamInfo.getDataFramesToBeSent().poll();
        if (frame != null) {
            streamInfo.getBufferedDataFrames().release();
            totalBufferedFrames.decrementAndGet();
            return frame;
        }
    }
    return null;
}
Also used : Frame(com.predic8.membrane.core.transport.http2.frame.Frame) HeadersFrame(com.predic8.membrane.core.transport.http2.frame.HeadersFrame)

Example 9 with Frame

use of dev.hypnotic.ui.clickgui2.frame.Frame in project service-proxy by membrane.

the class FrameSender method waitForNextFrame.

private Frame waitForNextFrame() throws InterruptedException {
    // TODO: improve waiting logic
    Thread.sleep(100);
    Frame frame = getNextFrame();
    return frame;
}
Also used : Frame(com.predic8.membrane.core.transport.http2.frame.Frame) HeadersFrame(com.predic8.membrane.core.transport.http2.frame.HeadersFrame)

Example 10 with Frame

use of dev.hypnotic.ui.clickgui2.frame.Frame in project service-proxy by membrane.

the class Http2Logic method handle.

public void handle() throws IOException, EndOfStreamException {
    try {
        while (receiving) {
            Frame frame = new Frame(ourSettings);
            frame.read(srcIn);
            handleFrame(frame);
        }
    } catch (EOFException eof) {
        throw new EndOfStreamException("");
    } finally {
        sender.stop();
    }
}
Also used : Frame(com.predic8.membrane.core.transport.http2.frame.Frame) SettingsFrame(com.predic8.membrane.core.transport.http2.frame.SettingsFrame) EndOfStreamException(com.predic8.membrane.core.util.EndOfStreamException)

Aggregations

Frame (com.predic8.membrane.core.transport.http2.frame.Frame)9 HeadersFrame (com.predic8.membrane.core.transport.http2.frame.HeadersFrame)4 ArrayList (java.util.ArrayList)4 Frame (dev.hypnotic.ui.clickgui2.frame.Frame)3 SettingsFrame (com.predic8.membrane.core.transport.http2.frame.SettingsFrame)2 Friend (dev.hypnotic.config.friends.Friend)2 Mod (dev.hypnotic.module.Mod)2 Waypoint (dev.hypnotic.waypoint.Waypoint)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 Message (com.predic8.membrane.core.http.Message)1 Request (com.predic8.membrane.core.http.Request)1 Response (com.predic8.membrane.core.http.Response)1 AbstractHttpHandler.generateErrorResponse (com.predic8.membrane.core.transport.http.AbstractHttpHandler.generateErrorResponse)1 DataFrame (com.predic8.membrane.core.transport.http2.frame.DataFrame)1 EndOfStreamException (com.predic8.membrane.core.util.EndOfStreamException)1 HeaderListener (com.twitter.hpack.HeaderListener)1 HudModule (dev.hypnotic.module.hud.HudModule)1 ModuleButton (dev.hypnotic.ui.clickgui.ModuleButton)1 BufferedReader (java.io.BufferedReader)1