Icon packs are read in TeamSpeak's own format — a zip (or unpacked folder) of SVG/PNG art plus a settings.ini mapping icon keys to files — so the packs of an installed client and the ones from its add-on site work unchanged. Legacy packs without that mapping (default.zip) are resolved by their file naming convention instead, picking the resolution closest to the drawn size. The pack draws the tree, toolbar, menus, context menus, file browser and the default group icons; a pack's FALLBACK option decides whether what it lacks comes from default.zip, and anything still missing falls back to the icons the client draws itself. Options → Design picks the pack and shows a viewer of everything in it. Vector art is rasterised with JSVG, and the pack search roots are shared with the sound packs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
44 lines
1.5 KiB
Java
44 lines
1.5 KiB
Java
package com.ts3client.ui;
|
|
|
|
import com.ts3client.net.ClientEntry;
|
|
|
|
import javax.swing.JMenuItem;
|
|
import javax.swing.JPopupMenu;
|
|
|
|
/**
|
|
* The context menu for a client, shared by the server tree and the clickable
|
|
* names in the chat log.
|
|
*/
|
|
final class ClientMenu {
|
|
|
|
private ClientMenu() {
|
|
}
|
|
|
|
static JPopupMenu build(ClientEntry client, boolean self, ServerTreePanel.Actions actions) {
|
|
JPopupMenu menu = new JPopupMenu();
|
|
if (!self) {
|
|
JMenuItem pm = new JMenuItem("Open text chat", Icons.of("PLAYER_CHAT"));
|
|
pm.addActionListener(a -> actions.openPrivateChat(client));
|
|
menu.add(pm);
|
|
JMenuItem poke = new JMenuItem("Poke", Icons.of("POKE"));
|
|
poke.addActionListener(a -> actions.pokeClient(client));
|
|
menu.add(poke);
|
|
menu.addSeparator();
|
|
boolean muted = actions.isClientLocallyMuted(client.id);
|
|
JMenuItem mute = new JMenuItem(muted ? "Unmute client" : "Mute client",
|
|
Icons.of(muted ? "PLAYER_ON" : "INPUT_MUTED"));
|
|
mute.addActionListener(a -> actions.toggleClientMute(client));
|
|
menu.add(mute);
|
|
} else {
|
|
JMenuItem me = new JMenuItem("This is you", Icons.of("PLAYER_OFF"));
|
|
me.setEnabled(false);
|
|
menu.add(me);
|
|
}
|
|
menu.addSeparator();
|
|
JMenuItem info = new JMenuItem("Connection Info", Icons.of("INFO"));
|
|
info.addActionListener(a -> actions.showConnectionInfo(client));
|
|
menu.add(info);
|
|
return menu;
|
|
}
|
|
}
|