Skip to content

Commit

Permalink
TpsGraphComponent: Add shift and control modifiers to modify timer delay
Browse files Browse the repository at this point in the history
  • Loading branch information
uoil committed Dec 24, 2020
1 parent 6e2f362 commit 5ceb722
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.math.Vec2f;
import org.lwjgl.input.Keyboard;

import java.awt.*;
import java.text.DecimalFormat;
Expand Down Expand Up @@ -114,9 +115,15 @@ public void render(int mouseX, int mouseY, float partialTicks) {
public void mouseRelease(int mouseX, int mouseY, int button) {
super.mouseRelease(mouseX, mouseY, button);
if (this.isMouseInside(mouseX, mouseY) && button == 1/* right click */) {
this.timerDelay -= 100.0f;
if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) {
this.timerDelay += 100.0f;
} else if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
this.timerDelay -= 10.0f;
} else {
this.timerDelay -= 100.0f;
}

if (this.timerDelay <= 0.0f)
if (this.timerDelay <= 0.0f || this.timerDelay > 1000.0f)
this.timerDelay = 1000.0f;
}
}
Expand Down

0 comments on commit 5ceb722

Please sign in to comment.