This commit is contained in:
Mirco Wittrien 2021-05-13 20:11:04 +02:00
parent 78d1214188
commit dc4e09ba92
3 changed files with 55 additions and 40 deletions

View File

@ -7757,15 +7757,14 @@ module.exports = (_ => {
}
};
const BDFDB_Patrons = Object.assign({}, InternalData.BDFDB_Patrons);
const BDFDB_Patrons = Object.assign({}, InternalData.BDFDB_Patrons), BDFDB_Patron_Tiers = Object.assign({}, InternalData.BDFDB_Patron_Tiers);
InternalBDFDB._processAvatarRender = function (user, avatar) {
if (BDFDB.ReactUtils.isValidElement(avatar) && BDFDB.ObjectUtils.is(user) && (avatar.props.className || "").indexOf(BDFDB.disCN.bdfdbbadgeavatar) == -1) {
avatar.props[InternalData.userIdAttribute] = user.id;
let role = "", className = BDFDB.DOMUtils.formatClassName((avatar.props.className || "").replace(BDFDB.disCN.avatar, "")), addBadge = InternalBDFDB.settings.general.showSupportBadges, customBadge = false;
let role = "", className = BDFDB.DOMUtils.formatClassName((avatar.props.className || "").replace(BDFDB.disCN.avatar, "")), addBadge = InternalBDFDB.settings.general.showSupportBadges;
if (BDFDB_Patrons[user.id] && BDFDB_Patrons[user.id].active) {
role = BDFDB_Patrons[user.id].text || (BDFDB_Patrons[user.id].t3 ? "BDFDB Patron Level 2" : "BDFDB Patron");
customBadge = addBadge && BDFDB_Patrons[user.id].t3 && BDFDB_Patrons[user.id].custom;
className = BDFDB.DOMUtils.formatClassName(className, addBadge && BDFDB.disCN.bdfdbhasbadge, BDFDB.disCN.bdfdbbadgeavatar, BDFDB.disCN.bdfdbsupporter, customBadge && BDFDB.disCN.bdfdbsupportercustom);
role = BDFDB_Patrons[user.id].text || (BDFDB_Patron_Tiers[BDFDB_Patrons[user.id].tier] || {}).text;
className = BDFDB.DOMUtils.formatClassName(className, addBadge && BDFDB.disCN.bdfdbhasbadge, BDFDB.disCN.bdfdbbadgeavatar, BDFDB.disCN.bdfdbsupporter, BDFDB.disCN[`bdfdbsupporter${BDFDB_Patrons[user.id].tier}`]);
}
if (user.id == InternalData.myId) {
addBadge = true;
@ -7799,27 +7798,24 @@ module.exports = (_ => {
if (Node.prototype.isPrototypeOf(avatar) && BDFDB.ObjectUtils.is(user) && (avatar.className || "").indexOf(BDFDB.disCN.bdfdbbadgeavatar) == -1) {
if (wrapper) wrapper.setAttribute(InternalData.userIdAttribute, user.id);
avatar.setAttribute(InternalData.userIdAttribute, user.id);
let role = "", addBadge = InternalBDFDB.settings.general.showSupportBadges, customBadge = false;
let role = "", addBadge = InternalBDFDB.settings.general.showSupportBadges;
if (BDFDB_Patrons[user.id] && BDFDB_Patrons[user.id].active) {
role = BDFDB_Patrons[user.id].text || (BDFDB_Patrons[user.id].t3 ? "BDFDB Patron Level 2" : "BDFDB Patron");
customBadge = addBadge && BDFDB_Patrons[user.id].t3 && BDFDB_Patrons[user.id].custom;
avatar.className = BDFDB.DOMUtils.formatClassName(avatar.className, addBadge && BDFDB.disCN.bdfdbhasbadge, BDFDB.disCN.bdfdbbadgeavatar, BDFDB.disCN.bdfdbsupporter, customBadge && BDFDB.disCN.bdfdbsupportercustom);
role = BDFDB_Patrons[user.id].text || (BDFDB_Patron_Tiers[BDFDB_Patrons[user.id].tier] || {}).text;
avatar.className = BDFDB.DOMUtils.formatClassName(avatar.className, addBadge && BDFDB.disCN.bdfdbhasbadge, BDFDB.disCN.bdfdbbadgeavatar, BDFDB.disCN.bdfdbsupporter, BDFDB.disCN[`bdfdbsupporter${BDFDB_Patrons[user.id].tier}`]);
}
else if (user.id == InternalData.myId) {
addBadge = true;
role = `Theme ${BDFDB.LanguageUtils.LibraryStrings.developer}`;
avatar.className = BDFDB.DOMUtils.formatClassName(avatar.className, addBadge && BDFDB.disCN.bdfdbhasbadge, BDFDB.disCN.bdfdbbadgeavatar, BDFDB.disCN.bdfdbdev);
}
if (role && !avatar.querySelector(BDFDB.dotCN.bdfdbbadge)) {
if (addBadge) {
let badge = document.createElement("div");
badge.className = BDFDB.disCN.bdfdbbadge;
badge.addEventListener("mouseenter", _ => BDFDB.TooltipUtils.create(badge, role, {position: "top"}));
avatar.style.setProperty("position", "relative");
avatar.style.setProperty("overflow", "visible");
avatar.style.setProperty("border-radius", 0);
avatar.appendChild(badge);
}
if (addBadge && role && !avatar.querySelector(BDFDB.dotCN.bdfdbbadge)) {
let badge = document.createElement("div");
badge.className = BDFDB.disCN.bdfdbbadge;
badge.addEventListener("mouseenter", _ => BDFDB.TooltipUtils.create(badge, role, {position: "top"}));
avatar.style.setProperty("position", "relative");
avatar.style.setProperty("overflow", "visible");
avatar.style.setProperty("border-radius", 0);
avatar.appendChild(badge);
}
}
};

View File

@ -699,7 +699,10 @@
"sliderBubble": "bubble-3we2di",
"switchMini": "mini-6F2SSa",
"supporter": "supporter-Z3FfwL",
"supporterCustom": "customSupporter-thxL4U",
"supporterTier1": "tier1-841W86",
"supporterTier2": "tier2-VDTzC3",
"supporterTier3": "tier3-yTxjsy",
"supporterTier4": "tier4-5RNl6k",
"svgIcon": "icon-GhnIRB",
"svgIconWrapper": "iconWrapper-g20jFn",
"tabBarContainerBottom": "bottom-b8sdfs",
@ -946,7 +949,7 @@
"StaffTag": {
"adminIcon": "admin-Kv1Hp_",
"managementIcon": "management-3fF_o8",
"ownerIcon": "owner-FfFh3B-"
"ownerIcon": "owner-FfFh3B"
},
"ThemeRepo": {
"dragBar": "dragBar-4FsRaa",
@ -1572,7 +1575,10 @@
"bdfdbdev": ["BDFDB", "dev"],
"bdfdbhasbadge": ["BDFDB", "hasBadge"],
"bdfdbsupporter": ["BDFDB", "supporter"],
"bdfdbsupportercustom": ["BDFDB", "supporterCustom"],
"bdfdbsupportert1": ["BDFDB", "supporterTier1"],
"bdfdbsupportert2": ["BDFDB", "supporterTier2"],
"bdfdbsupportert3": ["BDFDB", "supporterTier3"],
"bdfdbsupportert4": ["BDFDB", "supporterTier4"],
"bold": ["TextStyle", "bold"],
"bottag": ["BotTag", "botTag"],
"bottaginvert": ["BotTag", "botTagInvert"],
@ -4742,19 +4748,32 @@
}
},
"BDFDB_Patrons": {
"646354877336911884": {"active": true, "t3": true, "custom": true, "text": "", "id": "case (kharri)"},
"431078101997584395": {"active": true, "t3": false, "custom": false, "text": "", "id": "LEMI (f4g8)"},
"268824390337036298": {"active": true, "t3": false, "custom": false, "text": "", "id": "lonelyw0lf (GriWa)"},
"354191516979429376": {"active": true, "t3": false, "custom": false, "text": "", "id": "HypedDomi (DoBu)"},
"596006086511689748": {"active": true, "t3": false, "custom": false, "text": "", "id": "Marshtomp (DsOp)"},
"341383936984875020": {"active": true, "t3": true, "custom": false, "text": "", "id": "dannycoch (DaCo)"},
"121188168002174976": {"active": true, "t3": false, "custom": false, "text": "", "id": "Aven (Syn)"},
"264486632525135883": {"active": true, "t3": false, "custom": false, "text": "", "id": "strix (A1C)"},
"363785301195358221": {"active": true, "t3": false, "custom": false, "text": "", "id": "TRENT (KABEL)"},
"174868361040232448": {"active": true, "t3": false, "custom": false, "text": "", "id": "GIBBU (Ian)"},
"443943393660239872": {"active": true, "t3": true, "custom": false, "text": "", "id": "SARGE (PaSh)"},
"620397524494057513": {"active": true, "t3": true, "custom": false, "text": "", "id": "FUSL"},
"838434341197316126": {"active": true, "t3": true, "custom": true, "text": "Allmächtig", "id": "K E R"}
"646354877336911884": {"active": true, "tier": "t3", "text": "", "id": "case (kharri)"},
"431078101997584395": {"active": true, "tier": "t2", "text": "", "id": "LEMI (f4g8)"},
"268824390337036298": {"active": true, "tier": "t2", "text": "", "id": "lonelyw0lf (GriWa)"},
"354191516979429376": {"active": true, "tier": "t2", "text": "", "id": "HypedDomi (DoBu)"},
"596006086511689748": {"active": true, "tier": "t2", "text": "", "id": "Marshtomp (DsOp)"},
"341383936984875020": {"active": true, "tier": "t3", "text": "", "id": "dannycoch (DaCo)"},
"121188168002174976": {"active": true, "tier": "t2", "text": "", "id": "Aven (Syn)"},
"264486632525135883": {"active": true, "tier": "t2", "text": "", "id": "strix (A1C)"},
"363785301195358221": {"active": true, "tier": "t2", "text": "", "id": "TRENT (KABEL)"},
"174868361040232448": {"active": true, "tier": "t2", "text": "", "id": "GIBBU (Ian)"},
"443943393660239872": {"active": true, "tier": "t3", "text": "", "id": "SARGE (PaSh)"},
"620397524494057513": {"active": true, "tier": "t3", "text": "", "id": "FUSL"},
"838434341197316126": {"active": true, "tier": "t4", "text": "Allmächtig", "id": "K E R"}
},
"BDFDB_Patron_Tiers": {}
"BDFDB_Patron_Tiers": {
"t1": {
"text": ""
},
"t2": {
"text": "BDFDB Patron"
},
"t3": {
"text": "BDFDB Patron+"
},
"t4": {
"text": "BDFDB Special Supporter"
}
}
}

View File

@ -13,13 +13,13 @@
width: 30% !important;
height: 30% !important;
}
.root-SR8cQa .topSectionPlaying-1J5E4n .supporter-Z3FfwL.hasBadge-4rT8_u:not(.customSupporter-thxL4U) .badge-7R_W3s,
.userPopout-3XzG_A .headerPlaying-j0WQBV .supporter-Z3FfwL.hasBadge-4rT8_u:not(.customSupporter-thxL4U) .badge-7R_W3s {
.root-SR8cQa .topSectionPlaying-1J5E4n .supporter-Z3FfwL.hasBadge-4rT8_u .badge-7R_W3s,
.userPopout-3XzG_A .headerPlaying-j0WQBV .supporter-Z3FfwL.hasBadge-4rT8_u .badge-7R_W3s {
filter: brightness(80%) !important;
}
/* K E R */
.supporter-Z3FfwL.hasBadge-4rT8_u.customSupporter-thxL4U[data-user-id="838434341197316126"] .badge-7R_W3s {
.supporter-Z3FfwL.hasBadge-4rT8_u[data-user-id="838434341197316126"] .badge-7R_W3s {
-webkit-mask: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 16 16"><path fill="white" d="M13.6572 5.42868C13.8879 5.29002 14.1806 5.30402 14.3973 5.46468C14.6133 5.62602 14.7119 5.90068 14.6473 6.16202L13.3139 11.4954C13.2393 11.7927 12.9726 12.0007 12.6666 12.0007H3.33325C3.02725 12.0007 2.76058 11.792 2.68592 11.4954L1.35258 6.16202C1.28792 5.90068 1.38658 5.62602 1.60258 5.46468C1.81992 5.30468 2.11192 5.29068 2.34325 5.42868L5.13192 7.10202L7.44592 3.63068C7.46173 3.60697 7.48377 3.5913 7.50588 3.57559C7.5192 3.56612 7.53255 3.55663 7.54458 3.54535L6.90258 2.90268C6.77325 2.77335 6.77325 2.56068 6.90258 2.43135L7.76458 1.56935C7.89392 1.44002 8.10658 1.44002 8.23592 1.56935L9.09792 2.43135C9.22725 2.56068 9.22725 2.77335 9.09792 2.90268L8.45592 3.54535C8.46794 3.55686 8.48154 3.56651 8.49516 3.57618C8.51703 3.5917 8.53897 3.60727 8.55458 3.63068L10.8686 7.10202L13.6572 5.42868ZM2.66667 12.6673H13.3333V14.0007H2.66667V12.6673Z"/></svg>') center/cover no-repeat !important;
background: #FFD300 !important;
top: 69% !important;
@ -29,7 +29,7 @@
}
/* case */
.supporter-Z3FfwL.hasBadge-4rT8_u.customSupporter-thxL4U[data-user-id="646354877336911884"] .badge-7R_W3s {
.supporter-Z3FfwL.hasBadge-4rT8_u[data-user-id="646354877336911884"] .badge-7R_W3s {
-webkit-mask: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 20 20"><path fill="white" d="M12.5,17.6l3.6,2.2a1,1,0,0,0,1.5-1.1l-1-4.1a1,1,0,0,1,.3-1l3.2-2.8A1,1,0,0,0,19.5,9l-4.2-.4a.87.87,0,0,1-.8-.6L12.9,4.1a1.05,1.05,0,0,0-1.9,0l-1.6,4a1,1,0,0,1-.8.6L4.4,9a1.06,1.06,0,0,0-.6,1.8L7,13.6a.91.91,0,0,1,.3,1l-1,4.1a1,1,0,0,0,1.5,1.1l3.6-2.2A1.08,1.08,0,0,1,12.5,17.6Z"/></svg>') center/cover no-repeat !important;
background: #5800FD !important;
top: 67% !important;