Skip to content

Commit

Permalink
Add a gui setting for enabling spellcheck. Also move it to advanced.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmess1221 committed May 2, 2016
1 parent a91dd3c commit ba2ebc1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/mnm/mods/tabbychat/gui/TextBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public List<String> getWrappedLines() {

public List<IChatComponent> getFormattedLines() {
List<String> lines = getWrappedLines();
if (TabbyChat.getInstance().settings.general.spelling.enabled.get()) {
if (TabbyChat.getInstance().settings.advanced.spelling.get()) {
spellcheck.checkSpelling(textField.getValue());
return lines.stream()
.map(new SpellingFormatter(spellcheck))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public void initGUI() {
addComponent(new GuiLabel(new ChatComponentTranslation(ADVANCED_HIDE_DELIMS)), new int[] { 2, 7 });
addComponent(new GuiSettingBoolean(getSettings().advanced.hideTag), new int[] { 1, 7 });

addComponent(new GuiLabel(new ChatComponentTranslation(ADVANCED_SPELLCHECK)), new int[] { 2, 8 });
addComponent(new GuiSettingBoolean(getSettings().advanced.spelling), new int[] { 1, 8 });

addComponent(new GuiLabel(new ChatComponentTranslation(EXPERIMENTAL)), new int[] { 0, 13 });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ public class AdvancedSettings extends ValueObject {
public Value<Integer> msgDelay = value(500);
public Value<Boolean> hideTag = value(false);
public Value<Boolean> keepChatOpen = value(false);
public Value<Boolean> spelling = value(true);
public Value<ChatVisibility> visibility = value(ChatVisibility.NORMAL);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package mnm.mods.tabbychat.settings;

import com.google.gson.annotations.Expose;

import mnm.mods.tabbychat.util.TimeStamps;
import mnm.mods.util.config.Value;
import mnm.mods.util.config.ValueObject;
Expand All @@ -18,11 +16,4 @@ public class GeneralSettings extends ValueObject {
public Value<Double> antiSpamPrejudice = value(0D);
public Value<Boolean> unreadFlashing = value(true);
public Value<Boolean> checkUpdates = value(true);
public Spelling spelling = new Spelling();

public class Spelling extends ValueObject {

@Expose
public Value<Boolean> enabled = new Value<Boolean>(true);
}
}
1 change: 1 addition & 0 deletions src/main/java/mnm/mods/tabbychat/util/Translation.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public final class Translation {
public static final String ADVANCED_CHAT_DELAY = "tabbychat.settings.advanced.chatdelay";
public static final String ADVANCED_CHAT_VISIBILITY = "tabbychat.settings.advanced.chatvisibility";
public static final String ADVANCED_HIDE_DELIMS = "tabbychat.settings.advanced.hidedelims";
public static final String ADVANCED_SPELLCHECK = "tabbychat.settings.advanced.spellcheck";
public static final String EXPERIMENTAL = "tabbychat.settings.experimental";

private Translation() {}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/tabbychat/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ tabbychat.settings.advanced.fadetime=Fade time (ticks)
tabbychat.settings.advanced.chatdelay=Chat delay (ms)
tabbychat.settings.advanced.chatvisibility=Chat visibility
tabbychat.settings.advanced.hidedelims=Hide channel delimeters*
tabbychat.settings.advanced.spellcheck=Enable spellcheck

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

0 comments on commit ba2ebc1

Please sign in to comment.