Author SHA1 Message Date
DarkKronicle b43a42b74f Fixing translations 2021-11-10 14:33:01 -07:00
DarkKronicle 8baa25d9f0 Enforcing up to date acc 2021-11-10 14:29:28 -07:00
DarkKronicle 1a570aa37f Updating configs to ACC 2021-11-10 14:16:34 -07:00
DarkKronicle bf5c4f058f Bumping version 2021-11-08 20:12:44 -07:00
DarkKronicle 85a0132865 Merge branch 'Pablo/PR5' 2021-10-31 21:13:00 -06:00
DarkKronicle 82b28e65df Fixing merge 2021-10-31 21:12:28 -06:00
DarkKronicle 3c24000aa6 Relative width/height for chat windows + reset button 2021-10-31 21:07:24 -06:00
Pablete1234 5eaaa2965e Cleanup & fix remaining bits on vanilla chat integration 2021-11-01 03:52:20 +01:00
DarkKronicle bf1b525861 Merge pull request #3 from DarkKronicle/feature/vanilla_hud_patch
Feature/vanilla hud patch
2021-10-31 15:12:12 -06:00
28 changed files with 798 additions and 1085 deletions

No files matched your search

+3 -7
View File
@@ -1,15 +1,11 @@
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.40
loader_version=0.12.3
mod_version=1.0.1
mod_version=1.0.2
maven_group=io.github.darkkronicle
archives_base_name=AdvancedChatHUD
fabric_api_version=0.41.0+1.17
malilib_version = 0.10.0-dev.26
startParameter.excludedTaskNames=spotlessCheck
org.gradle.jvmargs=-Xmx1G --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
advancedchat_version=1.1.0-beta1
org.gradle.jvmargs=-Xmx1G
advancedchat_version=1.2.0-beta3
@@ -43,8 +43,12 @@ public class HudChatMessage {
}
}
}
if (forward) tabs.add(AdvancedChatHud.MAIN_CHAT_TAB);
for (AbstractChatTab tab : tabs) tab.addNewUnread();
if (forward) {
tabs.add(AdvancedChatHud.MAIN_CHAT_TAB);
}
for (AbstractChatTab tab : tabs) {
tab.addNewUnread();
}
}
public HudChatMessage(ChatMessage message, List<AbstractChatTab> tabs) {
@@ -15,8 +15,8 @@ import io.github.darkkronicle.advancedchatcore.AdvancedChatCore;
import io.github.darkkronicle.advancedchatcore.chat.ChatHistory;
import io.github.darkkronicle.advancedchatcore.chat.ChatScreenSectionHolder;
import io.github.darkkronicle.advancedchatcore.config.gui.GuiConfigHandler;
import io.github.darkkronicle.advancedchathud.config.GuiTabManager;
import io.github.darkkronicle.advancedchathud.config.HudConfigStorage;
import io.github.darkkronicle.advancedchathud.config.gui.GuiTabManager;
import io.github.darkkronicle.advancedchathud.gui.HudSection;
import io.github.darkkronicle.advancedchathud.gui.WindowManager;
import io.github.darkkronicle.advancedchathud.itf.IChatHud;
@@ -1,145 +0,0 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config;
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.GuiListBase;
import fi.dy.masa.malilib.gui.button.ButtonBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.gui.interfaces.ISelectionListener;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.config.gui.GuiConfigHandler;
import java.util.List;
import javax.annotation.Nullable;
public class GuiTabManager extends GuiListBase<ChatTab, WidgetTabEntry, WidgetListTabs>
implements ISelectionListener<ChatTab> {
private List<GuiConfigHandler.TabButton> tabButtons;
public GuiTabManager(List<GuiConfigHandler.TabButton> tabButtons) {
super(10, 60);
this.title = StringUtils.translate("advancedchat.screen.main");
this.tabButtons = tabButtons;
}
@Override
protected WidgetListTabs createListWidget(int listX, int listY) {
return new WidgetListTabs(
listX, listY, this.getBrowserWidth(), this.getBrowserHeight(), null, this);
}
@Override
protected int getBrowserWidth() {
return this.width - 20;
}
@Override
public void initGui() {
super.initGui();
int x = 10;
int y = 26;
int rows = 1;
for (GuiConfigHandler.TabButton tab : tabButtons) {
int newY = this.createButton(tab, y);
if (newY != y) {
rows++;
y = newY;
}
}
this.setListPosition(this.getListX(), 68 + (rows - 1) * 22);
this.reCreateListWidget();
this.getListWidget().refreshEntries();
y += 24;
x = this.width - 10;
x -= this.addButton(x, y, ButtonListener.Type.ADD_TAB) + 2;
x -= this.addButton(x, y, ButtonListener.Type.IMPORT) + 2;
}
private int createButton(GuiConfigHandler.TabButton button, int y) {
this.addButton(button.getButton(), new ButtonListenerConfigTabs(button));
return button.getButton().getY();
}
protected int addButton(int x, int y, ButtonListener.Type type) {
ButtonGeneric button = new ButtonGeneric(x, y, -1, true, type.getDisplayName());
this.addButton(button, new ButtonListener(type, this));
return button.getWidth();
}
private static class ButtonListener implements IButtonActionListener {
private final ButtonListener.Type type;
private final GuiTabManager gui;
public ButtonListener(ButtonListener.Type type, GuiTabManager gui) {
this.type = type;
this.gui = gui;
}
@Override
public void actionPerformedWithButton(ButtonBase button, int mouseButton) {
if (this.type == ButtonListener.Type.ADD_TAB) {
HudConfigStorage.TABS.add(new ChatTab());
this.gui.getListWidget().refreshEntries();
} else if (this.type == Type.IMPORT) {
GuiBase.openGui(new SharingScreen(null, gui));
}
}
public enum Type {
ADD_TAB("addtab"),
IMPORT("import");
private static String translate(String key) {
return "advancedchathud.gui.button." + key;
}
private final String translationKey;
Type(String translationKey) {
this.translationKey = translate(translationKey);
}
public String getDisplayName() {
return StringUtils.translate(this.translationKey);
}
}
}
@Override
protected int getBrowserHeight() {
return this.height - 6 - this.getListY();
}
@Override
public void onSelectionChange(@Nullable ChatTab entry) {}
private static class ButtonListenerConfigTabs implements IButtonActionListener {
private final GuiConfigHandler.TabButton tabButton;
public ButtonListenerConfigTabs(GuiConfigHandler.TabButton tabButton) {
this.tabButton = tabButton;
}
@Override
public void actionPerformedWithButton(ButtonBase button, int mouseButton) {
GuiConfigHandler.getInstance().activeTab = this.tabButton.getTab().getName();
GuiBase.openGui(
this.tabButton.getTab().getScreen(GuiConfigHandler.getInstance().getButtons()));
}
}
}
@@ -122,11 +122,6 @@ public class HudConfigStorage implements IConfigHandler {
"topPad",
new ConfigInteger(translate("toppad"), 0, 0, 20, translate("info.toppad")));
public static final ConfigStorage.SaveableConfig<ConfigBoolean> SHOW_TABS =
ConfigStorage.SaveableConfig.fromConfig(
"showTabs",
new ConfigBoolean(translate("showtabs"), true, translate("info.showtabs")));
public static final ConfigStorage.SaveableConfig<ConfigOptionList> VISIBILITY =
ConfigStorage.SaveableConfig.fromConfig(
"visibility",
@@ -189,12 +184,6 @@ public class HudConfigStorage implements IConfigHandler {
false,
translate("info.alternatelines")));
public static final ConfigStorage.SaveableConfig<ConfigBoolean> SHOW_TIME =
ConfigStorage.SaveableConfig.fromConfig(
"showTime",
new ConfigBoolean(
translate("showtime"), false, translate("info.showtime")));
public static final ConfigStorage.SaveableConfig<ConfigInteger> STORED_LINES =
ConfigStorage.SaveableConfig.fromConfig(
"storedLines",
@@ -220,7 +209,6 @@ public class HudConfigStorage implements IConfigHandler {
RIGHT_PAD,
BOTTOM_PAD,
TOP_PAD,
SHOW_TABS,
VISIBILITY,
CHAT_SCALE,
FADE_TIME,
@@ -229,7 +217,6 @@ public class HudConfigStorage implements IConfigHandler {
EMPTY_TEXT_COLOR,
HUD_LINE_TYPE,
ALTERNATE_LINES,
SHOW_TIME,
STORED_LINES);
}
@@ -1,112 +0,0 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config;
import fi.dy.masa.malilib.gui.GuiListBase;
import fi.dy.masa.malilib.gui.button.ButtonBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.util.FindType;
import io.github.darkkronicle.advancedchathud.AdvancedChatHud;
import net.minecraft.client.gui.screen.Screen;
public class MatchesEditor extends GuiListBase<Match, WidgetMatchEntry, WidgetListMatches> {
private final ChatTab tab;
@Override
public void initGui() {
super.initGui();
this.setListPosition(this.getListX(), 68);
int y = 26;
int x = this.width - 10;
this.addButton(x, y, ButtonListener.Type.ADD_MATCH, true);
this.addButton(2, y, ButtonListener.Type.BACK, false);
}
@Override
protected void closeGui(boolean showParent) {
AdvancedChatHud.MAIN_CHAT_TAB.setUpTabs();
super.closeGui(showParent);
}
protected MatchesEditor(Screen parent, ChatTab tab) {
super(10, 60);
this.title = StringUtils.translate("advancedchathud.config.match.screen.name");
this.tab = tab;
this.setParent(parent);
}
protected int addButton(int x, int y, ButtonListener.Type type, boolean rightAlign) {
ButtonGeneric button = new ButtonGeneric(x, y, -1, rightAlign, type.getDisplayName());
this.addButton(button, new ButtonListener(type, this));
return button.getWidth();
}
@Override
protected WidgetListMatches createListWidget(int listX, int listY) {
return new WidgetListMatches(
listX, listY, this.getBrowserWidth(), this.getBrowserHeight(), null, tab, this);
}
@Override
protected int getBrowserWidth() {
return this.width - 20;
}
@Override
protected int getBrowserHeight() {
return this.height - 6 - this.getListY();
}
public void addMatch() {
tab.getMatches().add(new Match("I will match to text!", FindType.LITERAL));
getListWidget().refreshEntries();
}
public void back() {
this.closeGui(true);
}
private static class ButtonListener implements IButtonActionListener {
private final ButtonListener.Type type;
private final MatchesEditor gui;
public ButtonListener(ButtonListener.Type type, MatchesEditor gui) {
this.type = type;
this.gui = gui;
}
@Override
public void actionPerformedWithButton(ButtonBase button, int mouseButton) {
if (this.type == ButtonListener.Type.ADD_MATCH) {
this.gui.addMatch();
} else if (this.type == ButtonListener.Type.BACK) {
this.gui.back();
}
}
public enum Type {
ADD_MATCH("advancedchathud.gui.button.addmatch"),
BACK("advancedchathud.button.back");
private final String translationKey;
Type(String translationKey) {
this.translationKey = translationKey;
}
public String getDisplayName() {
return StringUtils.translate(this.translationKey);
}
}
}
}
@@ -1,126 +0,0 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParser;
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.GuiTextFieldGeneric;
import fi.dy.masa.malilib.gui.Message;
import fi.dy.masa.malilib.gui.button.ButtonBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchathud.AdvancedChatHud;
import net.minecraft.client.gui.screen.Screen;
/** Screen for importing and exporting {@link ChatTab}. */
public class SharingScreen extends GuiBase {
private final String starting;
private static final Gson GSON = new GsonBuilder().create();
private GuiTextFieldGeneric text;
public SharingScreen(String starting, Screen parent) {
this.setParent(parent);
this.setTitle(StringUtils.translate("advancedchat.gui.menu.import"));
this.starting = starting;
}
/** Creates a SharingScreen from a tab */
public static SharingScreen fromTab(ChatTab tab, Screen parent) {
ChatTab.ChatTabJsonSave tabJsonSave = new ChatTab.ChatTabJsonSave();
return new SharingScreen(GSON.toJson(tabJsonSave.save(tab)), parent);
}
@Override
public void init() {
int x = this.width / 2 - 150;
int y = 50;
text = new GuiTextFieldGeneric(x, y, 300, 20, client.textRenderer);
y -= 24;
text.setMaxLength(12800);
if (starting != null) {
text.setText(starting);
text.setTextFieldFocused(true);
}
text.changeFocus(true);
text.setDrawsBackground(true);
text.setEditable(true);
text.changeFocus(true);
this.addTextField(text, null);
String tabName = ButtonListener.Type.IMPORT_TAB.getDisplayName();
int tabWidth = StringUtils.getStringWidth(tabName) + 10;
this.addButton(
new ButtonGeneric(x, y, tabWidth, 20, tabName),
new ButtonListener(ButtonListener.Type.IMPORT_TAB, this));
}
private static class ButtonListener implements IButtonActionListener {
public enum Type {
IMPORT_TAB("importtab");
public final String translationString;
private static String translate(String key) {
return "advancedchat.gui.button." + key;
}
Type(String key) {
this.translationString = translate(key);
}
public String getDisplayName() {
return StringUtils.translate(translationString);
}
}
private final Type type;
private final SharingScreen parent;
public ButtonListener(Type type, SharingScreen parent) {
this.type = type;
this.parent = parent;
}
@Override
public void actionPerformedWithButton(ButtonBase button, int mouseButton) {
try {
if (parent.text.getText().equals("")) {
throw new NullPointerException("Message can't be blank!");
}
if (type == Type.IMPORT_TAB) {
ChatTab.ChatTabJsonSave tabSave = new ChatTab.ChatTabJsonSave();
ChatTab tab =
tabSave.load(
new JsonParser()
.parse(parent.text.getText())
.getAsJsonObject());
if (tab == null) {
throw new NullPointerException("Filter is null!");
}
HudConfigStorage.TABS.add(tab);
AdvancedChatHud.MAIN_CHAT_TAB.setUpTabs();
parent.addGuiMessage(
Message.MessageType.SUCCESS,
5000,
StringUtils.translate("advancedchat.gui.message.successful"));
}
} catch (Exception e) {
parent.addGuiMessage(
Message.MessageType.ERROR,
10000,
StringUtils.translate("advancedchat.gui.message.error")
+ ": "
+ e.getMessage());
}
}
}
}
@@ -1,93 +0,0 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config;
import fi.dy.masa.malilib.gui.GuiTextFieldGeneric;
import fi.dy.masa.malilib.gui.interfaces.ISelectionListener;
import fi.dy.masa.malilib.gui.widgets.WidgetListBase;
import fi.dy.masa.malilib.gui.wrappers.TextFieldWrapper;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.minecraft.client.gui.screen.Screen;
public class WidgetListMatches extends WidgetListBase<Match, WidgetMatchEntry> {
public final ChatTab tab;
protected final List<TextFieldWrapper<GuiTextFieldGeneric>> textFields = new ArrayList<>();
@Override
protected void reCreateListEntryWidgets() {
textFields.clear();
super.reCreateListEntryWidgets();
}
public void addTextField(TextFieldWrapper<GuiTextFieldGeneric> text) {
textFields.add(text);
}
@Override
public boolean onMouseClicked(int mouseX, int mouseY, int mouseButton) {
clearTextFieldFocus();
return super.onMouseClicked(mouseX, mouseY, mouseButton);
}
protected void clearTextFieldFocus() {
for (TextFieldWrapper<GuiTextFieldGeneric> field : this.textFields) {
GuiTextFieldGeneric textField = field.getTextField();
if (textField.isFocused()) {
textField.setFocused(false);
break;
}
}
}
@Override
public boolean onKeyTyped(int keyCode, int scanCode, int modifiers) {
for (WidgetMatchEntry widget : this.listWidgets) {
if (widget.onKeyTyped(keyCode, scanCode, modifiers)) {
return true;
}
}
return super.onKeyTyped(keyCode, scanCode, modifiers);
}
public WidgetListMatches(
int x,
int y,
int width,
int height,
ISelectionListener<Match> selectionListener,
ChatTab parent,
Screen screen) {
super(x, y, width, height, selectionListener);
this.browserEntryHeight = 22;
this.tab = parent;
this.setParent(screen);
}
@Override
protected WidgetMatchEntry createListEntryWidget(
int x, int y, int listIndex, boolean isOdd, Match entry) {
return new WidgetMatchEntry(
x,
y,
this.browserEntryWidth,
this.getBrowserEntryHeightFor(entry),
isOdd,
entry,
listIndex,
this);
}
@Override
protected Collection<Match> getAllEntries() {
return tab.getMatches();
}
}
@@ -1,222 +0,0 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config;
import com.mojang.blaze3d.systems.RenderSystem;
import fi.dy.masa.malilib.config.options.ConfigOptionList;
import fi.dy.masa.malilib.gui.GuiTextFieldGeneric;
import fi.dy.masa.malilib.gui.button.ButtonBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.ConfigButtonOptionList;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.gui.interfaces.ITextFieldListener;
import fi.dy.masa.malilib.gui.widgets.WidgetBase;
import fi.dy.masa.malilib.gui.widgets.WidgetListEntryBase;
import fi.dy.masa.malilib.gui.wrappers.TextFieldWrapper;
import fi.dy.masa.malilib.render.RenderUtils;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.util.ColorUtil;
import io.github.darkkronicle.advancedchatcore.util.FindType;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.util.math.MatrixStack;
@Environment(EnvType.CLIENT)
public class WidgetMatchEntry extends WidgetListEntryBase<Match> {
private final WidgetListMatches parent;
private final boolean isOdd;
private TextFieldWrapper<GuiTextFieldGeneric> name;
private ConfigOptionList findType =
new ConfigOptionList(
"advancedchathud.config.match.findtype",
FindType.LITERAL,
"advancedchathud.config.match.info.findtype");
public WidgetMatchEntry(
int x,
int y,
int width,
int height,
boolean isOdd,
Match entry,
int listIndex,
WidgetListMatches parent) {
super(x, y, width, height, entry, listIndex);
this.isOdd = isOdd;
this.parent = parent;
y += 1;
int pos = x + width - 2;
int removeWidth = 0;
if (listIndex != 0) {
// Always want one
removeWidth = addButton(pos, y, ButtonListener.Type.REMOVE) + 1;
}
pos -= removeWidth;
int replaceWidth = 100;
int nameWidth = width - replaceWidth - removeWidth;
this.findType.setOptionListValue(entry.getFindType());
ConfigButtonOptionList findType =
new ConfigButtonOptionList(pos - replaceWidth, y, replaceWidth, 20, this.findType);
this.addButton(
findType,
(button, mouseButton) -> {
entry.setFindType((FindType) this.findType.getOptionListValue());
});
pos -= replaceWidth + 1;
GuiTextFieldGeneric nameField =
new GuiTextFieldGeneric(
pos - nameWidth,
y,
nameWidth,
20,
MinecraftClient.getInstance().textRenderer);
nameField.setMaxLength(64000);
nameField.setText(entry.getPattern());
name = new TextFieldWrapper<>(nameField, new SaveListener(this));
parent.addTextField(name);
}
private static class SaveListener implements ITextFieldListener<GuiTextFieldGeneric> {
private final WidgetMatchEntry parent;
public SaveListener(WidgetMatchEntry parent) {
this.parent = parent;
}
@Override
public boolean onTextChange(GuiTextFieldGeneric textField) {
parent.entry.setPattern(textField.getText());
return false;
}
}
protected int addButton(int x, int y, ButtonListener.Type type) {
ButtonGeneric button = new ButtonGeneric(x, y, -1, true, type.getDisplayName());
this.addButton(button, new ButtonListener(type, this));
return button.getWidth() + 1;
}
@Override
protected boolean onKeyTypedImpl(int keyCode, int scanCode, int modifiers) {
if (this.name.isFocused()) {
return this.name.onKeyTyped(keyCode, scanCode, modifiers);
}
return false;
}
@Override
protected boolean onCharTypedImpl(char charIn, int modifiers) {
if (this.name.onCharTyped(charIn, modifiers)) {
return true;
}
return super.onCharTypedImpl(charIn, modifiers);
}
@Override
protected boolean onMouseClickedImpl(int mouseX, int mouseY, int mouseButton) {
if (super.onMouseClickedImpl(mouseX, mouseY, mouseButton)) {
return true;
}
boolean ret = false;
if (this.name != null) {
ret = this.name.getTextField().mouseClicked(mouseX, mouseY, mouseButton);
}
if (!this.subWidgets.isEmpty()) {
for (WidgetBase widget : this.subWidgets) {
ret |=
widget.isMouseOver(mouseX, mouseY)
&& widget.onMouseClicked(mouseX, mouseY, mouseButton);
}
}
return ret;
}
protected void drawTextFields(int mouseX, int mouseY, MatrixStack matrixStack) {
if (this.name != null) {
this.name.getTextField().render(matrixStack, mouseX, mouseY, 0f);
}
}
private static class ButtonListener implements IButtonActionListener {
private final ButtonListener.Type type;
private final WidgetMatchEntry parent;
public ButtonListener(ButtonListener.Type type, WidgetMatchEntry parent) {
this.parent = parent;
this.type = type;
}
@Override
public void actionPerformedWithButton(ButtonBase button, int mouseButton) {
if (type == ButtonListener.Type.REMOVE) {
parent.parent.tab.getMatches().remove(parent.entry);
parent.parent.refreshEntries();
}
}
public enum Type {
REMOVE("remove");
private final String translate;
Type(String name) {
this.translate = translate(name);
}
private static String translate(String key) {
return "advancedchathud.config.match." + key;
}
public String getDisplayName() {
return StringUtils.translate(translate);
}
}
}
@Override
public void render(int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {
RenderUtils.color(1f, 1f, 1f, 1f);
// Draw a lighter background for the hovered and the selected entry
if (selected || this.isMouseOver(mouseX, mouseY)) {
RenderUtils.drawRect(
this.x,
this.y,
this.width,
this.height,
ColorUtil.WHITE.withAlpha(150).color());
} else if (this.isOdd) {
RenderUtils.drawRect(
this.x, this.y, this.width, this.height, ColorUtil.WHITE.withAlpha(70).color());
} else {
RenderUtils.drawRect(
this.x, this.y, this.width, this.height, ColorUtil.WHITE.withAlpha(50).color());
}
RenderUtils.color(1f, 1f, 1f, 1f);
RenderSystem.disableBlend();
this.drawTextFields(mouseX, mouseY, matrixStack);
super.render(mouseX, mouseY, selected, matrixStack);
RenderUtils.disableDiffuseLighting();
}
}
@@ -1,158 +0,0 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config;
import com.mojang.blaze3d.systems.RenderSystem;
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.button.ButtonBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.gui.widgets.WidgetListEntryBase;
import fi.dy.masa.malilib.render.RenderUtils;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.util.ColorUtil;
import io.github.darkkronicle.advancedchathud.AdvancedChatHud;
import java.util.List;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.util.math.MatrixStack;
/*
This class is based heavily off of https://github.com/maruohon/minihud/blob/d565d39c68bdcd3ed1e1cf2007491e03d9659f34/src/main/java/fi/dy/masa/minihud/gui/widgets/WidgetShapeEntry.java#L19 which is off the GNU LGPL
*/
@Environment(EnvType.CLIENT)
public class WidgetTabEntry extends WidgetListEntryBase<ChatTab> {
private final WidgetListTabs parent;
private final boolean isOdd;
private final List<String> hoverLines;
private final int buttonStartX;
private final ChatTab tab;
private boolean main = true;
public WidgetTabEntry(
int x,
int y,
int width,
int height,
boolean isOdd,
ChatTab tab,
int listIndex,
WidgetListTabs parent) {
super(x, y, width, height, tab, listIndex);
this.parent = parent;
this.isOdd = isOdd;
this.hoverLines = tab.getWidgetHoverLines();
this.tab = tab;
y += 1;
int pos = x + width - 2;
if (listIndex != 0) {
main = false;
// If it's 0 it's the main tab
pos -= addButton(pos, y, ButtonListener.Type.REMOVE);
}
pos -= addButton(pos, y, ButtonListener.Type.CONFIGURE);
buttonStartX = pos;
}
protected int addButton(int x, int y, ButtonListener.Type type) {
ButtonGeneric button = new ButtonGeneric(x, y, -1, true, type.getDisplayName());
this.addButton(button, new ButtonListener(type, this));
return button.getWidth() + 1;
}
@Override
public void render(int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {
RenderUtils.color(1f, 1f, 1f, 1f);
// Draw a lighter background for the hovered and the selected entry
if (selected || this.isMouseOver(mouseX, mouseY)) {
RenderUtils.drawRect(
this.x,
this.y,
this.width,
this.height,
ColorUtil.WHITE.withAlpha(150).color());
} else if (this.isOdd) {
RenderUtils.drawRect(
this.x, this.y, this.width, this.height, ColorUtil.WHITE.withAlpha(70).color());
} else {
RenderUtils.drawRect(
this.x, this.y, this.width, this.height, ColorUtil.WHITE.withAlpha(50).color());
}
String name = this.tab.getName().config.getStringValue();
this.drawString(this.x + 4, this.y + 7, ColorUtil.WHITE.color(), name, matrixStack);
RenderUtils.color(1f, 1f, 1f, 1f);
RenderSystem.disableBlend();
super.render(mouseX, mouseY, selected, matrixStack);
RenderUtils.disableDiffuseLighting();
}
@Override
public void postRenderHovered(
int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {
super.postRenderHovered(mouseX, mouseY, selected, matrixStack);
if (mouseX >= this.x
&& mouseX < this.buttonStartX
&& mouseY >= this.y
&& mouseY <= this.y + this.height) {
RenderUtils.drawHoverText(mouseX, mouseY, this.hoverLines, matrixStack);
}
}
private static class ButtonListener implements IButtonActionListener {
private final Type type;
private final WidgetTabEntry parent;
public ButtonListener(Type type, WidgetTabEntry parent) {
this.parent = parent;
this.type = type;
}
@Override
public void actionPerformedWithButton(ButtonBase button, int mouseButton) {
if (type == Type.REMOVE) {
HudConfigStorage.TABS.remove(parent.tab);
parent.parent.refreshEntries();
AdvancedChatHud.MAIN_CHAT_TAB.setUpTabs();
}
if (type == Type.CONFIGURE) {
GuiBase.openGui(
new GuiTabEditor(parent.parent.getParent(), parent.tab, parent.main));
}
}
public enum Type {
CONFIGURE("configure"),
REMOVE("remove");
private final String translate;
Type(String name) {
this.translate = translate(name);
}
private static String translate(String key) {
return "advancedchathud.config.tabmenu." + key;
}
public String getDisplayName() {
return StringUtils.translate(translate);
}
}
}
}
@@ -5,7 +5,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config;
package io.github.darkkronicle.advancedchathud.config.gui;
import fi.dy.masa.malilib.config.IConfigBase;
import fi.dy.masa.malilib.gui.GuiBase;
@@ -17,12 +17,17 @@ import fi.dy.masa.malilib.util.GuiUtils;
import fi.dy.masa.malilib.util.KeyCodes;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.config.ConfigStorage;
import io.github.darkkronicle.advancedchatcore.gui.buttons.BackButtonListener;
import io.github.darkkronicle.advancedchatcore.gui.buttons.Buttons;
import io.github.darkkronicle.advancedchatcore.gui.buttons.NamedSimpleButton;
import io.github.darkkronicle.advancedchatcore.interfaces.IClosable;
import io.github.darkkronicle.advancedchathud.AdvancedChatHud;
import io.github.darkkronicle.advancedchathud.config.ChatTab;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.screen.Screen;
public class GuiTabEditor extends GuiConfigsBase {
public class GuiTabEditor extends GuiConfigsBase implements IClosable {
private final ChatTab tab;
private final boolean main;
@@ -45,27 +50,35 @@ public class GuiTabEditor extends GuiConfigsBase {
}
private void createButtons(int x, int y) {
String backText = ButtonListener.Type.BACK.getDisplayName();
int backWidth = StringUtils.getStringWidth(backText) + 10;
int topx = x;
ButtonGeneric back = new ButtonGeneric(x + backWidth, y, backWidth, true, backText);
this.addButton(back, new ButtonListener(ButtonListener.Type.BACK, this));
topx += back.getWidth() + 2;
ButtonGeneric back = Buttons.BACK.createButton(x, y);
x += this.addButton(back, new BackButtonListener(this)).getWidth() + 2;
if (!main) {
String matchesText = ButtonListener.Type.MATCHES.getDisplayName();
int matchesWidth = StringUtils.getStringWidth(matchesText) + 10;
ButtonGeneric match =
new ButtonGeneric(topx + matchesWidth, y, matchesWidth, true, matchesText);
this.addButton(match, new ButtonListener(ButtonListener.Type.MATCHES, this));
topx += match.getWidth() + 2;
x +=
this.addButton(
x,
y,
"advancedchathud.gui.button.matches",
(button, mouseButton) -> {
save();
GuiBase.openGui(new MatchesEditor(this, tab));
})
+ 2;
}
String exportText = ButtonListener.Type.EXPORT.getDisplayName();
int exportWidth = StringUtils.getStringWidth(exportText) + 10;
ButtonGeneric export =
new ButtonGeneric(topx + exportWidth, y, exportWidth, true, exportText);
this.addButton(export, new ButtonListener(ButtonListener.Type.EXPORT, this));
this.addButton(
x,
y,
"advancedchathud.gui.button.export",
(button, mouseButton) -> {
save();
GuiBase.openGui(SharingScreen.fromTab(tab, this));
});
}
private int addButton(int x, int y, String translation, IButtonActionListener listener) {
return addButton(new NamedSimpleButton(x, y, StringUtils.translate(translation)), listener)
.getWidth();
}
@Override
@@ -101,10 +114,6 @@ public class GuiTabEditor extends GuiConfigsBase {
AdvancedChatHud.MAIN_CHAT_TAB.setUpTabs();
}
public void back() {
closeGui(true);
}
@Override
public boolean onKeyTyped(int keyCode, int scanCode, int modifiers) {
// Override so that on escape stuff still gets saved
@@ -127,47 +136,8 @@ public class GuiTabEditor extends GuiConfigsBase {
}
}
public static class ButtonListener implements IButtonActionListener {
private final GuiTabEditor parent;
private final ButtonListener.Type type;
public ButtonListener(ButtonListener.Type type, GuiTabEditor parent) {
this.type = type;
this.parent = parent;
}
@Override
public void actionPerformedWithButton(ButtonBase button, int mouseButton) {
if (this.type == ButtonListener.Type.BACK) {
parent.back();
} else if (this.type == ButtonListener.Type.EXPORT) {
parent.save();
GuiBase.openGui(SharingScreen.fromTab(parent.tab, parent));
} else if (this.type == Type.MATCHES) {
parent.save();
GuiBase.openGui(new MatchesEditor(parent, parent.tab));
}
}
public enum Type {
BACK("back"),
EXPORT("export"),
MATCHES("matches");
private final String translation;
private static String translate(String key) {
return "advancedchathud.gui.button." + key;
}
Type(String key) {
this.translation = translate(key);
}
public String getDisplayName() {
return StringUtils.translate(translation);
}
}
@Override
public void close(ButtonBase button) {
closeGui(true);
}
}
@@ -0,0 +1,63 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config.gui;
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.config.gui.GuiConfigHandler;
import io.github.darkkronicle.advancedchatcore.gui.ConfigGuiListBase;
import io.github.darkkronicle.advancedchatcore.gui.buttons.NamedSimpleButton;
import io.github.darkkronicle.advancedchathud.config.ChatTab;
import io.github.darkkronicle.advancedchathud.config.HudConfigStorage;
import java.util.List;
public class GuiTabManager extends ConfigGuiListBase<ChatTab, WidgetTabEntry, WidgetListTabs> {
public GuiTabManager(List<GuiConfigHandler.TabButton> tabButtons) {
super(tabButtons);
this.title = StringUtils.translate("advancedchat.screen.main");
}
@Override
protected WidgetListTabs createListWidget(int listX, int listY) {
return new WidgetListTabs(
listX, listY, this.getBrowserWidth(), this.getBrowserHeight(), null, this);
}
@Override
public void initGuiConfig(int x, int y) {
x = this.width - 10;
x -=
this.addButton(
x,
y,
"advancedchathud.gui.button.addtab",
(button, mouseButton) -> {
HudConfigStorage.TABS.add(new ChatTab());
this.getListWidget().refreshEntries();
})
+ 2;
x -=
this.addButton(
x,
y,
"advancedchathud.gui.button.import",
(button, mouseButton) ->
GuiBase.openGui(new SharingScreen(null, this)))
+ 2;
}
protected int addButton(int x, int y, String translation, IButtonActionListener listener) {
ButtonGeneric button =
new NamedSimpleButton(x, y, StringUtils.translate(translation), false);
this.addButton(button, listener);
return button.getWidth();
}
}
@@ -0,0 +1,78 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config.gui;
import fi.dy.masa.malilib.gui.button.ButtonBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.gui.CoreGuiListBase;
import io.github.darkkronicle.advancedchatcore.gui.buttons.BackButtonListener;
import io.github.darkkronicle.advancedchatcore.gui.buttons.Buttons;
import io.github.darkkronicle.advancedchatcore.gui.buttons.NamedSimpleButton;
import io.github.darkkronicle.advancedchatcore.interfaces.IClosable;
import io.github.darkkronicle.advancedchatcore.util.FindType;
import io.github.darkkronicle.advancedchathud.AdvancedChatHud;
import io.github.darkkronicle.advancedchathud.config.ChatTab;
import io.github.darkkronicle.advancedchathud.config.Match;
import net.minecraft.client.gui.screen.Screen;
public class MatchesEditor extends CoreGuiListBase<Match, WidgetMatchEntry, WidgetListMatches>
implements IClosable {
private final ChatTab tab;
protected MatchesEditor(Screen parent, ChatTab tab) {
super(10, 60);
this.title = StringUtils.translate("advancedchathud.config.match.screen.name");
this.tab = tab;
this.setParent(parent);
}
@Override
public void initGui() {
super.initGui();
int y = 26;
int x = this.width - 10;
this.addButton(
x,
y,
"advancedchathud.gui.button.addmatch",
(button, mouseButton) -> this.addMatch());
this.addButton(Buttons.BACK.createButton(2, y), new BackButtonListener(this));
}
protected void addButton(int x, int y, String translation, IButtonActionListener listener) {
ButtonGeneric button =
new NamedSimpleButton(x, y, StringUtils.translate(translation), false);
// Right aline
this.addButton(button, listener);
}
@Override
protected void closeGui(boolean showParent) {
AdvancedChatHud.MAIN_CHAT_TAB.setUpTabs();
super.closeGui(showParent);
}
@Override
protected WidgetListMatches createListWidget(int listX, int listY) {
return new WidgetListMatches(
listX, listY, this.getBrowserWidth(), this.getBrowserHeight(), null, tab, this);
}
public void addMatch() {
tab.getMatches().add(new Match("I will match to text!", FindType.LITERAL));
getListWidget().refreshEntries();
}
@Override
public void close(ButtonBase button) {
this.closeGui(true);
}
}
@@ -0,0 +1,82 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config.gui;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParser;
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.GuiTextFieldGeneric;
import fi.dy.masa.malilib.gui.Message;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.gui.buttons.NamedSimpleButton;
import io.github.darkkronicle.advancedchathud.AdvancedChatHud;
import io.github.darkkronicle.advancedchathud.config.ChatTab;
import io.github.darkkronicle.advancedchathud.config.HudConfigStorage;
import net.minecraft.client.gui.screen.Screen;
/** Screen for importing and exporting {@link ChatTab}. */
public class SharingScreen extends GuiBase {
private final String starting;
private static final Gson GSON = new GsonBuilder().create();
private GuiTextFieldGeneric text;
public SharingScreen(String starting, Screen parent) {
this.setParent(parent);
this.setTitle(StringUtils.translate("advancedchat.gui.menu.import"));
this.starting = starting;
}
/** Creates a SharingScreen from a tab */
public static SharingScreen fromTab(ChatTab tab, Screen parent) {
ChatTab.ChatTabJsonSave tabJsonSave = new ChatTab.ChatTabJsonSave();
return new SharingScreen(GSON.toJson(tabJsonSave.save(tab)), parent);
}
@Override
public void init() {
int x = this.width / 2 - 150;
int y = 50;
text = new GuiTextFieldGeneric(x, y, 300, 20, client.textRenderer);
y -= 24;
text.setMaxLength(12800);
if (starting != null) {
text.setText(starting);
text.setTextFieldFocused(true);
}
text.changeFocus(true);
text.setDrawsBackground(true);
text.setEditable(true);
text.changeFocus(true);
this.addTextField(text, null);
this.addButton(
x, y, "advancedchat.gui.button.importtab", (button, mouseButton) -> importTab());
}
private void addButton(int x, int y, String translation, IButtonActionListener listener) {
this.addButton(new NamedSimpleButton(x, y, StringUtils.translate(translation)), listener);
}
public void importTab() {
ChatTab.ChatTabJsonSave tabSave = new ChatTab.ChatTabJsonSave();
ChatTab tab = tabSave.load(new JsonParser().parse(text.getText()).getAsJsonObject());
if (tab == null) {
throw new NullPointerException("Filter is null!");
}
HudConfigStorage.TABS.add(tab);
AdvancedChatHud.MAIN_CHAT_TAB.setUpTabs();
addGuiMessage(
Message.MessageType.SUCCESS,
5000,
StringUtils.translate("advancedchat.gui.message.successful"));
}
}
@@ -0,0 +1,52 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config.gui;
import fi.dy.masa.malilib.gui.interfaces.ISelectionListener;
import io.github.darkkronicle.advancedchatcore.gui.WidgetConfigList;
import io.github.darkkronicle.advancedchathud.config.ChatTab;
import io.github.darkkronicle.advancedchathud.config.Match;
import java.util.Collection;
import net.minecraft.client.gui.screen.Screen;
public class WidgetListMatches extends WidgetConfigList<Match, WidgetMatchEntry> {
public final ChatTab tab;
public WidgetListMatches(
int x,
int y,
int width,
int height,
ISelectionListener<Match> selectionListener,
ChatTab parent,
Screen screen) {
super(x, y, width, height, selectionListener, screen);
this.tab = parent;
this.setParent(screen);
}
@Override
protected WidgetMatchEntry createListEntryWidget(
int x, int y, int listIndex, boolean isOdd, Match entry) {
return new WidgetMatchEntry(
x,
y,
this.browserEntryWidth,
this.getBrowserEntryHeightFor(entry),
isOdd,
entry,
listIndex,
this);
}
@Override
protected Collection<Match> getAllEntries() {
return tab.getMatches();
}
}
@@ -5,27 +5,27 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config;
package io.github.darkkronicle.advancedchathud.config.gui;
import fi.dy.masa.malilib.gui.interfaces.ISelectionListener;
import fi.dy.masa.malilib.gui.widgets.WidgetListBase;
import io.github.darkkronicle.advancedchatcore.gui.WidgetConfigList;
import io.github.darkkronicle.advancedchathud.config.ChatTab;
import io.github.darkkronicle.advancedchathud.config.HudConfigStorage;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import javax.annotation.Nullable;
import net.minecraft.client.gui.screen.Screen;
public class WidgetListTabs extends WidgetListBase<ChatTab, WidgetTabEntry> {
public class WidgetListTabs extends WidgetConfigList<ChatTab, WidgetTabEntry> {
public WidgetListTabs(
int x,
int y,
int width,
int height,
@Nullable ISelectionListener<ChatTab> selectionListener,
ISelectionListener<ChatTab> selectionListener,
Screen parent) {
super(x, y, width, height, selectionListener);
this.browserEntryHeight = 22;
super(x, y, width, height, selectionListener, parent);
this.setParent(parent);
}
@@ -0,0 +1,138 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config.gui;
import fi.dy.masa.malilib.config.options.ConfigOptionList;
import fi.dy.masa.malilib.gui.GuiTextFieldGeneric;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.ConfigButtonOptionList;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.gui.interfaces.ITextFieldListener;
import fi.dy.masa.malilib.gui.wrappers.TextFieldWrapper;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.gui.WidgetConfigListEntry;
import io.github.darkkronicle.advancedchatcore.gui.buttons.NamedSimpleButton;
import io.github.darkkronicle.advancedchatcore.util.FindType;
import io.github.darkkronicle.advancedchathud.config.Match;
import io.github.darkkronicle.advancedchathud.util.TextUtil;
import java.util.ArrayList;
import java.util.List;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.util.math.MatrixStack;
@Environment(EnvType.CLIENT)
public class WidgetMatchEntry extends WidgetConfigListEntry<Match> {
private TextFieldWrapper<GuiTextFieldGeneric> name;
private List<TextFieldWrapper<GuiTextFieldGeneric>> texts;
private ConfigOptionList findType =
new ConfigOptionList(
"advancedchathud.config.match.findtype",
FindType.LITERAL,
"advancedchathud.config.match.info.findtype");
public WidgetMatchEntry(
int x,
int y,
int width,
int height,
boolean isOdd,
Match entry,
int listIndex,
WidgetListMatches parent) {
super(x, y, width, height, isOdd, entry, listIndex);
y += 1;
int pos = x + width - 2;
int removeWidth = 0;
if (listIndex != 0) {
// Always want one
removeWidth =
addButton(
pos,
y,
"advancedchathud.config.match.remove",
(button, mouseButton) -> {
parent.tab.getMatches().remove(entry);
parent.refreshEntries();
})
+ 1;
}
pos -= removeWidth;
int findWidth = getFindTypeWidth();
int nameWidth = width - findWidth - removeWidth;
this.findType.setOptionListValue(entry.getFindType());
ConfigButtonOptionList findType =
new ConfigButtonOptionList(pos - findWidth, y, findWidth, 20, this.findType);
this.addButton(
findType,
(button, mouseButton) -> {
entry.setFindType((FindType) this.findType.getOptionListValue());
});
pos -= findWidth + 1;
GuiTextFieldGeneric nameField =
new GuiTextFieldGeneric(
pos - nameWidth,
y,
nameWidth,
20,
MinecraftClient.getInstance().textRenderer);
nameField.setMaxLength(64000);
nameField.setText(entry.getPattern());
name = new TextFieldWrapper<>(nameField, new SaveListener(this));
parent.addTextField(name);
texts = new ArrayList<>();
texts.add(name);
}
private static int getFindTypeWidth() {
List<String> translations = new ArrayList<>();
for (FindType f : FindType.values()) {
translations.add(f.getDisplayName());
}
return TextUtil.getMaxLengthTranslation(translations) + 10;
}
@Override
public List<TextFieldWrapper<GuiTextFieldGeneric>> getTextFields() {
return texts;
}
@Override
public void renderEntry(int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {}
@Override
public String getName() {
return null;
}
private static class SaveListener implements ITextFieldListener<GuiTextFieldGeneric> {
private final WidgetMatchEntry parent;
public SaveListener(WidgetMatchEntry parent) {
this.parent = parent;
}
@Override
public boolean onTextChange(GuiTextFieldGeneric textField) {
parent.entry.setPattern(textField.getText());
return false;
}
}
protected int addButton(int x, int y, String translation, IButtonActionListener listener) {
ButtonGeneric button =
new NamedSimpleButton(x, y, StringUtils.translate(translation), false);
this.addButton(button, listener);
return button.getWidth();
}
}
@@ -0,0 +1,77 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.config.gui;
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.util.StringUtils;
import io.github.darkkronicle.advancedchatcore.gui.WidgetConfigListEntry;
import io.github.darkkronicle.advancedchatcore.gui.buttons.NamedSimpleButton;
import io.github.darkkronicle.advancedchathud.AdvancedChatHud;
import io.github.darkkronicle.advancedchathud.config.ChatTab;
import io.github.darkkronicle.advancedchathud.config.HudConfigStorage;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
@Environment(EnvType.CLIENT)
public class WidgetTabEntry extends WidgetConfigListEntry<ChatTab> {
private final ChatTab tab;
private boolean main = true;
public WidgetTabEntry(
int x,
int y,
int width,
int height,
boolean isOdd,
ChatTab tab,
int listIndex,
WidgetListTabs parent) {
super(x, y, width, height, isOdd, tab, listIndex, tab.getWidgetHoverLines());
this.tab = tab;
y += 1;
int pos = x + width - 2;
if (listIndex != 0) {
main = false;
// If it's 0 it's the main tab
pos -=
addButton(
pos,
y,
"advancedchathud.config.tabmenu.remove",
(button, mouseButton) -> {
HudConfigStorage.TABS.remove(tab);
parent.refreshEntries();
AdvancedChatHud.MAIN_CHAT_TAB.setUpTabs();
});
}
pos -=
addButton(
pos,
y,
"advancedchathud.config.tabmenu.configure",
(button, mouseButton) -> {
GuiBase.openGui(new GuiTabEditor(parent.getParent(), tab, main));
});
setButtonStartX(pos);
}
protected int addButton(int x, int y, String translation, IButtonActionListener listener) {
ButtonGeneric button =
new NamedSimpleButton(x, y, StringUtils.translate(translation), false);
this.addButton(button, listener);
return button.getWidth();
}
@Override
public String getName() {
return tab.getName().config.getStringValue();
}
}
@@ -46,13 +46,13 @@ public class ChatWindow {
private int scrolledLines = 0;
@Getter private int y;
@Getter private double yPercent;
@Getter private int x;
@Getter private double xPercent;
@Getter private int width;
@Getter private double widthPercent;
@Getter private int height;
@Getter private double heightPercent;
private final MinecraftClient client;
@@ -75,18 +75,40 @@ public class ChatWindow {
public ChatWindow(AbstractChatTab tab) {
this.client = MinecraftClient.getInstance();
this.y =
client.getWindow().getScaledHeight()
- HudConfigStorage.General.Y.config.getIntegerValue();
this.x = HudConfigStorage.General.X.config.getIntegerValue();
this.width = HudConfigStorage.General.WIDTH.config.getIntegerValue();
this.height = HudConfigStorage.General.HEIGHT.config.getIntegerValue();
int scaledHeight = client.getWindow().getScaledHeight();
int scaledWidth = client.getWindow().getScaledWidth();
this.yPercent =
((double) (scaledHeight - HudConfigStorage.General.Y.config.getIntegerValue()))
/ scaledHeight;
this.xPercent =
((double) HudConfigStorage.General.X.config.getIntegerValue()) / scaledWidth;
this.widthPercent =
((double) HudConfigStorage.General.WIDTH.config.getIntegerValue()) / scaledWidth;
this.heightPercent =
((double) HudConfigStorage.General.HEIGHT.config.getIntegerValue()) / scaledHeight;
this.setTab(tab);
}
public void setRelativePosition(double x, double y) {
if (x > 2) {
x = 0;
}
if (y > 2) {
y = 0;
}
this.xPercent = x;
this.yPercent = y;
}
public void setPosition(int x, int y) {
this.x = x;
this.y = y;
int scaledHeight = client.getWindow().getScaledHeight();
this.xPercent = ((double) x) / client.getWindow().getScaledWidth();
this.yPercent = ((double) y) / scaledHeight;
}
public void setRelativeDimensions(double width, double height) {
this.widthPercent = width;
this.heightPercent = height;
}
public void setTab(AbstractChatTab tab) {
@@ -120,6 +142,22 @@ public class ChatWindow {
}
}
public int getConvertedX() {
return (int) ((double) client.getWindow().getScaledWidth() * xPercent);
}
public int getConvertedY() {
return (int) ((double) client.getWindow().getScaledHeight() * yPercent);
}
public int getConvertedWidth() {
return (int) ((double) client.getWindow().getScaledWidth() * widthPercent);
}
public int getConvertedHeight() {
return (int) ((double) client.getWindow().getScaledHeight() * heightPercent);
}
public int getTotalLines() {
int count = 0;
for (ChatMessage line : lines) {
@@ -173,11 +211,11 @@ public class ChatWindow {
}
private int getActualY(int y) {
return (int) Math.ceil(this.y / getScale()) - y;
return (int) Math.ceil(this.getConvertedY() / getScale()) - y;
}
private int getLeftX() {
return (int) Math.ceil(x / getScale());
return (int) Math.ceil(this.getConvertedX() / getScale());
}
private int getPaddedLeftX() {
@@ -201,15 +239,15 @@ public class ChatWindow {
}
public int getActualHeight() {
return height + getBarHeight();
return getConvertedHeight() + getBarHeight();
}
private int getScaledHeight() {
return (int) Math.ceil(height / getScale());
return (int) Math.ceil(getConvertedHeight() / getScale());
}
private int getScaledWidth() {
return (int) Math.ceil(width / getScale());
return (int) Math.ceil(getConvertedWidth() / getScale());
}
private int getBarHeight() {
@@ -221,8 +259,10 @@ public class ChatWindow {
}
public boolean isMouseOver(double mouseX, double mouseY) {
int x = getConvertedX();
int y = getConvertedY();
return (x <= mouseX
&& x + width >= mouseX
&& x + getConvertedWidth() >= mouseX
&& y >= mouseY
&& y - getActualHeight() <= mouseY);
}
@@ -287,7 +327,7 @@ public class ChatWindow {
renderedLines++;
}
if (lines >= scrolledLines) {
if (lines == lineCount) {
if (lines == totalLines) {
break;
}
if (!y.isPossible(
@@ -569,7 +609,7 @@ public class ChatWindow {
return null;
}
double relX = mouseX;
double relY = y - mouseY;
double relY = getConvertedY() - mouseY;
double trueX = relX / getScale() - getPaddedLeftX();
double trueY = relY / getScale();
// Divide it by chat scale to get where it actually is
@@ -627,19 +667,25 @@ public class ChatWindow {
}
public boolean isMouseOverDragBar(double mouseX, double mouseY) {
int x = getConvertedX();
int y = getConvertedY();
int width = getConvertedWidth();
int height = getConvertedHeight();
return (isMouseOver(mouseX, mouseY)
&& mouseX <= x + width - (getScaledBarHeight() * 3)
&& mouseY <= y - height);
}
public boolean onMouseClicked(double mouseX, double mouseY, int button) {
int convX = getConvertedX();
int width = getConvertedWidth();
boolean onButtons =
isMouseOverDragBar(mouseX - (getScaledBarHeight() * 3), mouseY)
&& mouseX >= x + width - getScaledBarHeight() * 3;
&& mouseX >= convX + width - getScaledBarHeight() * 3;
if (!onButtons) {
return false;
}
int x = width - (int) (mouseX - this.x);
int x = width - (int) (mouseX - convX);
// Visibility | Resize | Close
if (x <= getScaledBarHeight()) {
// Close
@@ -655,6 +701,10 @@ public class ChatWindow {
}
public boolean isMouseOverResize(double mouseX, double mouseY) {
int x = getConvertedX();
int y = getConvertedY();
int width = getConvertedWidth();
int height = getConvertedHeight();
return (isMouseOver(mouseX, mouseY)
&& mouseX >= x + width - (getScaledBarHeight() * 2)
&& mouseX <= x + width - (getScaledBarHeight())
@@ -662,6 +712,10 @@ public class ChatWindow {
}
public boolean isMouseOverVisibility(double mouseX, double mouseY) {
int x = getConvertedX();
int y = getConvertedY();
int width = getConvertedWidth();
int height = getConvertedHeight();
return (isMouseOver(mouseX, mouseY)
&& mouseX >= x + width - (getScaledBarHeight() * 3)
&& mouseX <= x + width - (getScaledBarHeight() * 2)
@@ -669,10 +723,10 @@ public class ChatWindow {
}
public void setDimensions(int width, int height) {
this.width = width;
this.height = height;
this.widthPercent = (double) width / client.getWindow().getScaledWidth();
this.heightPercent = (double) height / client.getWindow().getScaledHeight();
for (ChatMessage m : lines) {
m.formatChildren(this.width);
m.formatChildren(getConvertedWidth());
}
}
@@ -716,21 +770,22 @@ public class ChatWindow {
}
ChatWindow window = new ChatWindow(tab);
window.setSelected(obj.get("selected").getAsBoolean());
window.setPosition(obj.get("x").getAsInt(), obj.get("y").getAsInt());
window.setRelativePosition(obj.get("x").getAsDouble(), obj.get("y").getAsDouble());
window.setVisibility(
HudConfigStorage.Visibility.fromVisibilityString(
obj.get("visibility").getAsString()));
window.setDimensions(obj.get("width").getAsInt(), obj.get("height").getAsInt());
window.setRelativeDimensions(
obj.get("width").getAsDouble(), obj.get("height").getAsDouble());
return window;
}
@Override
public JsonObject save(ChatWindow chatWindow) {
JsonObject obj = new JsonObject();
obj.addProperty("x", chatWindow.getX());
obj.addProperty("y", chatWindow.getY());
obj.addProperty("width", chatWindow.getWidth());
obj.addProperty("height", chatWindow.getHeight());
obj.addProperty("x", chatWindow.getXPercent());
obj.addProperty("y", chatWindow.getYPercent());
obj.addProperty("width", chatWindow.getWidthPercent());
obj.addProperty("height", chatWindow.getHeightPercent());
obj.addProperty("visibility", chatWindow.getVisibility().getStringValue());
obj.addProperty("tabuuid", chatWindow.getTab().getUuid().toString());
obj.addProperty("selected", chatWindow.isSelected());
@@ -46,7 +46,11 @@ public class HudSection extends AdvancedChatScreenSection {
getScreen().addButton(button, null);
x += button.getWidth() + space;
}
getScreen().addButton(new NewWindowButton(x, y), null);
NewWindowButton windowButton = new NewWindowButton(x, y);
getScreen().addButton(windowButton, null);
x += windowButton.getWidth() + space;
ResetWindowsButton resetButton = new ResetWindowsButton(x, y);
getScreen().addButton(resetButton, null);
}
@Override
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2021 DarkKronicle
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package io.github.darkkronicle.advancedchathud.gui;
import fi.dy.masa.malilib.render.RenderUtils;
import io.github.darkkronicle.advancedchatcore.gui.CleanButton;
import io.github.darkkronicle.advancedchatcore.util.ColorUtil;
import io.github.darkkronicle.advancedchathud.AdvancedChatHud;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.sound.PositionedSoundInstance;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier;
public class ResetWindowsButton extends CleanButton {
private static final int PADDING = 3;
private static final int SIZE = PADDING + 9 + PADDING;
private static final Identifier ADD_ICON =
new Identifier(AdvancedChatHud.MOD_ID, "textures/gui/chatwindow/reset_windows.png");
public ResetWindowsButton(int x, int y) {
super(x, y, SIZE, SIZE, null, null);
}
@Override
public void render(int mouseX, int mouseY, boolean unused, MatrixStack matrixStack) {
int relMX = mouseX - x;
int relMY = mouseY - y;
hovered = relMX >= 0 && relMX <= width && relMY >= 0 && relMY <= height;
ColorUtil.SimpleColor plusBack = ColorUtil.BLACK.withAlpha(100);
boolean plusHovered = hovered && relMX >= width - height;
if (plusHovered) {
plusBack = ColorUtil.WHITE.withAlpha(plusBack.alpha());
}
RenderUtils.drawRect(x, y, width, height, plusBack.color());
RenderUtils.color(1, 1, 1, 1);
RenderUtils.bindTexture(ADD_ICON);
DrawableHelper.drawTexture(
matrixStack,
x + PADDING,
y + PADDING,
width - (PADDING * 2),
height - (PADDING * 2),
0,
0,
32,
32,
32,
32);
}
@Override
protected boolean onMouseClickedImpl(int mouseX, int mouseY, int mouseButton) {
this.mc
.getSoundManager()
.play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
WindowManager.getInstance().reset();
return true;
}
}
@@ -56,9 +56,7 @@ public class TabButton extends CleanButton {
if (!selected) {
color =
new ColorUtil.SimpleColor(
color.red() / 2, color.green(), color.blue() / 2, 100);
} else {
color = color.withAlpha(230);
color.red() / 2, color.green() / 2, color.blue() / 2, 100);
}
RenderUtils.drawRect(x, y, width, height, color.color());
@@ -167,13 +167,13 @@ public class WindowManager implements IRenderer {
setSelected(over);
if (over.isMouseOverDragBar(mouseX, mouseY)) {
drag = over;
dragX = (int) mouseX - over.getX();
dragY = (int) mouseY - over.getY();
dragX = (int) mouseX - over.getConvertedX();
dragY = (int) mouseY - over.getConvertedY();
resize = false;
} else if (over.isMouseOverResize(mouseX, mouseY)) {
drag = over;
dragX = (int) mouseX - over.getWidth();
dragY = (int) mouseY + over.getHeight();
dragX = (int) mouseX - over.getConvertedWidth();
dragY = (int) mouseY + over.getConvertedHeight();
resize = true;
}
Style style = over.getText(mouseX, mouseY);
@@ -196,7 +196,7 @@ public class WindowManager implements IRenderer {
if (drag != null && !resize) {
int x = Math.max((int) mouseX - dragX, 0);
int y = Math.max((int) mouseY - dragY, drag.getActualHeight());
x = Math.min(x, client.getWindow().getScaledWidth() - drag.getWidth());
x = Math.min(x, client.getWindow().getScaledWidth() - drag.getConvertedWidth());
y = Math.min(y, client.getWindow().getScaledHeight());
drag.setPosition(x, y);
return true;
@@ -234,7 +234,7 @@ public class WindowManager implements IRenderer {
if (sel == null) {
sel = window;
}
window.setPosition(sel.getX() + 15, sel.getY() + 15);
window.setPosition(sel.getConvertedX() + 15, sel.getConvertedY() + 15);
windows.add(window);
setSelected(window);
}
@@ -16,7 +16,6 @@ import io.github.darkkronicle.advancedchathud.itf.IChatHud;
import io.github.darkkronicle.advancedchathud.tabs.AbstractChatTab;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
@@ -49,9 +48,6 @@ public abstract class MixinChatHud implements IChatHud {
private AbstractChatTab tab;
@Shadow
public abstract void reset();
@Shadow
public abstract int getWidth();
@@ -64,25 +60,54 @@ public abstract class MixinChatHud implements IChatHud {
@Shadow
public abstract void scroll(double amount);
@Shadow
public abstract void clear(boolean clearHistory);
@Shadow
public abstract int getVisibleLineCount();
@Shadow
protected abstract boolean isChatHidden();
@Shadow
public abstract int getHeight();
@Override
public boolean isOver(double mouseX, double mouseY) {
mouseX = mouseX - 4;
mouseY = client.getWindow().getScaledHeight() - mouseY - 40;
mouseX = mouseX * getChatScale();
mouseY = mouseY * getChatScale();
return mouseX > 0 && mouseX < getWidth() && mouseY > 0 && mouseY < getHeight();
@Inject(at = @At("HEAD"), method = "scroll", cancellable = true)
private void scroll(double amount, CallbackInfo ci) {
// Only scroll if nothing is focused
if (WindowManager.getInstance().getSelected() != null) {
ci.cancel();
}
}
@Inject(at = @At("HEAD"), method = "render", cancellable = true)
private void render(MatrixStack stack, int delta, CallbackInfo ci) {
// Ignore rendering vanilla chat if disabled
if (!HudConfigStorage.General.VANILLA_HUD.config.getBooleanValue()) {
ci.cancel();
}
}
@Inject(at = @At("HEAD"), method = "getText", cancellable = true)
public void getTextHead(double x, double y, CallbackInfoReturnable<Style> cir) {
// Ignore checking vanilla chat for hovered text if disabled
if (!HudConfigStorage.General.VANILLA_HUD.config.getBooleanValue()) {
cir.setReturnValue(WindowManager.getInstance().getText(x, y));
}
}
@Inject(at = @At("RETURN"), method = "getText", cancellable = true)
public void getTextReturn(double x, double y, CallbackInfoReturnable<Style> cir) {
// If vanilla chat didn't find any text, search on our own windows
if (cir.getReturnValue() == null) {
cir.setReturnValue(WindowManager.getInstance().getText(x, y));
}
}
public AbstractChatTab getTab() {
return tab;
}
public void setTab(AbstractChatTab tab) {
this.tab = tab;
this.messages.clear();
this.visibleMessages.clear();
List<HudChatMessage> messages = HudChatMessageHolder.getInstance().getMessages();
for (int i = messages.size() - 1; i >= 0; i--) {
addMessage(messages.get(i));
}
}
@Override
@@ -90,8 +115,9 @@ public abstract class MixinChatHud implements IChatHud {
if (tab == null || !hudMsg.getTabs().contains(tab)) {
return;
}
;
tab.resetUnread();
if (HudConfigStorage.General.VANILLA_HUD.config.getBooleanValue()) {
tab.resetUnread();
}
int width = MathHelper.floor((double) this.getWidth() / this.getChatScale());
@@ -126,77 +152,15 @@ public abstract class MixinChatHud implements IChatHud {
}
}
@Inject(at = @At("HEAD"), method = "scroll", cancellable = true)
private void scroll(double amount, CallbackInfo ci) {
if (WindowManager.getInstance().getSelected() != null) {
// Only scroll if nothing is focused
ci.cancel();
}
}
@Shadow
public abstract void clear(boolean clearHistory);
public AbstractChatTab getTab() {
return tab;
}
@Override
public boolean isOver(double mouseX, double mouseY) {
double minX = 4 - (4 * getChatScale());
double maxX = 4 + (getWidth() + 4 * getChatScale());
@Inject(at = @At("HEAD"), method = "render", cancellable = true)
private void render(MatrixStack stack, int delta, CallbackInfo ci) {
if (!HudConfigStorage.General.VANILLA_HUD.config.getBooleanValue()) {
ci.cancel();
}
}
@Inject(at = @At("HEAD"), method = "getText", cancellable = true)
private void getTextAt(double x, double y, CallbackInfoReturnable<Style> ci) {
// Set new text value from cooooolness
if (!HudConfigStorage.General.VANILLA_HUD.config.getBooleanValue()) {
ci.setReturnValue(WindowManager.getInstance().getText(x, y));
return;
}
// Prioritize main first
// TODO figure out how to use intrinsic
if (this.isChatFocused() && !this.client.options.hudHidden && !isChatHidden()) {
double d = x - 2.0D;
double e = (double) this.client.getWindow().getScaledHeight() - y - 40.0D;
d = MathHelper.floor(d / this.getChatScale());
e =
MathHelper.floor(
e
/ (this.getChatScale()
* (this.client.options.chatLineSpacing + 1.0D)));
if (d >= 0.0D && e >= 0.0D) {
int i = Math.min(getVisibleLineCount(), this.visibleMessages.size());
if (d
<= (double)
MathHelper.floor((double) this.getWidth() / this.getChatScale())) {
Objects.requireNonNull(this.client.textRenderer);
if (e < (double) (9 * i + i)) {
Objects.requireNonNull(this.client.textRenderer);
int j = (int) (e / 9.0D + (double) this.scrolledLines);
if (j >= 0 && j < this.visibleMessages.size()) {
ChatHudLine<OrderedText> chatHudLine = this.visibleMessages.get(j);
ci.setReturnValue(
this.client
.textRenderer
.getTextHandler()
.getStyleAt(chatHudLine.getText(), (int) d));
return;
}
}
}
}
}
ci.setReturnValue(WindowManager.getInstance().getText(x, y));
}
public void setTab(AbstractChatTab tab) {
this.tab = tab;
this.messages.clear();
this.visibleMessages.clear();
List<HudChatMessage> messages = HudChatMessageHolder.getInstance().getMessages();
for (int i = messages.size() - 1; i >= 0; i--) {
addMessage(messages.get(i));
}
this.reset();
mouseY = (client.getWindow().getScaledHeight() - mouseY - 40) / getChatScale();
return mouseX >= minX && mouseX < maxX && mouseY >= 0 && mouseY < getHeight();
}
}
@@ -7,6 +7,11 @@
*/
package io.github.darkkronicle.advancedchathud.util;
import fi.dy.masa.malilib.util.StringUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class TextUtil {
private static final char[] SUPERSCRIPTS =
@@ -22,4 +27,31 @@ public class TextUtil {
} while ((num /= 10) > 0);
return sb.reverse().toString();
}
public static int getMaxLengthTranslation(Collection<String> translations) {
return getMaxLengthTranslation(translations.toArray(new String[0]));
}
public static int getMaxLengthTranslation(String... translations) {
List<String> translated = new ArrayList<>();
for (String translation : translations) {
translated.add(StringUtils.translate(translation));
}
return getMaxLengthString(translated);
}
public static int getMaxLengthString(Collection<String> strings) {
return getMaxLengthString(strings.toArray(new String[0]));
}
public static int getMaxLengthString(String... strings) {
int max = 0;
for (String text : strings) {
int width = StringUtils.getStringWidth(text);
if (width > max) {
max = width;
}
}
return max;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

+1 -1
View File
@@ -28,7 +28,7 @@
"fabric": "*",
"minecraft": ">=1.17.0",
"malilib": ">=0.10.0-dev.20",
"advancedchatcore": ">=1.0.0"
"advancedchatcore": ">=1.2.0-1.17.1"
},
"custom": {
"acmodule": true,