|
| 1 | +/* |
| 2 | + * Copyright (c) 2014-2026 Wurst-Imperium and contributors. |
| 3 | + * |
| 4 | + * This source code is subject to the terms of the GNU General Public |
| 5 | + * License, version 3. If a copy of the GPL was not distributed with this |
| 6 | + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt |
| 7 | + */ |
| 8 | +package net.wurstclient.hacks; |
| 9 | + |
| 10 | +import net.wurstclient.Category; |
| 11 | +import net.wurstclient.SearchTags; |
| 12 | +import net.wurstclient.hack.Hack; |
| 13 | +import net.wurstclient.settings.CheckboxSetting; |
| 14 | +import net.wurstclient.settings.SliderSetting; |
| 15 | +import net.wurstclient.settings.SliderSetting.ValueDisplay; |
| 16 | + |
| 17 | +@SearchTags({"ui settings", "chat overlay", "hud", "client chat"}) |
| 18 | +public final class ClientChatOverlayHack extends Hack |
| 19 | +{ |
| 20 | + private final SliderSetting transparency = |
| 21 | + new SliderSetting("Transparency", 35, 0, 100, 1, ValueDisplay.INTEGER); |
| 22 | + private final SliderSetting fadeOutTimeSeconds = |
| 23 | + new SliderSetting("Fade-out time", 10, 1, 60, 1, ValueDisplay.INTEGER); |
| 24 | + private final CheckboxSetting routeToConsole = |
| 25 | + new CheckboxSetting("Route to game console", false); |
| 26 | + private final CheckboxSetting onlyWurstMessages = |
| 27 | + new CheckboxSetting("Only Wurst messages", false); |
| 28 | + private final SliderSetting maxLines = |
| 29 | + new SliderSetting("Max lines", 10, 3, 30, 1, ValueDisplay.INTEGER); |
| 30 | + private final SliderSetting hudOffsetX = new SliderSetting("HUD X offset", |
| 31 | + 0, -320, 320, 1, ValueDisplay.INTEGER); |
| 32 | + private final SliderSetting hudOffsetY = new SliderSetting("HUD Y offset", |
| 33 | + 0, -240, 240, 1, ValueDisplay.INTEGER); |
| 34 | + |
| 35 | + public ClientChatOverlayHack() |
| 36 | + { |
| 37 | + super("ClientChatOverlay"); |
| 38 | + setCategory(Category.OTHER); |
| 39 | + addSetting(transparency); |
| 40 | + addSetting(fadeOutTimeSeconds); |
| 41 | + addSetting(routeToConsole); |
| 42 | + addSetting(onlyWurstMessages); |
| 43 | + addSetting(maxLines); |
| 44 | + addSetting(hudOffsetX); |
| 45 | + addSetting(hudOffsetY); |
| 46 | + } |
| 47 | + |
| 48 | + public int getTransparencyPercent() |
| 49 | + { |
| 50 | + return transparency.getValueI(); |
| 51 | + } |
| 52 | + |
| 53 | + public long getFadeOutTimeMs() |
| 54 | + { |
| 55 | + return fadeOutTimeSeconds.getValueI() * 1000L; |
| 56 | + } |
| 57 | + |
| 58 | + public boolean isRoutingToConsole() |
| 59 | + { |
| 60 | + return routeToConsole.isChecked(); |
| 61 | + } |
| 62 | + |
| 63 | + public boolean isOnlyWurstMessages() |
| 64 | + { |
| 65 | + return onlyWurstMessages.isChecked(); |
| 66 | + } |
| 67 | + |
| 68 | + public int getMaxLines() |
| 69 | + { |
| 70 | + return maxLines.getValueI(); |
| 71 | + } |
| 72 | + |
| 73 | + public int getHudOffsetX() |
| 74 | + { |
| 75 | + return hudOffsetX.getValueI(); |
| 76 | + } |
| 77 | + |
| 78 | + public int getHudOffsetY() |
| 79 | + { |
| 80 | + return hudOffsetY.getValueI(); |
| 81 | + } |
| 82 | + |
| 83 | + public void setHudOffsets(int x, int y) |
| 84 | + { |
| 85 | + hudOffsetX.setValue(x); |
| 86 | + hudOffsetY.setValue(y); |
| 87 | + } |
| 88 | +} |
0 commit comments