Updated the client play icons

canary
WolverinDEV 2020-08-10 15:13:03 +02:00
parent ff1feeec99
commit ef770cbc9c
4 changed files with 31 additions and 29 deletions

6
package-lock.json generated
View File

@ -14720,9 +14720,9 @@
}
},
"webpack-svg-sprite-generator": {
"version": "1.0.13",
"resolved": "https://registry.npmjs.org/webpack-svg-sprite-generator/-/webpack-svg-sprite-generator-1.0.13.tgz",
"integrity": "sha512-1KZG+RpLeBZiFCUzKIVWfWUW24JccomaoYyNgKoYldCt4A4DgZPxsBi1QttfTtPzKJlGKXSlwps9RANGLEJY+Q==",
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/webpack-svg-sprite-generator/-/webpack-svg-sprite-generator-1.0.14.tgz",
"integrity": "sha512-F6NOiVxSnh5Ig6Ir1gXAnvEHBBP+nLv+6zl5oZ713BdZnuGPW2YWDsWXzJBOWcuARtHdH7m8sn4rNKUYr1WYug==",
"dev": true,
"requires": {
"fs-extra": "^9.0.1",

View File

@ -77,7 +77,7 @@
"webpack": "^4.42.1",
"webpack-bundle-analyzer": "^3.6.1",
"webpack-cli": "^3.3.11",
"webpack-svg-sprite-generator": "^1.0.13",
"webpack-svg-sprite-generator": "^1.0.14",
"worker-plugin": "^4.0.2",
"xml-parser": "^1.2.1"
},

View File

@ -9,7 +9,8 @@ import {
ClientEvents,
ClientProperties,
ClientType,
LocalClientEntry, MusicClientEntry
LocalClientEntry,
MusicClientEntry
} from "../client";
import {EventHandler, ReactEventHandler} from "tc-shared/events";
import {Group, GroupEvents} from "tc-shared/permission/GroupManager";
@ -17,6 +18,8 @@ import {Settings, settings} from "tc-shared/settings";
import {TreeEntry, UnreadMarker} from "tc-shared/ui/tree/TreeEntry";
import {LocalIconRenderer} from "tc-shared/ui/react-elements/Icon";
import * as DOMPurify from "dompurify";
import {ClientIcon} from "svg-sprites/client-icons";
import {ClientIconRenderer} from "tc-shared/ui/react-elements/Icons";
const clientStyle = require("./Client.scss");
const viewStyle = require("./View.scss");
@ -39,48 +42,43 @@ class ClientSpeakIcon extends ReactComponentBase<ClientIconProperties, {}> {
];
render() {
let icon: string = "";
let clicon: string = "";
const client = this.props.client;
const properties = client.properties;
let icon: ClientIcon;
if(properties.client_type_exact == ClientType.CLIENT_QUERY) {
icon = "client-server_query";
icon = ClientIcon.ServerQuery;
} else {
if (properties.client_away) {
icon = "client-away";
icon = ClientIcon.Away;
} else if (!client.get_audio_handle() && !(this instanceof LocalClientEntry)) {
icon = "client-input_muted_local";
icon = ClientIcon.InputMutedLocal;
} else if(!properties.client_output_hardware) {
icon = "client-hardware_output_muted";
icon = ClientIcon.HardwareOutputMuted;
} else if(properties.client_output_muted) {
icon = "client-output_muted";
icon = ClientIcon.OutputMuted;
} else if(!properties.client_input_hardware) {
icon = "client-hardware_input_muted";
icon = ClientIcon.HardwareInputMuted;
} else if(properties.client_input_muted) {
icon = "client-input_muted";
icon = ClientIcon.InputMuted;
} else {
if(client.isSpeaking()) {
if(properties.client_is_channel_commander)
clicon = "client_cc_talk";
else
clicon = "client_talk";
if(properties.client_is_channel_commander) {
icon = ClientIcon.PlayerCommanderOn;
} else {
if(properties.client_is_channel_commander)
clicon = "client_cc_idle";
else
clicon = "client_idle";
icon = ClientIcon.PlayerOn;
}
} else {
if(properties.client_is_channel_commander) {
icon = ClientIcon.PlayerCommanderOff;
} else {
icon = ClientIcon.PlayerOff;
}
}
}
}
if(clicon.length > 0)
return <div className={"clicon " + clicon} />;
else if(icon.length > 0)
return <div className={"icon " + icon} />;
else
return null;
return <ClientIconRenderer icon={icon} />
}
@EventHandler<ClientEvents>("notify_properties_updated")

View File

@ -30,6 +30,10 @@ html:root {
line-height: 1;
}
:global(.icon_em) {
font-size: 16px;
}
.treeEntry {
position: absolute;
left: 0;