Updated the client play icons
This commit is contained in:
parent
ff1feeec99
commit
ef770cbc9c
4 changed files with 31 additions and 29 deletions
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -14720,9 +14720,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"webpack-svg-sprite-generator": {
|
"webpack-svg-sprite-generator": {
|
||||||
"version": "1.0.13",
|
"version": "1.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-svg-sprite-generator/-/webpack-svg-sprite-generator-1.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-svg-sprite-generator/-/webpack-svg-sprite-generator-1.0.14.tgz",
|
||||||
"integrity": "sha512-1KZG+RpLeBZiFCUzKIVWfWUW24JccomaoYyNgKoYldCt4A4DgZPxsBi1QttfTtPzKJlGKXSlwps9RANGLEJY+Q==",
|
"integrity": "sha512-F6NOiVxSnh5Ig6Ir1gXAnvEHBBP+nLv+6zl5oZ713BdZnuGPW2YWDsWXzJBOWcuARtHdH7m8sn4rNKUYr1WYug==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"fs-extra": "^9.0.1",
|
"fs-extra": "^9.0.1",
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
"webpack": "^4.42.1",
|
"webpack": "^4.42.1",
|
||||||
"webpack-bundle-analyzer": "^3.6.1",
|
"webpack-bundle-analyzer": "^3.6.1",
|
||||||
"webpack-cli": "^3.3.11",
|
"webpack-cli": "^3.3.11",
|
||||||
"webpack-svg-sprite-generator": "^1.0.13",
|
"webpack-svg-sprite-generator": "^1.0.14",
|
||||||
"worker-plugin": "^4.0.2",
|
"worker-plugin": "^4.0.2",
|
||||||
"xml-parser": "^1.2.1"
|
"xml-parser": "^1.2.1"
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,7 +9,8 @@ import {
|
||||||
ClientEvents,
|
ClientEvents,
|
||||||
ClientProperties,
|
ClientProperties,
|
||||||
ClientType,
|
ClientType,
|
||||||
LocalClientEntry, MusicClientEntry
|
LocalClientEntry,
|
||||||
|
MusicClientEntry
|
||||||
} from "../client";
|
} from "../client";
|
||||||
import {EventHandler, ReactEventHandler} from "tc-shared/events";
|
import {EventHandler, ReactEventHandler} from "tc-shared/events";
|
||||||
import {Group, GroupEvents} from "tc-shared/permission/GroupManager";
|
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 {TreeEntry, UnreadMarker} from "tc-shared/ui/tree/TreeEntry";
|
||||||
import {LocalIconRenderer} from "tc-shared/ui/react-elements/Icon";
|
import {LocalIconRenderer} from "tc-shared/ui/react-elements/Icon";
|
||||||
import * as DOMPurify from "dompurify";
|
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 clientStyle = require("./Client.scss");
|
||||||
const viewStyle = require("./View.scss");
|
const viewStyle = require("./View.scss");
|
||||||
|
@ -39,48 +42,43 @@ class ClientSpeakIcon extends ReactComponentBase<ClientIconProperties, {}> {
|
||||||
];
|
];
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let icon: string = "";
|
|
||||||
let clicon: string = "";
|
|
||||||
|
|
||||||
const client = this.props.client;
|
const client = this.props.client;
|
||||||
const properties = client.properties;
|
const properties = client.properties;
|
||||||
|
|
||||||
|
let icon: ClientIcon;
|
||||||
if(properties.client_type_exact == ClientType.CLIENT_QUERY) {
|
if(properties.client_type_exact == ClientType.CLIENT_QUERY) {
|
||||||
icon = "client-server_query";
|
icon = ClientIcon.ServerQuery;
|
||||||
} else {
|
} else {
|
||||||
if (properties.client_away) {
|
if (properties.client_away) {
|
||||||
icon = "client-away";
|
icon = ClientIcon.Away;
|
||||||
} else if (!client.get_audio_handle() && !(this instanceof LocalClientEntry)) {
|
} else if (!client.get_audio_handle() && !(this instanceof LocalClientEntry)) {
|
||||||
icon = "client-input_muted_local";
|
icon = ClientIcon.InputMutedLocal;
|
||||||
} else if(!properties.client_output_hardware) {
|
} else if(!properties.client_output_hardware) {
|
||||||
icon = "client-hardware_output_muted";
|
icon = ClientIcon.HardwareOutputMuted;
|
||||||
} else if(properties.client_output_muted) {
|
} else if(properties.client_output_muted) {
|
||||||
icon = "client-output_muted";
|
icon = ClientIcon.OutputMuted;
|
||||||
} else if(!properties.client_input_hardware) {
|
} else if(!properties.client_input_hardware) {
|
||||||
icon = "client-hardware_input_muted";
|
icon = ClientIcon.HardwareInputMuted;
|
||||||
} else if(properties.client_input_muted) {
|
} else if(properties.client_input_muted) {
|
||||||
icon = "client-input_muted";
|
icon = ClientIcon.InputMuted;
|
||||||
} else {
|
} else {
|
||||||
if(client.isSpeaking()) {
|
if(client.isSpeaking()) {
|
||||||
if(properties.client_is_channel_commander)
|
if(properties.client_is_channel_commander) {
|
||||||
clicon = "client_cc_talk";
|
icon = ClientIcon.PlayerCommanderOn;
|
||||||
else
|
|
||||||
clicon = "client_talk";
|
|
||||||
} else {
|
} else {
|
||||||
if(properties.client_is_channel_commander)
|
icon = ClientIcon.PlayerOn;
|
||||||
clicon = "client_cc_idle";
|
}
|
||||||
else
|
} else {
|
||||||
clicon = "client_idle";
|
if(properties.client_is_channel_commander) {
|
||||||
|
icon = ClientIcon.PlayerCommanderOff;
|
||||||
|
} else {
|
||||||
|
icon = ClientIcon.PlayerOff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(clicon.length > 0)
|
return <ClientIconRenderer icon={icon} />
|
||||||
return <div className={"clicon " + clicon} />;
|
|
||||||
else if(icon.length > 0)
|
|
||||||
return <div className={"icon " + icon} />;
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler<ClientEvents>("notify_properties_updated")
|
@EventHandler<ClientEvents>("notify_properties_updated")
|
||||||
|
|
|
@ -30,6 +30,10 @@ html:root {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global(.icon_em) {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.treeEntry {
|
.treeEntry {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue