Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit ba2ebc1

Browse files
committed
Add a gui setting for enabling spellcheck. Also move it to advanced.
1 parent a91dd3c commit ba2ebc1

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

src/main/java/mnm/mods/tabbychat/gui/TextBox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public List<String> getWrappedLines() {
179179

180180
public List<IChatComponent> getFormattedLines() {
181181
List<String> lines = getWrappedLines();
182-
if (TabbyChat.getInstance().settings.general.spelling.enabled.get()) {
182+
if (TabbyChat.getInstance().settings.advanced.spelling.get()) {
183183
spellcheck.checkSpelling(textField.getValue());
184184
return lines.stream()
185185
.map(new SpellingFormatter(spellcheck))

src/main/java/mnm/mods/tabbychat/gui/settings/GuiAdvancedSettings.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public void initGUI() {
4141
addComponent(new GuiLabel(new ChatComponentTranslation(ADVANCED_HIDE_DELIMS)), new int[] { 2, 7 });
4242
addComponent(new GuiSettingBoolean(getSettings().advanced.hideTag), new int[] { 1, 7 });
4343

44+
addComponent(new GuiLabel(new ChatComponentTranslation(ADVANCED_SPELLCHECK)), new int[] { 2, 8 });
45+
addComponent(new GuiSettingBoolean(getSettings().advanced.spelling), new int[] { 1, 8 });
46+
4447
addComponent(new GuiLabel(new ChatComponentTranslation(EXPERIMENTAL)), new int[] { 0, 13 });
4548
}
4649

src/main/java/mnm/mods/tabbychat/settings/AdvancedSettings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ public class AdvancedSettings extends ValueObject {
1616
public Value<Integer> msgDelay = value(500);
1717
public Value<Boolean> hideTag = value(false);
1818
public Value<Boolean> keepChatOpen = value(false);
19+
public Value<Boolean> spelling = value(true);
1920
public Value<ChatVisibility> visibility = value(ChatVisibility.NORMAL);
2021
}
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package mnm.mods.tabbychat.settings;
22

3-
import com.google.gson.annotations.Expose;
4-
53
import mnm.mods.tabbychat.util.TimeStamps;
64
import mnm.mods.util.config.Value;
75
import mnm.mods.util.config.ValueObject;
@@ -18,11 +16,4 @@ public class GeneralSettings extends ValueObject {
1816
public Value<Double> antiSpamPrejudice = value(0D);
1917
public Value<Boolean> unreadFlashing = value(true);
2018
public Value<Boolean> checkUpdates = value(true);
21-
public Spelling spelling = new Spelling();
22-
23-
public class Spelling extends ValueObject {
24-
25-
@Expose
26-
public Value<Boolean> enabled = new Value<Boolean>(true);
27-
}
2819
}

src/main/java/mnm/mods/tabbychat/util/Translation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public final class Translation {
8989
public static final String ADVANCED_CHAT_DELAY = "tabbychat.settings.advanced.chatdelay";
9090
public static final String ADVANCED_CHAT_VISIBILITY = "tabbychat.settings.advanced.chatvisibility";
9191
public static final String ADVANCED_HIDE_DELIMS = "tabbychat.settings.advanced.hidedelims";
92+
public static final String ADVANCED_SPELLCHECK = "tabbychat.settings.advanced.spellcheck";
9293
public static final String EXPERIMENTAL = "tabbychat.settings.experimental";
9394

9495
private Translation() {}

src/main/resources/assets/tabbychat/lang/en_US.lang

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,6 @@ tabbychat.settings.advanced.fadetime=Fade time (ticks)
7878
tabbychat.settings.advanced.chatdelay=Chat delay (ms)
7979
tabbychat.settings.advanced.chatvisibility=Chat visibility
8080
tabbychat.settings.advanced.hidedelims=Hide channel delimeters*
81+
tabbychat.settings.advanced.spellcheck=Enable spellcheck
8182

8283
tabbychat.settings.experimental=* Experimental and may not work right.

0 commit comments

Comments
 (0)