forked from External/mage
* Added to all toUpperCase/toLowerCase calls the Locale.ENGLISH to prevent problems with some languages (e.g. Turkish). Removed some unused import statements. (#4634).
This commit is contained in:
parent
03ebdc17d8
commit
b073ce1c42
147 changed files with 1419 additions and 1496 deletions
|
|
@ -28,6 +28,7 @@
|
|||
package mage.client.util;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Locale;
|
||||
import mage.view.CardView;
|
||||
|
||||
/**
|
||||
|
|
@ -99,7 +100,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
|
|||
boolean whenYouCast = false;
|
||||
|
||||
for (String str : card.getRules()) {
|
||||
String s = str.toLowerCase();
|
||||
String s = str.toLowerCase(Locale.ENGLISH);
|
||||
annihilator |= s.contains("annihilator");
|
||||
anyNumberOfTarget |= s.contains("any number");
|
||||
buyback |= s.contains("buyback");
|
||||
|
|
@ -332,16 +333,16 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
|
|||
}
|
||||
|
||||
if (card.getCardTypes().contains("Plainswalker")) {
|
||||
if (card.getName().toLowerCase().equals("jace, the mind sculptor")) {
|
||||
if (card.getName().toLowerCase(Locale.ENGLISH).equals("jace, the mind sculptor")) {
|
||||
thisMaxPower = Math.max(thisMaxPower, 6);
|
||||
}
|
||||
if (card.getName().toLowerCase().equals("ugin, the spirit dragon")) {
|
||||
if (card.getName().toLowerCase(Locale.ENGLISH).equals("ugin, the spirit dragon")) {
|
||||
thisMaxPower = Math.max(thisMaxPower, 5);
|
||||
}
|
||||
thisMaxPower = Math.max(thisMaxPower, 4);
|
||||
}
|
||||
|
||||
String cn = card.getName().toLowerCase();
|
||||
String cn = card.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (cn.equals("ancient tomb")
|
||||
|| cn.equals("anafenza, the foremost")
|
||||
|| cn.equals("arcum dagsson")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package mage.client.util;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.client.SessionHandler;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package mage.client.util;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.preference.MagePreferences;
|
||||
import mage.view.ChatMessage;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
public final class IgnoreList {
|
||||
|
||||
private static final String USAGE = "<br/><font color=yellow>\\ignore - shows current ignore list on this server."
|
||||
|
|
@ -15,8 +14,8 @@ public final class IgnoreList {
|
|||
+ "<br/>\\unignore [username] - remove a username from your ignore list on this server.</font>";
|
||||
|
||||
public static final int MAX_IGNORE_LIST_SIZE = 50;
|
||||
public static Set<ChatMessage.MessageType> IGNORED_MESSAGE_TYPES =
|
||||
ImmutableSet.of(ChatMessage.MessageType.TALK,
|
||||
public static Set<ChatMessage.MessageType> IGNORED_MESSAGE_TYPES
|
||||
= ImmutableSet.of(ChatMessage.MessageType.TALK,
|
||||
ChatMessage.MessageType.WHISPER_FROM);
|
||||
|
||||
public static String usage() {
|
||||
|
|
@ -45,22 +44,13 @@ public final class IgnoreList {
|
|||
}
|
||||
|
||||
if (userIsIgnored(serverAddress, user)) {
|
||||
return new StringBuilder()
|
||||
.append(user)
|
||||
.append(" is already on your ignore list on ")
|
||||
.append(serverAddress)
|
||||
.toString();
|
||||
return user + " is already on your ignore list on " + serverAddress;
|
||||
}
|
||||
|
||||
MagePreferences.addIgnoredUser(serverAddress, user);
|
||||
updateTablesTable();
|
||||
|
||||
return new StringBuilder()
|
||||
.append("Added ")
|
||||
.append(user)
|
||||
.append(" to your ignore list on ")
|
||||
.append(serverAddress)
|
||||
.toString();
|
||||
return "Added " + user + " to your ignore list on " + serverAddress;
|
||||
}
|
||||
|
||||
private static void updateTablesTable() {
|
||||
|
|
@ -76,19 +66,9 @@ public final class IgnoreList {
|
|||
}
|
||||
if (MagePreferences.removeIgnoredUser(serverAddress, user)) {
|
||||
updateTablesTable();
|
||||
return new StringBuilder()
|
||||
.append("Removed ")
|
||||
.append(user)
|
||||
.append(" from your ignore list on ")
|
||||
.append(serverAddress)
|
||||
.toString();
|
||||
return "Removed " + user + " from your ignore list on " + serverAddress;
|
||||
} else {
|
||||
return new StringBuilder()
|
||||
.append("No such user \"")
|
||||
.append(user)
|
||||
.append("\" on your ignore list on ")
|
||||
.append(serverAddress)
|
||||
.toString();
|
||||
return "No such user \"" + user + "\" on your ignore list on " + serverAddress;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package mage.client.util.audio;
|
|||
|
||||
import java.awt.List;
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.sound.sampled.*;
|
||||
import mage.client.constants.Constants;
|
||||
|
|
@ -38,7 +39,7 @@ public class MusicPlayer {
|
|||
}
|
||||
String filename;
|
||||
for (File f : fileread) {
|
||||
filename = f.getName().toLowerCase();
|
||||
filename = f.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (filename.endsWith(".mp3") || filename.endsWith(".wav")) {
|
||||
filelist.add(filename);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import java.awt.FlowLayout;
|
|||
import java.awt.Image;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JComboBox;
|
||||
|
|
@ -77,7 +78,7 @@ public class ColorsChooser extends JComboBox implements ListCellRenderer {
|
|||
|
||||
private void drawOn(JPanel panel, String value) {
|
||||
List<Image> images = new ArrayList<>();
|
||||
value = value.toUpperCase();
|
||||
value = value.toUpperCase(Locale.ENGLISH);
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char symbol = value.charAt(i);
|
||||
Image image = ManaSymbols.getSizedManaSymbol(String.valueOf(symbol));
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package mage.client.util.gui;
|
|||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import javax.swing.*;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
|
|
@ -65,7 +66,7 @@ public final class GuiDisplayUtil {
|
|||
out.append(c);
|
||||
}
|
||||
}
|
||||
return out.toString().toLowerCase();
|
||||
return out.toString().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
public static void keepComponentInsideScreen(int centerX, int centerY, Component component) {
|
||||
|
|
@ -256,7 +257,7 @@ public final class GuiDisplayUtil {
|
|||
rarity = card.getRarity().getCode();
|
||||
}
|
||||
if (card.getExpansionSetCode() != null) {
|
||||
buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(), rarity, GUISizeHelper.symbolTooltipSize));
|
||||
buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(Locale.ENGLISH), rarity, GUISizeHelper.symbolTooltipSize));
|
||||
}
|
||||
buffer.append("</td></tr></table>");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue