Skip to content

Commit

Permalink
Updated to v0.27-b2.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Jul 25, 2024
2 parents 92b40cb + 6193696 commit b6eeacf
Show file tree
Hide file tree
Showing 39 changed files with 647 additions and 111 deletions.
1 change: 1 addition & 0 deletions src/chatty/SettingsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ public void defineSettings() {
settings.addLong("emoteMaxHeight", 0);
settings.addLong("emoteScale", 100);
settings.addLong("emoteScaleDialog", 100);
settings.addLong("emoteScaleGigantified", 200);
settings.addList("emoteHiddenSets", new ArrayList<>(), Setting.STRING);
settings.addBoolean("closeEmoteDialogOnDoubleClick", false);
settings.addBoolean("ffz", true);
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/TwitchClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2757,7 +2757,7 @@ private void handleModAction(ModeratorActionData data) {
String warnedUsername = ModLogInfo.getTargetUsername(data);
if (warnedUsername != null) {
User warnedUser = c.getUser(channel, warnedUsername);
String reason = data.args.get(1);
String reason = ModLogInfo.getWarnReason(data);
warnedUser.addWarning(reason, data.created_by);
g.updateUserinfo(warnedUser);
}
Expand Down
8 changes: 6 additions & 2 deletions src/chatty/gui/GuiUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,11 @@ public void replace(DocumentFilter.FilterBypass fb, int offset,

int limit = defaultLimit;

if (!inputLimitsEnabled) {
/**
* If component isn't showing or is not focus owner it's likely
* that the text was set automatically, not entered by the user.
*/
if (!inputLimitsEnabled || !comp.isShowing() || !comp.isFocusOwner()) {
limit = 0;
}
else {
Expand Down Expand Up @@ -747,7 +751,7 @@ public void replace(DocumentFilter.FilterBypass fb, int offset,
popup.showPopup("Length limit reached");
}
else {
popup.showPopup("Length limit reached ("+overLimit+" characters not added)");
popup.showPopup("Length limit reached ("+overLimit+" over limit)");
}
}
if (!allowNewlines) {
Expand Down
2 changes: 2 additions & 0 deletions src/chatty/gui/StyleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class StyleManager implements StyleServer {
"lineSpacing", "bufferSize", "actionColored","combineBanMessages",
"timestampTimezone", "autoScrollTimeout", "searchResultColor2",
"inputFont","emoteScale", "emoteMaxHeight", "usericonScale",
"emoteScaleGigantified",
"customUsericonScaleMode", "botBadgeEnabled",
"filterCombiningCharacters", "pauseChatOnMouseMove",
"pauseChatOnMouseMoveCtrlRequired",
Expand Down Expand Up @@ -200,6 +201,7 @@ private void makeStyles() {
addBooleanSetting(Setting.EMOTICONS_ENABLED, "emoticonsEnabled");
addLongSetting(Setting.EMOTICON_SCALE_FACTOR, "emoteScale");
addLongSetting(Setting.EMOTICON_MAX_HEIGHT, "emoteMaxHeight");
addLongSetting(Setting.EMOTICON_SCALE_FACTOR_GIGANTIFIED, "emoteScaleGigantified");
addLongSetting(Setting.USERICON_SCALE_FACTOR, "usericonScale");
addLongSetting(Setting.CUSTOM_USERICON_SCALE_MODE, "customUsericonScaleMode");
addBooleanSetting(Setting.USERICONS_ENABLED, "usericonsEnabled");
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/FavoritesDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void changedUpdate(DocumentEvent e) {
channelsChanged();
}
});
GuiUtil.installLengthLimitDocumentFilter(input, 8000, false);
GuiUtil.installLengthLimitDocumentFilter(input, 80000, false);
TextSelectionMenu.install(input);

// Table
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/JoinDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void changedUpdate(DocumentEvent e) {
changed();
}
});
GuiUtil.installLengthLimitDocumentFilter(channels, 8000, false);
GuiUtil.installLengthLimitDocumentFilter(channels, 80000, false);
TextSelectionMenu.install(channels);

GridBagConstraints gbc;
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/SimplePopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public SimplePopup(Component owner, SimplePopupListener listener) {
}

public void showPopup(String text) {
if (owner == null) {
if (owner == null || !owner.isShowing()) {
return;
}
hidePopup();
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/admin/SelectTagsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ private static String showTagEditDialog(Window parent, StreamTag tag) {
// Input
JTextField input = new JTextField(25);
input.setText(tag.getName());
GuiUtil.installLengthLimitDocumentFilter(input, 25, false);
GuiUtil.installLengthLimitDocumentFilter(input, MAX_TAG_LENGTH, false);
dialog.add(input, GuiUtil.makeGbc(0, 0, 2, 1));
dialog.add(GuiUtil.createInputLenghtLabel(input, 25), GuiUtil.makeGbc(2, 0, 1, 1));
// Buttons
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/help/help-releases.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h2>
<a name="0.27">Version 0.27</a> <a name="latest">(This one!)</a> (2024-??-??)
<a href="#top" class="top">[back to top]</a>
</h2>
<p>TBD</p>
<p>Beta, see list of changes on GitHub</p>

<h2>
<a name="0.26">Version 0.26</a> (2024-03-21)
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/help/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1><a name="top">Chatty (Version: 0.27-b1)</a></h1>
<h1><a name="top">Chatty (Version: 0.27-b2)</a></h1>
<table>
<tr>
<td valign="top">
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/settings/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
public class Editor implements StringEditor {

private static final int INPUT_LENGTH_LIMIT = 100*1000;
private static final int INPUT_LENGTH_LIMIT = 200*1000;

private final JDialog dialog;
private final JLabel label;
Expand Down
41 changes: 26 additions & 15 deletions src/chatty/gui/components/settings/EmoteSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import chatty.util.api.CachedImage.CachedImageUser;
import chatty.util.api.IgnoredEmotes;
import chatty.util.seventv.WebPUtil;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Window;
Expand Down Expand Up @@ -71,7 +72,7 @@ protected EmoteSettings(SettingsDialog d) {
d.makeGbc(0, 3, 1, 1, GridBagConstraints.WEST));
ComboLongSetting emoteScale = new ComboLongSetting(makeScaleValues());
d.addLongSetting("emoteScale", emoteScale);
main.add(emoteScale, d.makeGbc(1, 3, 1, 1, GridBagConstraints.CENTER));
main.add(emoteScale, d.makeGbc(1, 3, 1, 1, GridBagConstraints.WEST));

// Maximum Emote Height (Chat)
main.add(new JLabel(Language.getString("settings.emoticons.maxHeight")),
Expand All @@ -81,18 +82,24 @@ protected EmoteSettings(SettingsDialog d) {
main.add(new JLabel(Language.getString("settings.emoticons.maxHeightPixels")),
d.makeGbc(4, 3, 1, 1, GridBagConstraints.WEST));

main.add(new JLabel(Language.getString("settings.emoticons.gigantifiedScale")),
d.makeGbc(0, 4, 1, 1, GridBagConstraints.WEST));
ComboLongSetting emoteScaleGigantified = new ComboLongSetting(makeScaleValuesGigantified());
d.addLongSetting("emoteScaleGigantified", emoteScaleGigantified);
main.add(emoteScaleGigantified, d.makeGbc(1, 4, 1, 1, GridBagConstraints.WEST));

// Emotes Dialog Emote Scale
main.add(new JLabel(Language.getString("settings.emoticons.dialogScale")),
d.makeGbc(0, 4, 1, 1, GridBagConstraints.WEST));
d.makeGbc(0, 5, 1, 1, GridBagConstraints.WEST));
ComboLongSetting emoteScaleDialog = new ComboLongSetting(makeScaleValues());
d.addLongSetting("emoteScaleDialog", emoteScaleDialog);
main.add(emoteScaleDialog, d.makeGbc(1, 4, 1, 1, GridBagConstraints.CENTER));
main.add(emoteScaleDialog, d.makeGbc(1, 5, 1, 1, GridBagConstraints.WEST));

//-------
// Other
//-------
main.add(d.addSimpleBooleanSetting("closeEmoteDialogOnDoubleClick"),
d.makeGbc(0, 5, 3, 1));
d.makeGbc(0, 6, 3, 1));

//--------------------------
// Animations
Expand All @@ -103,26 +110,26 @@ protected EmoteSettings(SettingsDialog d) {
SettingsUtil.addSubsettings(animatePauseSetting, s -> s != 2, animatePauseFrameSetting);

SettingsUtil.addLabeledComponent(main, "animationPause",
0, 6, 4, GridBagConstraints.WEST,
0, 7, 4, GridBagConstraints.WEST,
animatePauseSetting);

SettingsUtil.addLabeledComponent(main, "animationPauseFrame",
0, 7, 4, GridBagConstraints.WEST,
0, 8, 4, GridBagConstraints.WEST,
animatePauseFrameSetting);

//--------------------------
// WebP
//--------------------------
JLabel webpTest = new JLabel("WebP not supported.");
main.add(webpTest,
SettingsDialog.makeGbc(2, 8, 3, 1, GridBagConstraints.WEST));
SettingsDialog.makeGbc(2, 9, 3, 1, GridBagConstraints.WEST));
WebPUtil.runIfWebPAvailable(() -> {
webpTest.setText("WebP is supported.");
});

main.add(
d.addSimpleBooleanSetting("webp"),
d.makeGbc(0, 8, 2, 1, GridBagConstraints.WEST));
d.makeGbc(0, 9, 2, 1, GridBagConstraints.WEST));

//==========================
// Provider specific
Expand Down Expand Up @@ -263,12 +270,16 @@ protected EmoteSettings(SettingsDialog d) {

public static Map<Long, String> makeScaleValues() {
final Map<Long, String> scaleDef = new LinkedHashMap<>();
for (int i=50;i<=200;i += 10) {
if (i == 10) {
scaleDef.put((long)i, "Normal");
} else {
scaleDef.put((long)i, (i)+"%");
}
for (int i = 50; i <= 200; i += 10) {
scaleDef.put((long) i, (i) + "%");
}
return scaleDef;
}

public static Map<Long, String> makeScaleValuesGigantified() {
final Map<Long, String> scaleDef = new LinkedHashMap<>();
for (int i = 100; i <= 200; i += 10) {
scaleDef.put((long) i, "+" + (i - 100) + "%");
}
return scaleDef;
}
Expand Down Expand Up @@ -545,7 +556,7 @@ public static void main(String[] args) {
List<IgnoredEmotes.Item> matches = new ArrayList<>();
matches.add(IgnoredEmotes.Item.parse("Kappa for:c"));
matches.add(IgnoredEmotes.Item.parse("Kappa for:t"));
Emoticon.Builder b = new Emoticon.Builder(Emoticon.Type.TWITCH, "Kappa", null);
Emoticon.Builder b = new Emoticon.Builder(Emoticon.Type.TWITCH, "Kappa");
// b.setStringId("123abc");
System.out.println(new EditIgnoredEmote(null).showDialog(null, b.build(), matches));
System.exit(0);
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/settings/HighlightSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ private void updateTestSubstitutes() {

private static class SubstitutesEditor extends JDialog implements StringEditor {

private static final int INPUT_LENGTH_LIMIT = 100*1000;
private static final int INPUT_LENGTH_LIMIT = 200*1000;

private final JTextArea itemValue = new JTextArea(4, 20);
private final JTextArea info = new JTextArea(20, 68);
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/settings/MainSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public MainSettings(SettingsDialog d) {
SettingsUtil.addLabeledComponent(startSettingsPanel, "settings.startup.onStart", 0, 1, 1, EAST, onStart);

JTextField channels = d.addSimpleStringSetting("autojoinChannel", 25, true);
GuiUtil.installLengthLimitDocumentFilter(channels, 8000, false);
GuiUtil.installLengthLimitDocumentFilter(channels, 80000, false);
SettingsUtil.addLabeledComponent(startSettingsPanel, "settings.startup.channels", 0, 2, 1, EAST, channels);

JCheckBox connectDialogIfMissing = d.addSimpleBooleanSetting("connectDialogIfMissing");
Expand Down
Loading

0 comments on commit b6eeacf

Please sign in to comment.