Fix and restyle the emote wheel
The slot index was taken before the middle slot was skipped, so page one showed emotes 0-4 and 6-8: emote 5 never appeared and emote 8 showed on two pages. Emotes now fill the eight cells around the middle in order, and slots past the last emote aren't drawn, so they can't play a null emote. Emotes show as EmoteTiles: the preview in its own colors (it was tinted, almost black on hover), the name under it, an accent outline on hover, and an icon when an emote has no preview. The middle cell holds the page and its arrows when there's more than one page. Emote names and cosmetic names share Utils.nameFromId. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -47,6 +47,24 @@ public class Utils {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A display name from an id: each underscore-separated word capitalized, so
|
||||
* "black_hole_white" becomes "Black Hole White".
|
||||
*/
|
||||
public static String nameFromId(String id) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String word : id.split("_")) {
|
||||
if (word.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (!builder.isEmpty()) {
|
||||
builder.append(' ');
|
||||
}
|
||||
builder.append(Character.toUpperCase(word.charAt(0))).append(word.substring(1));
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static <T> T getOrNull(List<T> list, int index) {
|
||||
return (index >= 0 && index < list.size()) ? list.get(index) : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user